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

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

Device tree conversions for samsung and tegra

Both platforms had some initial device tree support, but this adds
much more to actually make it usable.

* tag 'dt' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (45 commits)
ARM: dts: Add intial dts file for EXYNOS4210 SoC, SMDKV310 and ORIGEN
ARM: EXYNOS: Add Exynos4 device tree enabled board file
rtc: rtc-s3c: Add device tree support
input: samsung-keypad: Add device tree support
ARM: S5PV210: Modify platform data for pl330 driver
ARM: S5PC100: Modify platform data for pl330 driver
ARM: S5P64x0: Modify platform data for pl330 driver
ARM: EXYNOS: Add a alias for pdma clocks
ARM: EXYNOS: Limit usage of pl330 device instance to non-dt build
ARM: SAMSUNG: Add device tree support for pl330 dma engine wrappers
DMA: PL330: Add device tree support
ARM: EXYNOS: Modify platform data for pl330 driver
DMA: PL330: Infer transfer direction from transfer request instead of platform data
DMA: PL330: move filter function into driver
serial: samsung: Fix build for non-Exynos4210 devices
serial: samsung: add device tree support
serial: samsung: merge probe() function from all SoC specific extensions
serial: samsung: merge all SoC specific port reset functions
ARM: SAMSUNG: register uart clocks to clock lookup list
serial: samsung: remove all uses of get_clksrc and set_clksrc
...

Fix up fairly trivial conflicts in arch/arm/mach-s3c2440/clock.c and
drivers/tty/serial/Kconfig both due to just adding code close to
changes.

+3024 -2256
+8
Documentation/devicetree/bindings/arm/insignal-boards.txt
··· 1 + * Insignal's Exynos4210 based Origen evaluation board 2 + 3 + Origen low-cost evaluation board is based on Samsung's Exynos4210 SoC. 4 + 5 + Required root node properties: 6 + - compatible = should be one or more of the following. 7 + (a) "samsung,smdkv310" - for Samsung's SMDKV310 eval board. 8 + (b) "samsung,exynos4210" - for boards based on Exynos4210 SoC.
+8
Documentation/devicetree/bindings/arm/samsung-boards.txt
··· 1 + * Samsung's Exynos4210 based SMDKV310 evaluation board 2 + 3 + SMDKV310 evaluation board is based on Samsung's Exynos4210 SoC. 4 + 5 + Required root node properties: 6 + - compatible = should be one or more of the following. 7 + (a) "samsung,smdkv310" - for Samsung's SMDKV310 eval board. 8 + (b) "samsung,exynos4210" - for boards based on Exynos4210 SoC.
+14
Documentation/devicetree/bindings/arm/tegra.txt
··· 1 + NVIDIA Tegra device tree bindings 2 + ------------------------------------------- 3 + 4 + Boards with the tegra20 SoC shall have the following properties: 5 + 6 + Required root node property: 7 + 8 + compatible = "nvidia,tegra20"; 9 + 10 + Boards with the tegra30 SoC shall have the following properties: 11 + 12 + Required root node property: 13 + 14 + compatible = "nvidia,tegra30";
+30
Documentation/devicetree/bindings/dma/arm-pl330.txt
··· 1 + * ARM PrimeCell PL330 DMA Controller 2 + 3 + The ARM PrimeCell PL330 DMA controller can move blocks of memory contents 4 + between memory and peripherals or memory to memory. 5 + 6 + Required properties: 7 + - compatible: should include both "arm,pl330" and "arm,primecell". 8 + - reg: physical base address of the controller and length of memory mapped 9 + region. 10 + - interrupts: interrupt number to the cpu. 11 + 12 + Example: 13 + 14 + pdma0: pdma@12680000 { 15 + compatible = "arm,pl330", "arm,primecell"; 16 + reg = <0x12680000 0x1000>; 17 + interrupts = <99>; 18 + }; 19 + 20 + Client drivers (device nodes requiring dma transfers from dev-to-mem or 21 + mem-to-dev) should specify the DMA channel numbers using a two-value pair 22 + as shown below. 23 + 24 + [property name] = <[phandle of the dma controller] [dma request id]>; 25 + 26 + where 'dma request id' is the dma request number which is connected 27 + to the client controller. The 'property name' is recommended to be 28 + of the form <name>-dma-channel. 29 + 30 + Example: tx-dma-channel = <&pdma0 12>;
+40
Documentation/devicetree/bindings/gpio/gpio-samsung.txt
··· 1 + Samsung Exynos4 GPIO Controller 2 + 3 + Required properties: 4 + - compatible: Compatible property value should be "samsung,exynos4-gpio>". 5 + 6 + - reg: Physical base address of the controller and length of memory mapped 7 + region. 8 + 9 + - #gpio-cells: Should be 4. The syntax of the gpio specifier used by client nodes 10 + should be the following with values derived from the SoC user manual. 11 + <[phandle of the gpio controller node] 12 + [pin number within the gpio controller] 13 + [mux function] 14 + [pull up/down] 15 + [drive strength]> 16 + 17 + Values for gpio specifier: 18 + - Pin number: is a value between 0 to 7. 19 + - Pull Up/Down: 0 - Pull Up/Down Disabled. 20 + 1 - Pull Down Enabled. 21 + 3 - Pull Up Enabled. 22 + - Drive Strength: 0 - 1x, 23 + 1 - 3x, 24 + 2 - 2x, 25 + 3 - 4x 26 + 27 + - gpio-controller: Specifies that the node is a gpio controller. 28 + - #address-cells: should be 1. 29 + - #size-cells: should be 1. 30 + 31 + Example: 32 + 33 + gpa0: gpio-controller@11400000 { 34 + #address-cells = <1>; 35 + #size-cells = <1>; 36 + compatible = "samsung,exynos4-gpio"; 37 + reg = <0x11400000 0x20>; 38 + #gpio-cells = <4>; 39 + gpio-controller; 40 + };
+88
Documentation/devicetree/bindings/input/samsung-keypad.txt
··· 1 + * Samsung's Keypad Controller device tree bindings 2 + 3 + Samsung's Keypad controller is used to interface a SoC with a matrix-type 4 + keypad device. The keypad controller supports multiple row and column lines. 5 + A key can be placed at each intersection of a unique row and a unique column. 6 + The keypad controller can sense a key-press and key-release and report the 7 + event using a interrupt to the cpu. 8 + 9 + Required SoC Specific Properties: 10 + - compatible: should be one of the following 11 + - "samsung,s3c6410-keypad": For controllers compatible with s3c6410 keypad 12 + controller. 13 + - "samsung,s5pv210-keypad": For controllers compatible with s5pv210 keypad 14 + controller. 15 + 16 + - reg: physical base address of the controller and length of memory mapped 17 + region. 18 + 19 + - interrupts: The interrupt number to the cpu. 20 + 21 + Required Board Specific Properties: 22 + - samsung,keypad-num-rows: Number of row lines connected to the keypad 23 + controller. 24 + 25 + - samsung,keypad-num-columns: Number of column lines connected to the 26 + keypad controller. 27 + 28 + - row-gpios: List of gpios used as row lines. The gpio specifier for 29 + this property depends on the gpio controller to which these row lines 30 + are connected. 31 + 32 + - col-gpios: List of gpios used as column lines. The gpio specifier for 33 + this property depends on the gpio controller to which these column 34 + lines are connected. 35 + 36 + - Keys represented as child nodes: Each key connected to the keypad 37 + controller is represented as a child node to the keypad controller 38 + device node and should include the following properties. 39 + - keypad,row: the row number to which the key is connected. 40 + - keypad,column: the column number to which the key is connected. 41 + - linux,code: the key-code to be reported when the key is pressed 42 + and released. 43 + 44 + Optional Properties specific to linux: 45 + - linux,keypad-no-autorepeat: do no enable autorepeat feature. 46 + - linux,keypad-wakeup: use any event on keypad as wakeup event. 47 + 48 + 49 + Example: 50 + keypad@100A0000 { 51 + compatible = "samsung,s5pv210-keypad"; 52 + reg = <0x100A0000 0x100>; 53 + interrupts = <173>; 54 + samsung,keypad-num-rows = <2>; 55 + samsung,keypad-num-columns = <8>; 56 + linux,input-no-autorepeat; 57 + linux,input-wakeup; 58 + 59 + row-gpios = <&gpx2 0 3 3 0 60 + &gpx2 1 3 3 0>; 61 + 62 + col-gpios = <&gpx1 0 3 0 0 63 + &gpx1 1 3 0 0 64 + &gpx1 2 3 0 0 65 + &gpx1 3 3 0 0 66 + &gpx1 4 3 0 0 67 + &gpx1 5 3 0 0 68 + &gpx1 6 3 0 0 69 + &gpx1 7 3 0 0>; 70 + 71 + key_1 { 72 + keypad,row = <0>; 73 + keypad,column = <3>; 74 + linux,code = <2>; 75 + }; 76 + 77 + key_2 { 78 + keypad,row = <0>; 79 + keypad,column = <4>; 80 + linux,code = <3>; 81 + }; 82 + 83 + key_3 { 84 + keypad,row = <0>; 85 + keypad,column = <5>; 86 + linux,code = <4>; 87 + }; 88 + };
+20
Documentation/devicetree/bindings/rtc/s3c-rtc.txt
··· 1 + * Samsung's S3C Real Time Clock controller 2 + 3 + Required properties: 4 + - compatible: should be one of the following. 5 + * "samsung,s3c2410-rtc" - for controllers compatible with s3c2410 rtc. 6 + * "samsung,s3c6410-rtc" - for controllers compatible with s3c6410 rtc. 7 + - reg: physical base address of the controller and length of memory mapped 8 + region. 9 + - interrupts: Two interrupt numbers to the cpu should be specified. First 10 + interrupt number is the rtc alarm interupt and second interrupt number 11 + is the rtc tick interrupt. The number of cells representing a interrupt 12 + depends on the parent interrupt controller. 13 + 14 + Example: 15 + 16 + rtc@10070000 { 17 + compatible = "samsung,s3c6410-rtc"; 18 + reg = <0x10070000 0x100>; 19 + interrupts = <44 0 45 0>; 20 + };
+14
Documentation/devicetree/bindings/serial/samsung_uart.txt
··· 1 + * Samsung's UART Controller 2 + 3 + The Samsung's UART controller is used for interfacing SoC with serial communicaion 4 + devices. 5 + 6 + Required properties: 7 + - compatible: should be 8 + - "samsung,exynos4210-uart", for UART's compatible with Exynos4210 uart ports. 9 + 10 + - reg: base physical address of the controller and length of memory mapped 11 + region. 12 + 13 + - interrupts: interrupt number to the cpu. The interrupt specifier format depends 14 + on the interrupt controller parent.
+13
Documentation/devicetree/bindings/usb/tegra-usb.txt
··· 1 + Tegra SOC USB controllers 2 + 3 + The device node for a USB controller that is part of a Tegra 4 + SOC is as described in the document "Open Firmware Recommended 5 + Practice : Universal Serial Bus" with the following modifications 6 + and additions : 7 + 8 + Required properties : 9 + - compatible : Should be "nvidia,tegra20-ehci" for USB controllers 10 + used in host mode. 11 + - phy_type : Should be one of "ulpi" or "utmi". 12 + - nvidia,vbus-gpio : If present, specifies a gpio that needs to be 13 + activated for the bus to be powered.
+137
arch/arm/boot/dts/exynos4210-origen.dts
··· 1 + /* 2 + * Samsung's Exynos4210 based Origen board device tree source 3 + * 4 + * Copyright (c) 2010-2011 Samsung Electronics Co., Ltd. 5 + * http://www.samsung.com 6 + * Copyright (c) 2010-2011 Linaro Ltd. 7 + * www.linaro.org 8 + * 9 + * Device tree source file for Insignal's Origen board which is based on 10 + * Samsung's Exynos4210 SoC. 11 + * 12 + * This program is free software; you can redistribute it and/or modify 13 + * it under the terms of the GNU General Public License version 2 as 14 + * published by the Free Software Foundation. 15 + */ 16 + 17 + /dts-v1/; 18 + /include/ "exynos4210.dtsi" 19 + 20 + / { 21 + model = "Insignal Origen evaluation board based on Exynos4210"; 22 + compatible = "insignal,origen", "samsung,exynos4210"; 23 + 24 + memory { 25 + reg = <0x40000000 0x40000000>; 26 + }; 27 + 28 + chosen { 29 + bootargs ="root=/dev/ram0 rw ramdisk=8192 initrd=0x41000000,8M console=ttySAC2,115200 init=/linuxrc"; 30 + }; 31 + 32 + sdhci@12530000 { 33 + samsung,sdhci-bus-width = <4>; 34 + linux,mmc_cap_4_bit_data; 35 + samsung,sdhci-cd-internal; 36 + gpio-cd = <&gpk2 2 2 3 3>; 37 + gpios = <&gpk2 0 2 0 3>, 38 + <&gpk2 1 2 0 3>, 39 + <&gpk2 3 2 3 3>, 40 + <&gpk2 4 2 3 3>, 41 + <&gpk2 5 2 3 3>, 42 + <&gpk2 6 2 3 3>; 43 + }; 44 + 45 + sdhci@12510000 { 46 + samsung,sdhci-bus-width = <4>; 47 + linux,mmc_cap_4_bit_data; 48 + samsung,sdhci-cd-internal; 49 + gpio-cd = <&gpk0 2 2 3 3>; 50 + gpios = <&gpk0 0 2 0 3>, 51 + <&gpk0 1 2 0 3>, 52 + <&gpk0 3 2 3 3>, 53 + <&gpk0 4 2 3 3>, 54 + <&gpk0 5 2 3 3>, 55 + <&gpk0 6 2 3 3>; 56 + }; 57 + 58 + gpio_keys { 59 + compatible = "gpio-keys"; 60 + #address-cells = <1>; 61 + #size-cells = <0>; 62 + 63 + up { 64 + label = "Up"; 65 + gpios = <&gpx2 0 0 0 2>; 66 + linux,code = <103>; 67 + }; 68 + 69 + down { 70 + label = "Down"; 71 + gpios = <&gpx2 1 0 0 2>; 72 + linux,code = <108>; 73 + }; 74 + 75 + back { 76 + label = "Back"; 77 + gpios = <&gpx1 7 0 0 2>; 78 + linux,code = <158>; 79 + }; 80 + 81 + home { 82 + label = "Home"; 83 + gpios = <&gpx1 6 0 0 2>; 84 + linux,code = <102>; 85 + }; 86 + 87 + menu { 88 + label = "Menu"; 89 + gpios = <&gpx1 5 0 0 2>; 90 + linux,code = <139>; 91 + }; 92 + }; 93 + 94 + keypad@100A0000 { 95 + status = "disabled"; 96 + }; 97 + 98 + sdhci@12520000 { 99 + status = "disabled"; 100 + }; 101 + 102 + sdhci@12540000 { 103 + status = "disabled"; 104 + }; 105 + 106 + i2c@13860000 { 107 + status = "disabled"; 108 + }; 109 + 110 + i2c@13870000 { 111 + status = "disabled"; 112 + }; 113 + 114 + i2c@13880000 { 115 + status = "disabled"; 116 + }; 117 + 118 + i2c@13890000 { 119 + status = "disabled"; 120 + }; 121 + 122 + i2c@138A0000 { 123 + status = "disabled"; 124 + }; 125 + 126 + i2c@138B0000 { 127 + status = "disabled"; 128 + }; 129 + 130 + i2c@138C0000 { 131 + status = "disabled"; 132 + }; 133 + 134 + i2c@138D0000 { 135 + status = "disabled"; 136 + }; 137 + };
+182
arch/arm/boot/dts/exynos4210-smdkv310.dts
··· 1 + /* 2 + * Samsung's Exynos4210 based SMDKV310 board device tree source 3 + * 4 + * Copyright (c) 2010-2011 Samsung Electronics Co., Ltd. 5 + * http://www.samsung.com 6 + * Copyright (c) 2010-2011 Linaro Ltd. 7 + * www.linaro.org 8 + * 9 + * Device tree source file for Samsung's SMDKV310 board which is based on 10 + * Samsung's Exynos4210 SoC. 11 + * 12 + * This program is free software; you can redistribute it and/or modify 13 + * it under the terms of the GNU General Public License version 2 as 14 + * published by the Free Software Foundation. 15 + */ 16 + 17 + /dts-v1/; 18 + /include/ "exynos4210.dtsi" 19 + 20 + / { 21 + model = "Samsung smdkv310 evaluation board based on Exynos4210"; 22 + compatible = "samsung,smdkv310", "samsung,exynos4210"; 23 + 24 + memory { 25 + reg = <0x40000000 0x80000000>; 26 + }; 27 + 28 + chosen { 29 + bootargs = "root=/dev/ram0 rw ramdisk=8192 initrd=0x41000000,8M console=ttySAC1,115200 init=/linuxrc"; 30 + }; 31 + 32 + sdhci@12530000 { 33 + samsung,sdhci-bus-width = <4>; 34 + linux,mmc_cap_4_bit_data; 35 + samsung,sdhci-cd-internal; 36 + gpio-cd = <&gpk2 2 2 3 3>; 37 + gpios = <&gpk2 0 2 0 3>, 38 + <&gpk2 1 2 0 3>, 39 + <&gpk2 3 2 3 3>, 40 + <&gpk2 4 2 3 3>, 41 + <&gpk2 5 2 3 3>, 42 + <&gpk2 6 2 3 3>; 43 + }; 44 + 45 + keypad@100A0000 { 46 + samsung,keypad-num-rows = <2>; 47 + samsung,keypad-num-columns = <8>; 48 + linux,keypad-no-autorepeat; 49 + linux,keypad-wakeup; 50 + 51 + row-gpios = <&gpx2 0 3 3 0>, 52 + <&gpx2 1 3 3 0>; 53 + 54 + col-gpios = <&gpx1 0 3 0 0>, 55 + <&gpx1 1 3 0 0>, 56 + <&gpx1 2 3 0 0>, 57 + <&gpx1 3 3 0 0>, 58 + <&gpx1 4 3 0 0>, 59 + <&gpx1 5 3 0 0>, 60 + <&gpx1 6 3 0 0>, 61 + <&gpx1 7 3 0 0>; 62 + 63 + key_1 { 64 + keypad,row = <0>; 65 + keypad,column = <3>; 66 + linux,code = <2>; 67 + }; 68 + 69 + key_2 { 70 + keypad,row = <0>; 71 + keypad,column = <4>; 72 + linux,code = <3>; 73 + }; 74 + 75 + key_3 { 76 + keypad,row = <0>; 77 + keypad,column = <5>; 78 + linux,code = <4>; 79 + }; 80 + 81 + key_4 { 82 + keypad,row = <0>; 83 + keypad,column = <6>; 84 + linux,code = <5>; 85 + }; 86 + 87 + key_5 { 88 + keypad,row = <0>; 89 + keypad,column = <7>; 90 + linux,code = <6>; 91 + }; 92 + 93 + key_a { 94 + keypad,row = <1>; 95 + keypad,column = <3>; 96 + linux,code = <30>; 97 + }; 98 + 99 + key_b { 100 + keypad,row = <1>; 101 + keypad,column = <4>; 102 + linux,code = <48>; 103 + }; 104 + 105 + key_c { 106 + keypad,row = <1>; 107 + keypad,column = <5>; 108 + linux,code = <46>; 109 + }; 110 + 111 + key_d { 112 + keypad,row = <1>; 113 + keypad,column = <6>; 114 + linux,code = <32>; 115 + }; 116 + 117 + key_e { 118 + keypad,row = <1>; 119 + keypad,column = <7>; 120 + linux,code = <18>; 121 + }; 122 + }; 123 + 124 + i2c@13860000 { 125 + #address-cells = <1>; 126 + #size-cells = <0>; 127 + samsung,i2c-sda-delay = <100>; 128 + samsung,i2c-max-bus-freq = <20000>; 129 + gpios = <&gpd1 0 2 3 0>, 130 + <&gpd1 1 2 3 0>; 131 + 132 + eeprom@50 { 133 + compatible = "samsung,24ad0xd1"; 134 + reg = <0x50>; 135 + }; 136 + 137 + eeprom@52 { 138 + compatible = "samsung,24ad0xd1"; 139 + reg = <0x52>; 140 + }; 141 + }; 142 + 143 + sdhci@12510000 { 144 + status = "disabled"; 145 + }; 146 + 147 + sdhci@12520000 { 148 + status = "disabled"; 149 + }; 150 + 151 + sdhci@12540000 { 152 + status = "disabled"; 153 + }; 154 + 155 + i2c@13870000 { 156 + status = "disabled"; 157 + }; 158 + 159 + i2c@13880000 { 160 + status = "disabled"; 161 + }; 162 + 163 + i2c@13890000 { 164 + status = "disabled"; 165 + }; 166 + 167 + i2c@138A0000 { 168 + status = "disabled"; 169 + }; 170 + 171 + i2c@138B0000 { 172 + status = "disabled"; 173 + }; 174 + 175 + i2c@138C0000 { 176 + status = "disabled"; 177 + }; 178 + 179 + i2c@138D0000 { 180 + status = "disabled"; 181 + }; 182 + };
+397
arch/arm/boot/dts/exynos4210.dtsi
··· 1 + /* 2 + * Samsung's Exynos4210 SoC device tree source 3 + * 4 + * Copyright (c) 2010-2011 Samsung Electronics Co., Ltd. 5 + * http://www.samsung.com 6 + * Copyright (c) 2010-2011 Linaro Ltd. 7 + * www.linaro.org 8 + * 9 + * Samsung's Exynos4210 SoC device nodes are listed in this file. Exynos4210 10 + * based board files can include this file and provide values for board specfic 11 + * bindings. 12 + * 13 + * Note: This file does not include device nodes for all the controllers in 14 + * Exynos4210 SoC. As device tree coverage for Exynos4210 increases, additional 15 + * nodes can be added to this file. 16 + * 17 + * This program is free software; you can redistribute it and/or modify 18 + * it under the terms of the GNU General Public License version 2 as 19 + * published by the Free Software Foundation. 20 + */ 21 + 22 + /include/ "skeleton.dtsi" 23 + 24 + / { 25 + compatible = "samsung,exynos4210"; 26 + interrupt-parent = <&gic>; 27 + 28 + gic:interrupt-controller@10490000 { 29 + compatible = "arm,cortex-a9-gic"; 30 + #interrupt-cells = <3>; 31 + interrupt-controller; 32 + reg = <0x10490000 0x1000>, <0x10480000 0x100>; 33 + }; 34 + 35 + watchdog@10060000 { 36 + compatible = "samsung,s3c2410-wdt"; 37 + reg = <0x10060000 0x100>; 38 + interrupts = <0 43 0>; 39 + }; 40 + 41 + rtc@10070000 { 42 + compatible = "samsung,s3c6410-rtc"; 43 + reg = <0x10070000 0x100>; 44 + interrupts = <0 44 0>, <0 45 0>; 45 + }; 46 + 47 + keypad@100A0000 { 48 + compatible = "samsung,s5pv210-keypad"; 49 + reg = <0x100A0000 0x100>; 50 + interrupts = <0 109 0>; 51 + }; 52 + 53 + sdhci@12510000 { 54 + compatible = "samsung,exynos4210-sdhci"; 55 + reg = <0x12510000 0x100>; 56 + interrupts = <0 73 0>; 57 + }; 58 + 59 + sdhci@12520000 { 60 + compatible = "samsung,exynos4210-sdhci"; 61 + reg = <0x12520000 0x100>; 62 + interrupts = <0 74 0>; 63 + }; 64 + 65 + sdhci@12530000 { 66 + compatible = "samsung,exynos4210-sdhci"; 67 + reg = <0x12530000 0x100>; 68 + interrupts = <0 75 0>; 69 + }; 70 + 71 + sdhci@12540000 { 72 + compatible = "samsung,exynos4210-sdhci"; 73 + reg = <0x12540000 0x100>; 74 + interrupts = <0 76 0>; 75 + }; 76 + 77 + serial@13800000 { 78 + compatible = "samsung,exynos4210-uart"; 79 + reg = <0x13800000 0x100>; 80 + interrupts = <0 52 0>; 81 + }; 82 + 83 + serial@13810000 { 84 + compatible = "samsung,exynos4210-uart"; 85 + reg = <0x13810000 0x100>; 86 + interrupts = <0 53 0>; 87 + }; 88 + 89 + serial@13820000 { 90 + compatible = "samsung,exynos4210-uart"; 91 + reg = <0x13820000 0x100>; 92 + interrupts = <0 54 0>; 93 + }; 94 + 95 + serial@13830000 { 96 + compatible = "samsung,exynos4210-uart"; 97 + reg = <0x13830000 0x100>; 98 + interrupts = <0 55 0>; 99 + }; 100 + 101 + i2c@13860000 { 102 + compatible = "samsung,s3c2440-i2c"; 103 + reg = <0x13860000 0x100>; 104 + interrupts = <0 58 0>; 105 + }; 106 + 107 + i2c@13870000 { 108 + compatible = "samsung,s3c2440-i2c"; 109 + reg = <0x13870000 0x100>; 110 + interrupts = <0 59 0>; 111 + }; 112 + 113 + i2c@13880000 { 114 + compatible = "samsung,s3c2440-i2c"; 115 + reg = <0x13880000 0x100>; 116 + interrupts = <0 60 0>; 117 + }; 118 + 119 + i2c@13890000 { 120 + compatible = "samsung,s3c2440-i2c"; 121 + reg = <0x13890000 0x100>; 122 + interrupts = <0 61 0>; 123 + }; 124 + 125 + i2c@138A0000 { 126 + compatible = "samsung,s3c2440-i2c"; 127 + reg = <0x138A0000 0x100>; 128 + interrupts = <0 62 0>; 129 + }; 130 + 131 + i2c@138B0000 { 132 + compatible = "samsung,s3c2440-i2c"; 133 + reg = <0x138B0000 0x100>; 134 + interrupts = <0 63 0>; 135 + }; 136 + 137 + i2c@138C0000 { 138 + compatible = "samsung,s3c2440-i2c"; 139 + reg = <0x138C0000 0x100>; 140 + interrupts = <0 64 0>; 141 + }; 142 + 143 + i2c@138D0000 { 144 + compatible = "samsung,s3c2440-i2c"; 145 + reg = <0x138D0000 0x100>; 146 + interrupts = <0 65 0>; 147 + }; 148 + 149 + amba { 150 + #address-cells = <1>; 151 + #size-cells = <1>; 152 + compatible = "arm,amba-bus"; 153 + interrupt-parent = <&gic>; 154 + ranges; 155 + 156 + pdma0: pdma@12680000 { 157 + compatible = "arm,pl330", "arm,primecell"; 158 + reg = <0x12680000 0x1000>; 159 + interrupts = <0 35 0>; 160 + }; 161 + 162 + pdma1: pdma@12690000 { 163 + compatible = "arm,pl330", "arm,primecell"; 164 + reg = <0x12690000 0x1000>; 165 + interrupts = <0 36 0>; 166 + }; 167 + }; 168 + 169 + gpio-controllers { 170 + #address-cells = <1>; 171 + #size-cells = <1>; 172 + gpio-controller; 173 + ranges; 174 + 175 + gpa0: gpio-controller@11400000 { 176 + compatible = "samsung,exynos4-gpio"; 177 + reg = <0x11400000 0x20>; 178 + #gpio-cells = <4>; 179 + }; 180 + 181 + gpa1: gpio-controller@11400020 { 182 + compatible = "samsung,exynos4-gpio"; 183 + reg = <0x11400020 0x20>; 184 + #gpio-cells = <4>; 185 + }; 186 + 187 + gpb: gpio-controller@11400040 { 188 + compatible = "samsung,exynos4-gpio"; 189 + reg = <0x11400040 0x20>; 190 + #gpio-cells = <4>; 191 + }; 192 + 193 + gpc0: gpio-controller@11400060 { 194 + compatible = "samsung,exynos4-gpio"; 195 + reg = <0x11400060 0x20>; 196 + #gpio-cells = <4>; 197 + }; 198 + 199 + gpc1: gpio-controller@11400080 { 200 + compatible = "samsung,exynos4-gpio"; 201 + reg = <0x11400080 0x20>; 202 + #gpio-cells = <4>; 203 + }; 204 + 205 + gpd0: gpio-controller@114000A0 { 206 + compatible = "samsung,exynos4-gpio"; 207 + reg = <0x114000A0 0x20>; 208 + #gpio-cells = <4>; 209 + }; 210 + 211 + gpd1: gpio-controller@114000C0 { 212 + compatible = "samsung,exynos4-gpio"; 213 + reg = <0x114000C0 0x20>; 214 + #gpio-cells = <4>; 215 + }; 216 + 217 + gpe0: gpio-controller@114000E0 { 218 + compatible = "samsung,exynos4-gpio"; 219 + reg = <0x114000E0 0x20>; 220 + #gpio-cells = <4>; 221 + }; 222 + 223 + gpe1: gpio-controller@11400100 { 224 + compatible = "samsung,exynos4-gpio"; 225 + reg = <0x11400100 0x20>; 226 + #gpio-cells = <4>; 227 + }; 228 + 229 + gpe2: gpio-controller@11400120 { 230 + compatible = "samsung,exynos4-gpio"; 231 + reg = <0x11400120 0x20>; 232 + #gpio-cells = <4>; 233 + }; 234 + 235 + gpe3: gpio-controller@11400140 { 236 + compatible = "samsung,exynos4-gpio"; 237 + reg = <0x11400140 0x20>; 238 + #gpio-cells = <4>; 239 + }; 240 + 241 + gpe4: gpio-controller@11400160 { 242 + compatible = "samsung,exynos4-gpio"; 243 + reg = <0x11400160 0x20>; 244 + #gpio-cells = <4>; 245 + }; 246 + 247 + gpf0: gpio-controller@11400180 { 248 + compatible = "samsung,exynos4-gpio"; 249 + reg = <0x11400180 0x20>; 250 + #gpio-cells = <4>; 251 + }; 252 + 253 + gpf1: gpio-controller@114001A0 { 254 + compatible = "samsung,exynos4-gpio"; 255 + reg = <0x114001A0 0x20>; 256 + #gpio-cells = <4>; 257 + }; 258 + 259 + gpf2: gpio-controller@114001C0 { 260 + compatible = "samsung,exynos4-gpio"; 261 + reg = <0x114001C0 0x20>; 262 + #gpio-cells = <4>; 263 + }; 264 + 265 + gpf3: gpio-controller@114001E0 { 266 + compatible = "samsung,exynos4-gpio"; 267 + reg = <0x114001E0 0x20>; 268 + #gpio-cells = <4>; 269 + }; 270 + 271 + gpj0: gpio-controller@11000000 { 272 + compatible = "samsung,exynos4-gpio"; 273 + reg = <0x11000000 0x20>; 274 + #gpio-cells = <4>; 275 + }; 276 + 277 + gpj1: gpio-controller@11000020 { 278 + compatible = "samsung,exynos4-gpio"; 279 + reg = <0x11000020 0x20>; 280 + #gpio-cells = <4>; 281 + }; 282 + 283 + gpk0: gpio-controller@11000040 { 284 + compatible = "samsung,exynos4-gpio"; 285 + reg = <0x11000040 0x20>; 286 + #gpio-cells = <4>; 287 + }; 288 + 289 + gpk1: gpio-controller@11000060 { 290 + compatible = "samsung,exynos4-gpio"; 291 + reg = <0x11000060 0x20>; 292 + #gpio-cells = <4>; 293 + }; 294 + 295 + gpk2: gpio-controller@11000080 { 296 + compatible = "samsung,exynos4-gpio"; 297 + reg = <0x11000080 0x20>; 298 + #gpio-cells = <4>; 299 + }; 300 + 301 + gpk3: gpio-controller@110000A0 { 302 + compatible = "samsung,exynos4-gpio"; 303 + reg = <0x110000A0 0x20>; 304 + #gpio-cells = <4>; 305 + }; 306 + 307 + gpl0: gpio-controller@110000C0 { 308 + compatible = "samsung,exynos4-gpio"; 309 + reg = <0x110000C0 0x20>; 310 + #gpio-cells = <4>; 311 + }; 312 + 313 + gpl1: gpio-controller@110000E0 { 314 + compatible = "samsung,exynos4-gpio"; 315 + reg = <0x110000E0 0x20>; 316 + #gpio-cells = <4>; 317 + }; 318 + 319 + gpl2: gpio-controller@11000100 { 320 + compatible = "samsung,exynos4-gpio"; 321 + reg = <0x11000100 0x20>; 322 + #gpio-cells = <4>; 323 + }; 324 + 325 + gpy0: gpio-controller@11000120 { 326 + compatible = "samsung,exynos4-gpio"; 327 + reg = <0x11000120 0x20>; 328 + #gpio-cells = <4>; 329 + }; 330 + 331 + gpy1: gpio-controller@11000140 { 332 + compatible = "samsung,exynos4-gpio"; 333 + reg = <0x11000140 0x20>; 334 + #gpio-cells = <4>; 335 + }; 336 + 337 + gpy2: gpio-controller@11000160 { 338 + compatible = "samsung,exynos4-gpio"; 339 + reg = <0x11000160 0x20>; 340 + #gpio-cells = <4>; 341 + }; 342 + 343 + gpy3: gpio-controller@11000180 { 344 + compatible = "samsung,exynos4-gpio"; 345 + reg = <0x11000180 0x20>; 346 + #gpio-cells = <4>; 347 + }; 348 + 349 + gpy4: gpio-controller@110001A0 { 350 + compatible = "samsung,exynos4-gpio"; 351 + reg = <0x110001A0 0x20>; 352 + #gpio-cells = <4>; 353 + }; 354 + 355 + gpy5: gpio-controller@110001C0 { 356 + compatible = "samsung,exynos4-gpio"; 357 + reg = <0x110001C0 0x20>; 358 + #gpio-cells = <4>; 359 + }; 360 + 361 + gpy6: gpio-controller@110001E0 { 362 + compatible = "samsung,exynos4-gpio"; 363 + reg = <0x110001E0 0x20>; 364 + #gpio-cells = <4>; 365 + }; 366 + 367 + gpx0: gpio-controller@11000C00 { 368 + compatible = "samsung,exynos4-gpio"; 369 + reg = <0x11000C00 0x20>; 370 + #gpio-cells = <4>; 371 + }; 372 + 373 + gpx1: gpio-controller@11000C20 { 374 + compatible = "samsung,exynos4-gpio"; 375 + reg = <0x11000C20 0x20>; 376 + #gpio-cells = <4>; 377 + }; 378 + 379 + gpx2: gpio-controller@11000C40 { 380 + compatible = "samsung,exynos4-gpio"; 381 + reg = <0x11000C40 0x20>; 382 + #gpio-cells = <4>; 383 + }; 384 + 385 + gpx3: gpio-controller@11000C60 { 386 + compatible = "samsung,exynos4-gpio"; 387 + reg = <0x11000C60 0x20>; 388 + #gpio-cells = <4>; 389 + }; 390 + 391 + gpz: gpio-controller@03860000 { 392 + compatible = "samsung,exynos4-gpio"; 393 + reg = <0x03860000 0x20>; 394 + #gpio-cells = <4>; 395 + }; 396 + }; 397 + };
+24 -5
arch/arm/boot/dts/tegra-harmony.dts
··· 1 1 /dts-v1/; 2 2 3 - /memreserve/ 0x1c000000 0x04000000; 4 3 /include/ "tegra20.dtsi" 5 4 6 5 / { 7 6 model = "NVIDIA Tegra2 Harmony evaluation board"; 8 7 compatible = "nvidia,harmony", "nvidia,tegra20"; 9 - 10 - chosen { 11 - bootargs = "vmalloc=192M video=tegrafb console=ttyS0,115200n8 root=/dev/mmcblk0p2 rw rootwait"; 12 - }; 13 8 14 9 memory@0 { 15 10 reg = < 0x00000000 0x40000000 >; ··· 47 52 ext-mic-en-gpios = <&gpio 185 0>; 48 53 }; 49 54 55 + serial@70006000 { 56 + status = "disable"; 57 + }; 58 + 59 + serial@70006040 { 60 + status = "disable"; 61 + }; 62 + 63 + serial@70006200 { 64 + status = "disable"; 65 + }; 66 + 50 67 serial@70006300 { 51 68 clock-frequency = < 216000000 >; 69 + }; 70 + 71 + serial@70006400 { 72 + status = "disable"; 73 + }; 74 + 75 + sdhci@c8000000 { 76 + status = "disable"; 52 77 }; 53 78 54 79 sdhci@c8000200 { 55 80 cd-gpios = <&gpio 69 0>; /* gpio PI5 */ 56 81 wp-gpios = <&gpio 57 0>; /* gpio PH1 */ 57 82 power-gpios = <&gpio 155 0>; /* gpio PT3 */ 83 + }; 84 + 85 + sdhci@c8000400 { 86 + status = "disable"; 58 87 }; 59 88 60 89 sdhci@c8000600 {
+77
arch/arm/boot/dts/tegra-paz00.dts
··· 1 + /dts-v1/; 2 + 3 + /include/ "tegra20.dtsi" 4 + 5 + / { 6 + model = "Toshiba AC100 / Dynabook AZ"; 7 + compatible = "compal,paz00", "nvidia,tegra20"; 8 + 9 + memory@0 { 10 + reg = <0x00000000 0x20000000>; 11 + }; 12 + 13 + i2c@7000c000 { 14 + clock-frequency = <400000>; 15 + }; 16 + 17 + i2c@7000c400 { 18 + clock-frequency = <400000>; 19 + }; 20 + 21 + i2c@7000c500 { 22 + status = "disable"; 23 + }; 24 + 25 + nvec@7000c500 { 26 + #address-cells = <1>; 27 + #size-cells = <0>; 28 + compatible = "nvidia,nvec"; 29 + reg = <0x7000C500 0x100>; 30 + interrupts = <0 92 0x04>; 31 + clock-frequency = <80000>; 32 + request-gpios = <&gpio 170 0>; 33 + slave-addr = <138>; 34 + }; 35 + 36 + i2c@7000d000 { 37 + clock-frequency = <400000>; 38 + }; 39 + 40 + serial@70006000 { 41 + clock-frequency = <216000000>; 42 + }; 43 + 44 + serial@70006040 { 45 + status = "disable"; 46 + }; 47 + 48 + serial@70006200 { 49 + status = "disable"; 50 + }; 51 + 52 + serial@70006300 { 53 + clock-frequency = <216000000>; 54 + }; 55 + 56 + serial@70006400 { 57 + status = "disable"; 58 + }; 59 + 60 + sdhci@c8000000 { 61 + cd-gpios = <&gpio 173 0>; /* gpio PV5 */ 62 + wp-gpios = <&gpio 57 0>; /* gpio PH1 */ 63 + power-gpios = <&gpio 155 0>; /* gpio PT3 */ 64 + }; 65 + 66 + sdhci@c8000200 { 67 + status = "disable"; 68 + }; 69 + 70 + sdhci@c8000400 { 71 + status = "disable"; 72 + }; 73 + 74 + sdhci@c8000600 { 75 + support-8bit; 76 + }; 77 + };
+69 -5
arch/arm/boot/dts/tegra-seaboard.dts
··· 1 1 /dts-v1/; 2 2 3 - /memreserve/ 0x1c000000 0x04000000; 4 3 /include/ "tegra20.dtsi" 5 4 6 5 / { 7 6 model = "NVIDIA Seaboard"; 8 7 compatible = "nvidia,seaboard", "nvidia,tegra20"; 9 8 10 - chosen { 11 - bootargs = "vmalloc=192M video=tegrafb console=ttyS0,115200n8 root=/dev/mmcblk1p3 rw rootwait"; 12 - }; 13 - 14 9 memory { 15 10 device_type = "memory"; 16 11 reg = < 0x00000000 0x40000000 >; 17 12 }; 18 13 14 + i2c@7000c000 { 15 + clock-frequency = <400000>; 16 + }; 17 + 18 + i2c@7000c400 { 19 + clock-frequency = <400000>; 20 + }; 21 + 22 + i2c@7000c500 { 23 + clock-frequency = <400000>; 24 + }; 25 + 26 + i2c@7000d000 { 27 + clock-frequency = <400000>; 28 + 29 + adt7461@4c { 30 + compatible = "adt7461"; 31 + reg = <0x4c>; 32 + }; 33 + }; 34 + 35 + serial@70006000 { 36 + status = "disable"; 37 + }; 38 + 39 + serial@70006040 { 40 + status = "disable"; 41 + }; 42 + 43 + serial@70006200 { 44 + status = "disable"; 45 + }; 46 + 19 47 serial@70006300 { 20 48 clock-frequency = < 216000000 >; 49 + }; 50 + 51 + serial@70006400 { 52 + status = "disable"; 53 + }; 54 + 55 + sdhci@c8000000 { 56 + status = "disable"; 57 + }; 58 + 59 + sdhci@c8000200 { 60 + status = "disable"; 21 61 }; 22 62 23 63 sdhci@c8000400 { ··· 68 28 69 29 sdhci@c8000600 { 70 30 support-8bit; 31 + }; 32 + 33 + usb@c5000000 { 34 + nvidia,vbus-gpio = <&gpio 24 0>; /* PD0 */ 35 + }; 36 + 37 + gpio-keys { 38 + compatible = "gpio-keys"; 39 + 40 + power { 41 + label = "Power"; 42 + gpios = <&gpio 170 1>; /* gpio PV2, active low */ 43 + linux,code = <116>; /* KEY_POWER */ 44 + gpio-key,wakeup; 45 + }; 46 + 47 + lid { 48 + label = "Lid"; 49 + gpios = <&gpio 23 0>; /* gpio PC7 */ 50 + linux,input-type = <5>; /* EV_SW */ 51 + linux,code = <0>; /* SW_LID */ 52 + debounce-interval = <1>; 53 + gpio-key,wakeup; 54 + }; 71 55 }; 72 56 };
+65
arch/arm/boot/dts/tegra-trimslice.dts
··· 1 + /dts-v1/; 2 + 3 + /include/ "tegra20.dtsi" 4 + 5 + / { 6 + model = "Compulab TrimSlice board"; 7 + compatible = "compulab,trimslice", "nvidia,tegra20"; 8 + 9 + memory@0 { 10 + reg = < 0x00000000 0x40000000 >; 11 + }; 12 + 13 + i2c@7000c000 { 14 + clock-frequency = <400000>; 15 + }; 16 + 17 + i2c@7000c400 { 18 + clock-frequency = <400000>; 19 + }; 20 + 21 + i2c@7000c500 { 22 + clock-frequency = <400000>; 23 + }; 24 + 25 + i2c@7000d000 { 26 + status = "disable"; 27 + }; 28 + 29 + serial@70006000 { 30 + clock-frequency = < 216000000 >; 31 + }; 32 + 33 + serial@70006040 { 34 + status = "disable"; 35 + }; 36 + 37 + serial@70006200 { 38 + status = "disable"; 39 + }; 40 + 41 + serial@70006300 { 42 + status = "disable"; 43 + }; 44 + 45 + serial@70006400 { 46 + status = "disable"; 47 + }; 48 + 49 + sdhci@c8000000 { 50 + status = "disable"; 51 + }; 52 + 53 + sdhci@c8000200 { 54 + status = "disable"; 55 + }; 56 + 57 + sdhci@c8000400 { 58 + status = "disable"; 59 + }; 60 + 61 + sdhci@c8000600 { 62 + cd-gpios = <&gpio 121 0>; 63 + wp-gpios = <&gpio 122 0>; 64 + }; 65 + };
+40 -5
arch/arm/boot/dts/tegra-ventana.dts
··· 1 1 /dts-v1/; 2 2 3 - /memreserve/ 0x1c000000 0x04000000; 4 3 /include/ "tegra20.dtsi" 5 4 6 5 / { 7 6 model = "NVIDIA Tegra2 Ventana evaluation board"; 8 7 compatible = "nvidia,ventana", "nvidia,tegra20"; 9 8 10 - chosen { 11 - bootargs = "vmalloc=192M video=tegrafb console=ttyS0,115200n8 root=/dev/ram rdinit=/sbin/init"; 12 - }; 13 - 14 9 memory { 15 10 reg = < 0x00000000 0x40000000 >; 16 11 }; 17 12 13 + i2c@7000c000 { 14 + clock-frequency = <400000>; 15 + }; 16 + 17 + i2c@7000c400 { 18 + clock-frequency = <400000>; 19 + }; 20 + 21 + i2c@7000c500 { 22 + clock-frequency = <400000>; 23 + }; 24 + 25 + i2c@7000d000 { 26 + clock-frequency = <400000>; 27 + }; 28 + 29 + serial@70006000 { 30 + status = "disable"; 31 + }; 32 + 33 + serial@70006040 { 34 + status = "disable"; 35 + }; 36 + 37 + serial@70006200 { 38 + status = "disable"; 39 + }; 40 + 18 41 serial@70006300 { 19 42 clock-frequency = < 216000000 >; 43 + }; 44 + 45 + serial@70006400 { 46 + status = "disable"; 47 + }; 48 + 49 + sdhci@c8000000 { 50 + status = "disable"; 51 + }; 52 + 53 + sdhci@c8000200 { 54 + status = "disable"; 20 55 }; 21 56 22 57 sdhci@c8000400 {
+46 -25
arch/arm/boot/dts/tegra20.dtsi
··· 5 5 interrupt-parent = <&intc>; 6 6 7 7 intc: interrupt-controller@50041000 { 8 - compatible = "nvidia,tegra20-gic"; 8 + compatible = "arm,cortex-a9-gic"; 9 9 interrupt-controller; 10 - #interrupt-cells = <1>; 10 + #interrupt-cells = <3>; 11 11 reg = < 0x50041000 0x1000 >, 12 12 < 0x50040100 0x0100 >; 13 13 }; ··· 17 17 #size-cells = <0>; 18 18 compatible = "nvidia,tegra20-i2c"; 19 19 reg = <0x7000C000 0x100>; 20 - interrupts = < 70 >; 20 + interrupts = < 0 38 0x04 >; 21 21 }; 22 22 23 23 i2c@7000c400 { ··· 25 25 #size-cells = <0>; 26 26 compatible = "nvidia,tegra20-i2c"; 27 27 reg = <0x7000C400 0x100>; 28 - interrupts = < 116 >; 28 + interrupts = < 0 84 0x04 >; 29 29 }; 30 30 31 31 i2c@7000c500 { ··· 33 33 #size-cells = <0>; 34 34 compatible = "nvidia,tegra20-i2c"; 35 35 reg = <0x7000C500 0x100>; 36 - interrupts = < 124 >; 36 + interrupts = < 0 92 0x04 >; 37 37 }; 38 38 39 39 i2c@7000d000 { 40 40 #address-cells = <1>; 41 41 #size-cells = <0>; 42 - compatible = "nvidia,tegra20-i2c"; 42 + compatible = "nvidia,tegra20-i2c-dvc"; 43 43 reg = <0x7000D000 0x200>; 44 - interrupts = < 85 >; 44 + interrupts = < 0 53 0x04 >; 45 45 }; 46 46 47 47 i2s@70002800 { 48 - #address-cells = <1>; 49 - #size-cells = <0>; 50 48 compatible = "nvidia,tegra20-i2s"; 51 49 reg = <0x70002800 0x200>; 52 - interrupts = < 45 >; 50 + interrupts = < 0 13 0x04 >; 53 51 dma-channel = < 2 >; 54 52 }; 55 53 56 54 i2s@70002a00 { 57 - #address-cells = <1>; 58 - #size-cells = <0>; 59 55 compatible = "nvidia,tegra20-i2s"; 60 56 reg = <0x70002a00 0x200>; 61 - interrupts = < 35 >; 57 + interrupts = < 0 3 0x04 >; 62 58 dma-channel = < 1 >; 63 59 }; 64 60 65 61 das@70000c00 { 66 - #address-cells = <1>; 67 - #size-cells = <0>; 68 62 compatible = "nvidia,tegra20-das"; 69 63 reg = <0x70000c00 0x80>; 70 64 }; ··· 66 72 gpio: gpio@6000d000 { 67 73 compatible = "nvidia,tegra20-gpio"; 68 74 reg = < 0x6000d000 0x1000 >; 69 - interrupts = < 64 65 66 67 87 119 121 >; 75 + interrupts = < 0 32 0x04 76 + 0 33 0x04 77 + 0 34 0x04 78 + 0 35 0x04 79 + 0 55 0x04 80 + 0 87 0x04 81 + 0 89 0x04 >; 70 82 #gpio-cells = <2>; 71 83 gpio-controller; 72 84 }; ··· 89 89 compatible = "nvidia,tegra20-uart"; 90 90 reg = <0x70006000 0x40>; 91 91 reg-shift = <2>; 92 - interrupts = < 68 >; 92 + interrupts = < 0 36 0x04 >; 93 93 }; 94 94 95 95 serial@70006040 { 96 96 compatible = "nvidia,tegra20-uart"; 97 97 reg = <0x70006040 0x40>; 98 98 reg-shift = <2>; 99 - interrupts = < 69 >; 99 + interrupts = < 0 37 0x04 >; 100 100 }; 101 101 102 102 serial@70006200 { 103 103 compatible = "nvidia,tegra20-uart"; 104 104 reg = <0x70006200 0x100>; 105 105 reg-shift = <2>; 106 - interrupts = < 78 >; 106 + interrupts = < 0 46 0x04 >; 107 107 }; 108 108 109 109 serial@70006300 { 110 110 compatible = "nvidia,tegra20-uart"; 111 111 reg = <0x70006300 0x100>; 112 112 reg-shift = <2>; 113 - interrupts = < 122 >; 113 + interrupts = < 0 90 0x04 >; 114 114 }; 115 115 116 116 serial@70006400 { 117 117 compatible = "nvidia,tegra20-uart"; 118 118 reg = <0x70006400 0x100>; 119 119 reg-shift = <2>; 120 - interrupts = < 123 >; 120 + interrupts = < 0 91 0x04 >; 121 121 }; 122 122 123 123 sdhci@c8000000 { 124 124 compatible = "nvidia,tegra20-sdhci"; 125 125 reg = <0xc8000000 0x200>; 126 - interrupts = < 46 >; 126 + interrupts = < 0 14 0x04 >; 127 127 }; 128 128 129 129 sdhci@c8000200 { 130 130 compatible = "nvidia,tegra20-sdhci"; 131 131 reg = <0xc8000200 0x200>; 132 - interrupts = < 47 >; 132 + interrupts = < 0 15 0x04 >; 133 133 }; 134 134 135 135 sdhci@c8000400 { 136 136 compatible = "nvidia,tegra20-sdhci"; 137 137 reg = <0xc8000400 0x200>; 138 - interrupts = < 51 >; 138 + interrupts = < 0 19 0x04 >; 139 139 }; 140 140 141 141 sdhci@c8000600 { 142 142 compatible = "nvidia,tegra20-sdhci"; 143 143 reg = <0xc8000600 0x200>; 144 - interrupts = < 63 >; 144 + interrupts = < 0 31 0x04 >; 145 + }; 146 + 147 + usb@c5000000 { 148 + compatible = "nvidia,tegra20-ehci", "usb-ehci"; 149 + reg = <0xc5000000 0x4000>; 150 + interrupts = < 0 20 0x04 >; 151 + phy_type = "utmi"; 152 + }; 153 + 154 + usb@c5004000 { 155 + compatible = "nvidia,tegra20-ehci", "usb-ehci"; 156 + reg = <0xc5004000 0x4000>; 157 + interrupts = < 0 21 0x04 >; 158 + phy_type = "ulpi"; 159 + }; 160 + 161 + usb@c5008000 { 162 + compatible = "nvidia,tegra20-ehci", "usb-ehci"; 163 + reg = <0xc5008000 0x4000>; 164 + interrupts = < 0 97 0x04 >; 165 + phy_type = "utmi"; 145 166 }; 146 167 }; 147 168
+127
arch/arm/boot/dts/tegra30.dtsi
··· 1 + /include/ "skeleton.dtsi" 2 + 3 + / { 4 + compatible = "nvidia,tegra30"; 5 + interrupt-parent = <&intc>; 6 + 7 + intc: interrupt-controller@50041000 { 8 + compatible = "arm,cortex-a9-gic"; 9 + interrupt-controller; 10 + #interrupt-cells = <3>; 11 + reg = < 0x50041000 0x1000 >, 12 + < 0x50040100 0x0100 >; 13 + }; 14 + 15 + i2c@7000c000 { 16 + #address-cells = <1>; 17 + #size-cells = <0>; 18 + compatible = "nvidia,tegra30-i2c", "nvidia,tegra20-i2c"; 19 + reg = <0x7000C000 0x100>; 20 + interrupts = < 0 38 0x04 >; 21 + }; 22 + 23 + i2c@7000c400 { 24 + #address-cells = <1>; 25 + #size-cells = <0>; 26 + compatible = "nvidia,tegra30-i2c", "nvidia,tegra20-i2c"; 27 + reg = <0x7000C400 0x100>; 28 + interrupts = < 0 84 0x04 >; 29 + }; 30 + 31 + i2c@7000c500 { 32 + #address-cells = <1>; 33 + #size-cells = <0>; 34 + compatible = "nvidia,tegra30-i2c", "nvidia,tegra20-i2c"; 35 + reg = <0x7000C500 0x100>; 36 + interrupts = < 0 92 0x04 >; 37 + }; 38 + 39 + i2c@7000c700 { 40 + #address-cells = <1>; 41 + #size-cells = <0>; 42 + compatible = "nvidia,tegra30-i2c", "nvidia,tegra20-i2c"; 43 + reg = <0x7000c700 0x100>; 44 + interrupts = < 0 120 0x04 >; 45 + }; 46 + 47 + i2c@7000d000 { 48 + #address-cells = <1>; 49 + #size-cells = <0>; 50 + compatible = "nvidia,tegra30-i2c", "nvidia,tegra20-i2c"; 51 + reg = <0x7000D000 0x100>; 52 + interrupts = < 0 53 0x04 >; 53 + }; 54 + 55 + gpio: gpio@6000d000 { 56 + compatible = "nvidia,tegra30-gpio", "nvidia,tegra20-gpio"; 57 + reg = < 0x6000d000 0x1000 >; 58 + interrupts = < 0 32 0x04 0 33 0x04 0 34 0x04 0 35 0x04 0 55 0x04 0 87 0x04 0 89 0x04 >; 59 + #gpio-cells = <2>; 60 + gpio-controller; 61 + }; 62 + 63 + serial@70006000 { 64 + compatible = "nvidia,tegra30-uart", "nvidia,tegra20-uart"; 65 + reg = <0x70006000 0x40>; 66 + reg-shift = <2>; 67 + interrupts = < 0 36 0x04 >; 68 + }; 69 + 70 + serial@70006040 { 71 + compatible = "nvidia,tegra30-uart", "nvidia,tegra20-uart"; 72 + reg = <0x70006040 0x40>; 73 + reg-shift = <2>; 74 + interrupts = < 0 37 0x04 >; 75 + }; 76 + 77 + serial@70006200 { 78 + compatible = "nvidia,tegra30-uart", "nvidia,tegra20-uart"; 79 + reg = <0x70006200 0x100>; 80 + reg-shift = <2>; 81 + interrupts = < 0 46 0x04 >; 82 + }; 83 + 84 + serial@70006300 { 85 + compatible = "nvidia,tegra30-uart", "nvidia,tegra20-uart"; 86 + reg = <0x70006300 0x100>; 87 + reg-shift = <2>; 88 + interrupts = < 0 90 0x04 >; 89 + }; 90 + 91 + serial@70006400 { 92 + compatible = "nvidia,tegra30-uart", "nvidia,tegra20-uart"; 93 + reg = <0x70006400 0x100>; 94 + reg-shift = <2>; 95 + interrupts = < 0 91 0x04 >; 96 + }; 97 + 98 + sdhci@78000000 { 99 + compatible = "nvidia,tegra30-sdhci", "nvidia,tegra20-sdhci"; 100 + reg = <0x78000000 0x200>; 101 + interrupts = < 0 14 0x04 >; 102 + }; 103 + 104 + sdhci@78000200 { 105 + compatible = "nvidia,tegra30-sdhci", "nvidia,tegra20-sdhci"; 106 + reg = <0x78000200 0x200>; 107 + interrupts = < 0 15 0x04 >; 108 + }; 109 + 110 + sdhci@78000400 { 111 + compatible = "nvidia,tegra30-sdhci", "nvidia,tegra20-sdhci"; 112 + reg = <0x78000400 0x200>; 113 + interrupts = < 0 19 0x04 >; 114 + }; 115 + 116 + sdhci@78000600 { 117 + compatible = "nvidia,tegra30-sdhci", "nvidia,tegra20-sdhci"; 118 + reg = <0x78000600 0x200>; 119 + interrupts = < 0 31 0x04 >; 120 + }; 121 + 122 + pinmux: pinmux@70000000 { 123 + compatible = "nvidia,tegra30-pinmux"; 124 + reg = < 0x70000868 0xd0 /* Pad control registers */ 125 + 0x70003000 0x3e0 >; /* Mux registers */ 126 + }; 127 + };
+24
arch/arm/mach-exynos/Kconfig
··· 59 59 help 60 60 Use MCT (Multi Core Timer) as kernel timers 61 61 62 + config EXYNOS4_DEV_DMA 63 + bool 64 + help 65 + Compile in amba device definitions for DMA controller 66 + 62 67 config EXYNOS4_DEV_AHCI 63 68 bool 64 69 help ··· 184 179 select SAMSUNG_DEV_BACKLIGHT 185 180 select EXYNOS4_DEV_AHCI 186 181 select SAMSUNG_DEV_KEYPAD 182 + select EXYNOS4_DEV_DMA 187 183 select EXYNOS4_DEV_PD 188 184 select SAMSUNG_DEV_PWM 189 185 select EXYNOS4_DEV_SYSMMU ··· 205 199 select S3C_DEV_HSMMC2 206 200 select S3C_DEV_HSMMC3 207 201 select EXYNOS4_DEV_AHCI 202 + select EXYNOS4_DEV_DMA 208 203 select EXYNOS4_DEV_SYSMMU 209 204 select EXYNOS4_SETUP_SDHCI 210 205 help ··· 231 224 select S5P_DEV_MFC 232 225 select S5P_DEV_ONENAND 233 226 select S5P_DEV_TV 227 + select EXYNOS4_DEV_DMA 234 228 select EXYNOS4_DEV_PD 235 229 select EXYNOS4_SETUP_FIMD0 236 230 select EXYNOS4_SETUP_I2C1 ··· 265 257 select S5P_DEV_MFC 266 258 select S5P_DEV_USB_EHCI 267 259 select S5P_SETUP_MIPIPHY 260 + select EXYNOS4_DEV_DMA 268 261 select EXYNOS4_DEV_PD 269 262 select EXYNOS4_SETUP_FIMC 270 263 select EXYNOS4_SETUP_FIMD0 ··· 298 289 select S5P_DEV_USB_EHCI 299 290 select SAMSUNG_DEV_BACKLIGHT 300 291 select SAMSUNG_DEV_PWM 292 + select EXYNOS4_DEV_DMA 301 293 select EXYNOS4_DEV_PD 302 294 select EXYNOS4_SETUP_FIMD0 303 295 select EXYNOS4_SETUP_SDHCI ··· 338 328 help 339 329 Machine support for Samsung SMDK4412 340 330 endif 331 + 332 + comment "Flattened Device Tree based board for Exynos4 based SoC" 333 + 334 + config MACH_EXYNOS4_DT 335 + bool "Samsung Exynos4 Machine using device tree" 336 + select CPU_EXYNOS4210 337 + select USE_OF 338 + select ARM_AMBA 339 + select HAVE_SAMSUNG_KEYPAD if INPUT_KEYBOARD 340 + help 341 + Machine support for Samsung Exynos4 machine with device tree enabled. 342 + Select this if a fdt blob is available for the Exynos4 SoC based board. 343 + Note: This is under development and not all peripherals can be supported 344 + with this machine file. 341 345 342 346 if ARCH_EXYNOS4 343 347
+4 -1
arch/arm/mach-exynos/Makefile
··· 19 19 obj-$(CONFIG_PM) += pm.o 20 20 obj-$(CONFIG_CPU_IDLE) += cpuidle.o 21 21 22 - obj-$(CONFIG_ARCH_EXYNOS4) += dma.o pmu.o 22 + obj-$(CONFIG_ARCH_EXYNOS4) += pmu.o 23 23 24 24 obj-$(CONFIG_SMP) += platsmp.o headsmp.o 25 25 ··· 39 39 obj-$(CONFIG_MACH_SMDK4212) += mach-smdk4x12.o 40 40 obj-$(CONFIG_MACH_SMDK4412) += mach-smdk4x12.o 41 41 42 + obj-$(CONFIG_MACH_EXYNOS4_DT) += mach-exynos4-dt.o 43 + 42 44 # device support 43 45 44 46 obj-$(CONFIG_ARCH_EXYNOS4) += dev-audio.o ··· 48 46 obj-$(CONFIG_EXYNOS4_DEV_PD) += dev-pd.o 49 47 obj-$(CONFIG_EXYNOS4_DEV_SYSMMU) += dev-sysmmu.o 50 48 obj-$(CONFIG_EXYNOS4_DEV_DWMCI) += dev-dwmci.o 49 + obj-$(CONFIG_EXYNOS4_DEV_DMA) += dma.o 51 50 52 51 obj-$(CONFIG_ARCH_EXYNOS4) += setup-i2c0.o 53 52 obj-$(CONFIG_EXYNOS4_SETUP_FIMC) += setup-fimc.o
+91 -50
arch/arm/mach-exynos/clock.c
··· 554 554 .enable = exynos4_clk_dac_ctrl, 555 555 .ctrlbit = (1 << 0), 556 556 }, { 557 - .name = "dma", 558 - .devname = "dma-pl330.0", 559 - .enable = exynos4_clk_ip_fsys_ctrl, 560 - .ctrlbit = (1 << 0), 561 - }, { 562 - .name = "dma", 563 - .devname = "dma-pl330.1", 564 - .enable = exynos4_clk_ip_fsys_ctrl, 565 - .ctrlbit = (1 << 1), 566 - }, { 567 557 .name = "adc", 568 558 .enable = exynos4_clk_ip_peril_ctrl, 569 559 .ctrlbit = (1 << 15), ··· 767 777 .enable = exynos4_clk_ip_peril_ctrl, 768 778 .ctrlbit = (1 << 5), 769 779 } 780 + }; 781 + 782 + static struct clk clk_pdma0 = { 783 + .name = "dma", 784 + .devname = "dma-pl330.0", 785 + .enable = exynos4_clk_ip_fsys_ctrl, 786 + .ctrlbit = (1 << 0), 787 + }; 788 + 789 + static struct clk clk_pdma1 = { 790 + .name = "dma", 791 + .devname = "dma-pl330.1", 792 + .enable = exynos4_clk_ip_fsys_ctrl, 793 + .ctrlbit = (1 << 1), 770 794 }; 771 795 772 796 struct clk *clkset_group_list[] = { ··· 1014 1010 1015 1011 static struct clksrc_clk clksrcs[] = { 1016 1012 { 1017 - .clk = { 1018 - .name = "uclk1", 1019 - .devname = "s5pv210-uart.0", 1020 - .enable = exynos4_clksrc_mask_peril0_ctrl, 1021 - .ctrlbit = (1 << 0), 1022 - }, 1023 - .sources = &clkset_group, 1024 - .reg_src = { .reg = S5P_CLKSRC_PERIL0, .shift = 0, .size = 4 }, 1025 - .reg_div = { .reg = S5P_CLKDIV_PERIL0, .shift = 0, .size = 4 }, 1026 - }, { 1027 - .clk = { 1028 - .name = "uclk1", 1029 - .devname = "s5pv210-uart.1", 1030 - .enable = exynos4_clksrc_mask_peril0_ctrl, 1031 - .ctrlbit = (1 << 4), 1032 - }, 1033 - .sources = &clkset_group, 1034 - .reg_src = { .reg = S5P_CLKSRC_PERIL0, .shift = 4, .size = 4 }, 1035 - .reg_div = { .reg = S5P_CLKDIV_PERIL0, .shift = 4, .size = 4 }, 1036 - }, { 1037 - .clk = { 1038 - .name = "uclk1", 1039 - .devname = "s5pv210-uart.2", 1040 - .enable = exynos4_clksrc_mask_peril0_ctrl, 1041 - .ctrlbit = (1 << 8), 1042 - }, 1043 - .sources = &clkset_group, 1044 - .reg_src = { .reg = S5P_CLKSRC_PERIL0, .shift = 8, .size = 4 }, 1045 - .reg_div = { .reg = S5P_CLKDIV_PERIL0, .shift = 8, .size = 4 }, 1046 - }, { 1047 - .clk = { 1048 - .name = "uclk1", 1049 - .devname = "s5pv210-uart.3", 1050 - .enable = exynos4_clksrc_mask_peril0_ctrl, 1051 - .ctrlbit = (1 << 12), 1052 - }, 1053 - .sources = &clkset_group, 1054 - .reg_src = { .reg = S5P_CLKSRC_PERIL0, .shift = 12, .size = 4 }, 1055 - .reg_div = { .reg = S5P_CLKDIV_PERIL0, .shift = 12, .size = 4 }, 1056 - }, { 1057 1013 .clk = { 1058 1014 .name = "sclk_pwm", 1059 1015 .enable = exynos4_clksrc_mask_peril0_ctrl, ··· 1202 1238 } 1203 1239 }; 1204 1240 1241 + static struct clksrc_clk clk_sclk_uart0 = { 1242 + .clk = { 1243 + .name = "uclk1", 1244 + .devname = "exynos4210-uart.0", 1245 + .enable = exynos4_clksrc_mask_peril0_ctrl, 1246 + .ctrlbit = (1 << 0), 1247 + }, 1248 + .sources = &clkset_group, 1249 + .reg_src = { .reg = S5P_CLKSRC_PERIL0, .shift = 0, .size = 4 }, 1250 + .reg_div = { .reg = S5P_CLKDIV_PERIL0, .shift = 0, .size = 4 }, 1251 + }; 1252 + 1253 + static struct clksrc_clk clk_sclk_uart1 = { 1254 + .clk = { 1255 + .name = "uclk1", 1256 + .devname = "exynos4210-uart.1", 1257 + .enable = exynos4_clksrc_mask_peril0_ctrl, 1258 + .ctrlbit = (1 << 4), 1259 + }, 1260 + .sources = &clkset_group, 1261 + .reg_src = { .reg = S5P_CLKSRC_PERIL0, .shift = 4, .size = 4 }, 1262 + .reg_div = { .reg = S5P_CLKDIV_PERIL0, .shift = 4, .size = 4 }, 1263 + }; 1264 + 1265 + static struct clksrc_clk clk_sclk_uart2 = { 1266 + .clk = { 1267 + .name = "uclk1", 1268 + .devname = "exynos4210-uart.2", 1269 + .enable = exynos4_clksrc_mask_peril0_ctrl, 1270 + .ctrlbit = (1 << 8), 1271 + }, 1272 + .sources = &clkset_group, 1273 + .reg_src = { .reg = S5P_CLKSRC_PERIL0, .shift = 8, .size = 4 }, 1274 + .reg_div = { .reg = S5P_CLKDIV_PERIL0, .shift = 8, .size = 4 }, 1275 + }; 1276 + 1277 + static struct clksrc_clk clk_sclk_uart3 = { 1278 + .clk = { 1279 + .name = "uclk1", 1280 + .devname = "exynos4210-uart.3", 1281 + .enable = exynos4_clksrc_mask_peril0_ctrl, 1282 + .ctrlbit = (1 << 12), 1283 + }, 1284 + .sources = &clkset_group, 1285 + .reg_src = { .reg = S5P_CLKSRC_PERIL0, .shift = 12, .size = 4 }, 1286 + .reg_div = { .reg = S5P_CLKDIV_PERIL0, .shift = 12, .size = 4 }, 1287 + }; 1288 + 1205 1289 /* Clock initialization code */ 1206 1290 static struct clksrc_clk *sysclks[] = { 1207 1291 &clk_mout_apll, ··· 1282 1270 &clk_dout_mmc4, 1283 1271 &clk_mout_mfc0, 1284 1272 &clk_mout_mfc1, 1273 + }; 1274 + 1275 + static struct clk *clk_cdev[] = { 1276 + &clk_pdma0, 1277 + &clk_pdma1, 1278 + }; 1279 + 1280 + static struct clksrc_clk *clksrc_cdev[] = { 1281 + &clk_sclk_uart0, 1282 + &clk_sclk_uart1, 1283 + &clk_sclk_uart2, 1284 + &clk_sclk_uart3, 1285 + }; 1286 + 1287 + static struct clk_lookup exynos4_clk_lookup[] = { 1288 + CLKDEV_INIT("exynos4210-uart.0", "clk_uart_baud0", &clk_sclk_uart0.clk), 1289 + CLKDEV_INIT("exynos4210-uart.1", "clk_uart_baud0", &clk_sclk_uart1.clk), 1290 + CLKDEV_INIT("exynos4210-uart.2", "clk_uart_baud0", &clk_sclk_uart2.clk), 1291 + CLKDEV_INIT("exynos4210-uart.3", "clk_uart_baud0", &clk_sclk_uart3.clk), 1292 + CLKDEV_INIT("dma-pl330.0", "apb_pclk", &clk_pdma0), 1293 + CLKDEV_INIT("dma-pl330.1", "apb_pclk", &clk_pdma1), 1285 1294 }; 1286 1295 1287 1296 static int xtal_rate; ··· 1512 1479 for (ptr = 0; ptr < ARRAY_SIZE(sclk_tv); ptr++) 1513 1480 s3c_register_clksrc(sclk_tv[ptr], 1); 1514 1481 1482 + for (ptr = 0; ptr < ARRAY_SIZE(clksrc_cdev); ptr++) 1483 + s3c_register_clksrc(clksrc_cdev[ptr], 1); 1484 + 1515 1485 s3c_register_clksrc(clksrcs, ARRAY_SIZE(clksrcs)); 1516 1486 s3c_register_clocks(init_clocks, ARRAY_SIZE(init_clocks)); 1517 1487 1488 + s3c24xx_register_clocks(clk_cdev, ARRAY_SIZE(clk_cdev)); 1489 + for (ptr = 0; ptr < ARRAY_SIZE(clk_cdev); ptr++) 1490 + s3c_disable_clocks(clk_cdev[ptr], 1); 1491 + 1518 1492 s3c_register_clocks(init_clocks_off, ARRAY_SIZE(init_clocks_off)); 1519 1493 s3c_disable_clocks(init_clocks_off, ARRAY_SIZE(init_clocks_off)); 1494 + clkdev_add_table(exynos4_clk_lookup, ARRAY_SIZE(exynos4_clk_lookup)); 1520 1495 1521 1496 register_syscore_ops(&exynos4_clock_syscore_ops); 1522 1497 s3c24xx_register_clock(&dummy_apb_pclk);
+18 -19
arch/arm/mach-exynos/common.c
··· 17 17 #include <linux/gpio.h> 18 18 #include <linux/sched.h> 19 19 #include <linux/serial_core.h> 20 + #include <linux/of.h> 21 + #include <linux/of_irq.h> 20 22 21 23 #include <asm/proc-fns.h> 22 24 #include <asm/exception.h> ··· 387 385 } 388 386 } 389 387 388 + #ifdef CONFIG_OF 389 + static const struct of_device_id exynos4_dt_irq_match[] = { 390 + { .compatible = "arm,cortex-a9-gic", .data = gic_of_init, }, 391 + {}, 392 + }; 393 + #endif 394 + 390 395 void __init exynos4_init_irq(void) 391 396 { 392 397 int irq; ··· 401 392 402 393 gic_bank_offset = soc_is_exynos4412() ? 0x4000 : 0x8000; 403 394 404 - gic_init_bases(0, IRQ_PPI(0), S5P_VA_GIC_DIST, S5P_VA_GIC_CPU, gic_bank_offset); 395 + if (!of_have_populated_dt()) 396 + gic_init_bases(0, IRQ_PPI(0), S5P_VA_GIC_DIST, S5P_VA_GIC_CPU, gic_bank_offset); 397 + #ifdef CONFIG_OF 398 + else 399 + of_irq_init(exynos4_dt_irq_match); 400 + #endif 405 401 406 402 for (irq = 0; irq < MAX_COMBINER_NR; irq++) { 407 403 ··· 474 460 return device_register(&exynos4_dev); 475 461 } 476 462 477 - static struct s3c24xx_uart_clksrc exynos4_serial_clocks[] = { 478 - [0] = { 479 - .name = "uclk1", 480 - .divisor = 1, 481 - .min_baud = 0, 482 - .max_baud = 0, 483 - }, 484 - }; 485 - 486 463 /* uart registration process */ 487 464 488 465 void __init exynos4_init_uarts(struct s3c2410_uartcfg *cfg, int no) ··· 481 476 struct s3c2410_uartcfg *tcfg = cfg; 482 477 u32 ucnt; 483 478 484 - for (ucnt = 0; ucnt < no; ucnt++, tcfg++) { 485 - if (!tcfg->clocks) { 486 - tcfg->has_fracval = 1; 487 - tcfg->clocks = exynos4_serial_clocks; 488 - tcfg->clocks_size = ARRAY_SIZE(exynos4_serial_clocks); 489 - } 490 - tcfg->flags |= NO_NEED_CHECK_CLKSRC; 491 - } 479 + for (ucnt = 0; ucnt < no; ucnt++, tcfg++) 480 + tcfg->has_fracval = 1; 492 481 493 - s3c24xx_init_uartdevs("s5pv210-uart", s5p_uart_resources, cfg, no); 482 + s3c24xx_init_uartdevs("exynos4210-uart", s5p_uart_resources, cfg, no); 494 483 } 495 484 496 485 static DEFINE_SPINLOCK(eint_lock);
+68 -161
arch/arm/mach-exynos/dma.c
··· 24 24 #include <linux/dma-mapping.h> 25 25 #include <linux/amba/bus.h> 26 26 #include <linux/amba/pl330.h> 27 + #include <linux/of.h> 27 28 28 29 #include <asm/irq.h> 29 30 #include <plat/devs.h> ··· 36 35 37 36 static u64 dma_dmamask = DMA_BIT_MASK(32); 38 37 39 - struct dma_pl330_peri pdma0_peri[28] = { 40 - { 41 - .peri_id = (u8)DMACH_PCM0_RX, 42 - .rqtype = DEVTOMEM, 43 - }, { 44 - .peri_id = (u8)DMACH_PCM0_TX, 45 - .rqtype = MEMTODEV, 46 - }, { 47 - .peri_id = (u8)DMACH_PCM2_RX, 48 - .rqtype = DEVTOMEM, 49 - }, { 50 - .peri_id = (u8)DMACH_PCM2_TX, 51 - .rqtype = MEMTODEV, 52 - }, { 53 - .peri_id = (u8)DMACH_MSM_REQ0, 54 - }, { 55 - .peri_id = (u8)DMACH_MSM_REQ2, 56 - }, { 57 - .peri_id = (u8)DMACH_SPI0_RX, 58 - .rqtype = DEVTOMEM, 59 - }, { 60 - .peri_id = (u8)DMACH_SPI0_TX, 61 - .rqtype = MEMTODEV, 62 - }, { 63 - .peri_id = (u8)DMACH_SPI2_RX, 64 - .rqtype = DEVTOMEM, 65 - }, { 66 - .peri_id = (u8)DMACH_SPI2_TX, 67 - .rqtype = MEMTODEV, 68 - }, { 69 - .peri_id = (u8)DMACH_I2S0S_TX, 70 - .rqtype = MEMTODEV, 71 - }, { 72 - .peri_id = (u8)DMACH_I2S0_RX, 73 - .rqtype = DEVTOMEM, 74 - }, { 75 - .peri_id = (u8)DMACH_I2S0_TX, 76 - .rqtype = MEMTODEV, 77 - }, { 78 - .peri_id = (u8)DMACH_UART0_RX, 79 - .rqtype = DEVTOMEM, 80 - }, { 81 - .peri_id = (u8)DMACH_UART0_TX, 82 - .rqtype = MEMTODEV, 83 - }, { 84 - .peri_id = (u8)DMACH_UART2_RX, 85 - .rqtype = DEVTOMEM, 86 - }, { 87 - .peri_id = (u8)DMACH_UART2_TX, 88 - .rqtype = MEMTODEV, 89 - }, { 90 - .peri_id = (u8)DMACH_UART4_RX, 91 - .rqtype = DEVTOMEM, 92 - }, { 93 - .peri_id = (u8)DMACH_UART4_TX, 94 - .rqtype = MEMTODEV, 95 - }, { 96 - .peri_id = (u8)DMACH_SLIMBUS0_RX, 97 - .rqtype = DEVTOMEM, 98 - }, { 99 - .peri_id = (u8)DMACH_SLIMBUS0_TX, 100 - .rqtype = MEMTODEV, 101 - }, { 102 - .peri_id = (u8)DMACH_SLIMBUS2_RX, 103 - .rqtype = DEVTOMEM, 104 - }, { 105 - .peri_id = (u8)DMACH_SLIMBUS2_TX, 106 - .rqtype = MEMTODEV, 107 - }, { 108 - .peri_id = (u8)DMACH_SLIMBUS4_RX, 109 - .rqtype = DEVTOMEM, 110 - }, { 111 - .peri_id = (u8)DMACH_SLIMBUS4_TX, 112 - .rqtype = MEMTODEV, 113 - }, { 114 - .peri_id = (u8)DMACH_AC97_MICIN, 115 - .rqtype = DEVTOMEM, 116 - }, { 117 - .peri_id = (u8)DMACH_AC97_PCMIN, 118 - .rqtype = DEVTOMEM, 119 - }, { 120 - .peri_id = (u8)DMACH_AC97_PCMOUT, 121 - .rqtype = MEMTODEV, 122 - }, 38 + u8 pdma0_peri[] = { 39 + DMACH_PCM0_RX, 40 + DMACH_PCM0_TX, 41 + DMACH_PCM2_RX, 42 + DMACH_PCM2_TX, 43 + DMACH_MSM_REQ0, 44 + DMACH_MSM_REQ2, 45 + DMACH_SPI0_RX, 46 + DMACH_SPI0_TX, 47 + DMACH_SPI2_RX, 48 + DMACH_SPI2_TX, 49 + DMACH_I2S0S_TX, 50 + DMACH_I2S0_RX, 51 + DMACH_I2S0_TX, 52 + DMACH_I2S2_RX, 53 + DMACH_I2S2_TX, 54 + DMACH_UART0_RX, 55 + DMACH_UART0_TX, 56 + DMACH_UART2_RX, 57 + DMACH_UART2_TX, 58 + DMACH_UART4_RX, 59 + DMACH_UART4_TX, 60 + DMACH_SLIMBUS0_RX, 61 + DMACH_SLIMBUS0_TX, 62 + DMACH_SLIMBUS2_RX, 63 + DMACH_SLIMBUS2_TX, 64 + DMACH_SLIMBUS4_RX, 65 + DMACH_SLIMBUS4_TX, 66 + DMACH_AC97_MICIN, 67 + DMACH_AC97_PCMIN, 68 + DMACH_AC97_PCMOUT, 123 69 }; 124 70 125 71 struct dma_pl330_platdata exynos4_pdma0_pdata = { 126 72 .nr_valid_peri = ARRAY_SIZE(pdma0_peri), 127 - .peri = pdma0_peri, 73 + .peri_id = pdma0_peri, 128 74 }; 129 75 130 76 struct amba_device exynos4_device_pdma0 = { ··· 90 142 .periphid = 0x00041330, 91 143 }; 92 144 93 - struct dma_pl330_peri pdma1_peri[25] = { 94 - { 95 - .peri_id = (u8)DMACH_PCM0_RX, 96 - .rqtype = DEVTOMEM, 97 - }, { 98 - .peri_id = (u8)DMACH_PCM0_TX, 99 - .rqtype = MEMTODEV, 100 - }, { 101 - .peri_id = (u8)DMACH_PCM1_RX, 102 - .rqtype = DEVTOMEM, 103 - }, { 104 - .peri_id = (u8)DMACH_PCM1_TX, 105 - .rqtype = MEMTODEV, 106 - }, { 107 - .peri_id = (u8)DMACH_MSM_REQ1, 108 - }, { 109 - .peri_id = (u8)DMACH_MSM_REQ3, 110 - }, { 111 - .peri_id = (u8)DMACH_SPI1_RX, 112 - .rqtype = DEVTOMEM, 113 - }, { 114 - .peri_id = (u8)DMACH_SPI1_TX, 115 - .rqtype = MEMTODEV, 116 - }, { 117 - .peri_id = (u8)DMACH_I2S0S_TX, 118 - .rqtype = MEMTODEV, 119 - }, { 120 - .peri_id = (u8)DMACH_I2S0_RX, 121 - .rqtype = DEVTOMEM, 122 - }, { 123 - .peri_id = (u8)DMACH_I2S0_TX, 124 - .rqtype = MEMTODEV, 125 - }, { 126 - .peri_id = (u8)DMACH_I2S1_RX, 127 - .rqtype = DEVTOMEM, 128 - }, { 129 - .peri_id = (u8)DMACH_I2S1_TX, 130 - .rqtype = MEMTODEV, 131 - }, { 132 - .peri_id = (u8)DMACH_UART0_RX, 133 - .rqtype = DEVTOMEM, 134 - }, { 135 - .peri_id = (u8)DMACH_UART0_TX, 136 - .rqtype = MEMTODEV, 137 - }, { 138 - .peri_id = (u8)DMACH_UART1_RX, 139 - .rqtype = DEVTOMEM, 140 - }, { 141 - .peri_id = (u8)DMACH_UART1_TX, 142 - .rqtype = MEMTODEV, 143 - }, { 144 - .peri_id = (u8)DMACH_UART3_RX, 145 - .rqtype = DEVTOMEM, 146 - }, { 147 - .peri_id = (u8)DMACH_UART3_TX, 148 - .rqtype = MEMTODEV, 149 - }, { 150 - .peri_id = (u8)DMACH_SLIMBUS1_RX, 151 - .rqtype = DEVTOMEM, 152 - }, { 153 - .peri_id = (u8)DMACH_SLIMBUS1_TX, 154 - .rqtype = MEMTODEV, 155 - }, { 156 - .peri_id = (u8)DMACH_SLIMBUS3_RX, 157 - .rqtype = DEVTOMEM, 158 - }, { 159 - .peri_id = (u8)DMACH_SLIMBUS3_TX, 160 - .rqtype = MEMTODEV, 161 - }, { 162 - .peri_id = (u8)DMACH_SLIMBUS5_RX, 163 - .rqtype = DEVTOMEM, 164 - }, { 165 - .peri_id = (u8)DMACH_SLIMBUS5_TX, 166 - .rqtype = MEMTODEV, 167 - }, 145 + u8 pdma1_peri[] = { 146 + DMACH_PCM0_RX, 147 + DMACH_PCM0_TX, 148 + DMACH_PCM1_RX, 149 + DMACH_PCM1_TX, 150 + DMACH_MSM_REQ1, 151 + DMACH_MSM_REQ3, 152 + DMACH_SPI1_RX, 153 + DMACH_SPI1_TX, 154 + DMACH_I2S0S_TX, 155 + DMACH_I2S0_RX, 156 + DMACH_I2S0_TX, 157 + DMACH_I2S1_RX, 158 + DMACH_I2S1_TX, 159 + DMACH_UART0_RX, 160 + DMACH_UART0_TX, 161 + DMACH_UART1_RX, 162 + DMACH_UART1_TX, 163 + DMACH_UART3_RX, 164 + DMACH_UART3_TX, 165 + DMACH_SLIMBUS1_RX, 166 + DMACH_SLIMBUS1_TX, 167 + DMACH_SLIMBUS3_RX, 168 + DMACH_SLIMBUS3_TX, 169 + DMACH_SLIMBUS5_RX, 170 + DMACH_SLIMBUS5_TX, 168 171 }; 169 172 170 173 struct dma_pl330_platdata exynos4_pdma1_pdata = { 171 174 .nr_valid_peri = ARRAY_SIZE(pdma1_peri), 172 - .peri = pdma1_peri, 175 + .peri_id = pdma1_peri, 173 176 }; 174 177 175 178 struct amba_device exynos4_device_pdma1 = { ··· 141 242 142 243 static int __init exynos4_dma_init(void) 143 244 { 245 + if (of_have_populated_dt()) 246 + return 0; 247 + 248 + dma_cap_set(DMA_SLAVE, exynos4_pdma0_pdata.cap_mask); 249 + dma_cap_set(DMA_CYCLIC, exynos4_pdma0_pdata.cap_mask); 144 250 amba_device_register(&exynos4_device_pdma0, &iomem_resource); 251 + 252 + dma_cap_set(DMA_SLAVE, exynos4_pdma1_pdata.cap_mask); 253 + dma_cap_set(DMA_CYCLIC, exynos4_pdma1_pdata.cap_mask); 145 254 amba_device_register(&exynos4_device_pdma1, &iomem_resource); 146 255 147 256 return 0;
+5 -3
arch/arm/mach-exynos/include/mach/irqs.h
··· 17 17 18 18 /* PPI: Private Peripheral Interrupt */ 19 19 20 - #define IRQ_PPI(x) S5P_IRQ(x+16) 20 + #define IRQ_PPI(x) (x+16) 21 21 22 22 #define IRQ_MCT_LOCALTIMER IRQ_PPI(12) 23 23 24 24 /* SPI: Shared Peripheral Interrupt */ 25 25 26 - #define IRQ_SPI(x) S5P_IRQ(x+32) 26 + #define IRQ_SPI(x) (x+32) 27 27 28 28 #define IRQ_EINT0 IRQ_SPI(16) 29 29 #define IRQ_EINT1 IRQ_SPI(17) ··· 163 163 #define IRQ_GPIO2_NR_GROUPS 9 164 164 #define IRQ_GPIO_END (S5P_GPIOINT_BASE + S5P_GPIOINT_COUNT) 165 165 166 + #define IRQ_TIMER_BASE (IRQ_GPIO_END + 64) 167 + 166 168 /* Set the default NR_IRQS */ 167 - #define NR_IRQS (IRQ_GPIO_END + 64) 169 + #define NR_IRQS (IRQ_TIMER_BASE + IRQ_TIMER_COUNT) 168 170 169 171 #endif /* __ASM_ARCH_IRQS_H */
+85
arch/arm/mach-exynos/mach-exynos4-dt.c
··· 1 + /* 2 + * Samsung's Exynos4210 flattened device tree enabled machine 3 + * 4 + * Copyright (c) 2010-2011 Samsung Electronics Co., Ltd. 5 + * http://www.samsung.com 6 + * Copyright (c) 2010-2011 Linaro Ltd. 7 + * www.linaro.org 8 + * 9 + * This program is free software; you can redistribute it and/or modify 10 + * it under the terms of the GNU General Public License version 2 as 11 + * published by the Free Software Foundation. 12 + */ 13 + 14 + #include <linux/of_platform.h> 15 + #include <linux/serial_core.h> 16 + 17 + #include <asm/mach/arch.h> 18 + #include <mach/map.h> 19 + 20 + #include <plat/cpu.h> 21 + #include <plat/regs-serial.h> 22 + #include <plat/exynos4.h> 23 + 24 + /* 25 + * The following lookup table is used to override device names when devices 26 + * are registered from device tree. This is temporarily added to enable 27 + * device tree support addition for the Exynos4 architecture. 28 + * 29 + * For drivers that require platform data to be provided from the machine 30 + * file, a platform data pointer can also be supplied along with the 31 + * devices names. Usually, the platform data elements that cannot be parsed 32 + * from the device tree by the drivers (example: function pointers) are 33 + * supplied. But it should be noted that this is a temporary mechanism and 34 + * at some point, the drivers should be capable of parsing all the platform 35 + * data from the device tree. 36 + */ 37 + static const struct of_dev_auxdata exynos4210_auxdata_lookup[] __initconst = { 38 + OF_DEV_AUXDATA("samsung,exynos4210-uart", S5P_PA_UART0, 39 + "exynos4210-uart.0", NULL), 40 + OF_DEV_AUXDATA("samsung,exynos4210-uart", S5P_PA_UART1, 41 + "exynos4210-uart.1", NULL), 42 + OF_DEV_AUXDATA("samsung,exynos4210-uart", S5P_PA_UART2, 43 + "exynos4210-uart.2", NULL), 44 + OF_DEV_AUXDATA("samsung,exynos4210-uart", S5P_PA_UART3, 45 + "exynos4210-uart.3", NULL), 46 + OF_DEV_AUXDATA("samsung,exynos4210-sdhci", EXYNOS4_PA_HSMMC(0), 47 + "exynos4-sdhci.0", NULL), 48 + OF_DEV_AUXDATA("samsung,exynos4210-sdhci", EXYNOS4_PA_HSMMC(1), 49 + "exynos4-sdhci.1", NULL), 50 + OF_DEV_AUXDATA("samsung,exynos4210-sdhci", EXYNOS4_PA_HSMMC(2), 51 + "exynos4-sdhci.2", NULL), 52 + OF_DEV_AUXDATA("samsung,exynos4210-sdhci", EXYNOS4_PA_HSMMC(3), 53 + "exynos4-sdhci.3", NULL), 54 + OF_DEV_AUXDATA("samsung,s3c2440-i2c", EXYNOS4_PA_IIC(0), 55 + "s3c2440-i2c.0", NULL), 56 + OF_DEV_AUXDATA("arm,pl330", EXYNOS4_PA_PDMA0, "dma-pl330.0", NULL), 57 + OF_DEV_AUXDATA("arm,pl330", EXYNOS4_PA_PDMA1, "dma-pl330.1", NULL), 58 + {}, 59 + }; 60 + 61 + static void __init exynos4210_dt_map_io(void) 62 + { 63 + s5p_init_io(NULL, 0, S5P_VA_CHIPID); 64 + s3c24xx_init_clocks(24000000); 65 + } 66 + 67 + static void __init exynos4210_dt_machine_init(void) 68 + { 69 + of_platform_populate(NULL, of_default_bus_match_table, 70 + exynos4210_auxdata_lookup, NULL); 71 + } 72 + 73 + static char const *exynos4210_dt_compat[] __initdata = { 74 + "samsung,exynos4210", 75 + NULL 76 + }; 77 + 78 + DT_MACHINE_START(EXYNOS4210_DT, "Samsung Exynos4 (Flattened Device Tree)") 79 + /* Maintainer: Thomas Abraham <thomas.abraham@linaro.org> */ 80 + .init_irq = exynos4_init_irq, 81 + .map_io = exynos4210_dt_map_io, 82 + .init_machine = exynos4210_dt_machine_init, 83 + .timer = &exynos4_timer, 84 + .dt_compat = exynos4210_dt_compat, 85 + MACHINE_END
-22
arch/arm/mach-s3c2410/mach-bast.c
··· 165 165 #define ULCON S3C2410_LCON_CS8 | S3C2410_LCON_PNONE | S3C2410_LCON_STOPB 166 166 #define UFCON S3C2410_UFCON_RXTRIG8 | S3C2410_UFCON_FIFOMODE 167 167 168 - static struct s3c24xx_uart_clksrc bast_serial_clocks[] = { 169 - [0] = { 170 - .name = "uclk", 171 - .divisor = 1, 172 - .min_baud = 0, 173 - .max_baud = 0, 174 - }, 175 - [1] = { 176 - .name = "pclk", 177 - .divisor = 1, 178 - .min_baud = 0, 179 - .max_baud = 0, 180 - } 181 - }; 182 - 183 - 184 168 static struct s3c2410_uartcfg bast_uartcfgs[] __initdata = { 185 169 [0] = { 186 170 .hwport = 0, ··· 172 188 .ucon = UCON, 173 189 .ulcon = ULCON, 174 190 .ufcon = UFCON, 175 - .clocks = bast_serial_clocks, 176 - .clocks_size = ARRAY_SIZE(bast_serial_clocks), 177 191 }, 178 192 [1] = { 179 193 .hwport = 1, ··· 179 197 .ucon = UCON, 180 198 .ulcon = ULCON, 181 199 .ufcon = UFCON, 182 - .clocks = bast_serial_clocks, 183 - .clocks_size = ARRAY_SIZE(bast_serial_clocks), 184 200 }, 185 201 /* port 2 is not actually used */ 186 202 [2] = { ··· 187 207 .ucon = UCON, 188 208 .ulcon = ULCON, 189 209 .ufcon = UFCON, 190 - .clocks = bast_serial_clocks, 191 - .clocks_size = ARRAY_SIZE(bast_serial_clocks), 192 210 } 193 211 }; 194 212
-24
arch/arm/mach-s3c2410/mach-vr1000.c
··· 110 110 #define ULCON S3C2410_LCON_CS8 | S3C2410_LCON_PNONE | S3C2410_LCON_STOPB 111 111 #define UFCON S3C2410_UFCON_RXTRIG8 | S3C2410_UFCON_FIFOMODE 112 112 113 - /* uart clock source(s) */ 114 - 115 - static struct s3c24xx_uart_clksrc vr1000_serial_clocks[] = { 116 - [0] = { 117 - .name = "uclk", 118 - .divisor = 1, 119 - .min_baud = 0, 120 - .max_baud = 0, 121 - }, 122 - [1] = { 123 - .name = "pclk", 124 - .divisor = 1, 125 - .min_baud = 0, 126 - .max_baud = 0. 127 - } 128 - }; 129 - 130 113 static struct s3c2410_uartcfg vr1000_uartcfgs[] __initdata = { 131 114 [0] = { 132 115 .hwport = 0, ··· 117 134 .ucon = UCON, 118 135 .ulcon = ULCON, 119 136 .ufcon = UFCON, 120 - .clocks = vr1000_serial_clocks, 121 - .clocks_size = ARRAY_SIZE(vr1000_serial_clocks), 122 137 }, 123 138 [1] = { 124 139 .hwport = 1, ··· 124 143 .ucon = UCON, 125 144 .ulcon = ULCON, 126 145 .ufcon = UFCON, 127 - .clocks = vr1000_serial_clocks, 128 - .clocks_size = ARRAY_SIZE(vr1000_serial_clocks), 129 146 }, 130 147 /* port 2 is not actually used */ 131 148 [2] = { ··· 132 153 .ucon = UCON, 133 154 .ulcon = ULCON, 134 155 .ufcon = UFCON, 135 - .clocks = vr1000_serial_clocks, 136 - .clocks_size = ARRAY_SIZE(vr1000_serial_clocks), 137 - 138 156 } 139 157 }; 140 158
+6
arch/arm/mach-s3c2410/s3c2410.c
··· 124 124 .id = -1, 125 125 }; 126 126 127 + static struct clk_lookup s3c2410_clk_lookup[] = { 128 + CLKDEV_INIT(NULL, "clk_uart_baud0", &clk_p), 129 + CLKDEV_INIT(NULL, "clk_uart_baud1", &s3c24xx_uclk), 130 + }; 131 + 127 132 void __init s3c2410_init_clocks(int xtal) 128 133 { 129 134 s3c24xx_register_baseclocks(xtal); 130 135 s3c2410_setup_clocks(); 131 136 s3c2410_baseclk_add(); 132 137 s3c24xx_register_clock(&s3c2410_armclk); 138 + clkdev_add_table(s3c2410_clk_lookup, ARRAY_SIZE(s3c2410_clk_lookup)); 133 139 } 134 140 135 141 struct bus_type s3c2410_subsys = {
+7
arch/arm/mach-s3c2412/clock.c
··· 659 659 &clk_armclk, 660 660 }; 661 661 662 + static struct clk_lookup s3c2412_clk_lookup[] = { 663 + CLKDEV_INIT(NULL, "clk_uart_baud1", &s3c24xx_uclk), 664 + CLKDEV_INIT(NULL, "clk_uart_baud2", &clk_p), 665 + CLKDEV_INIT(NULL, "clk_uart_baud3", &clk_usysclk), 666 + }; 667 + 662 668 int __init s3c2412_baseclk_add(void) 663 669 { 664 670 unsigned long clkcon = __raw_readl(S3C2410_CLKCON); ··· 757 751 s3c2412_clkcon_enable(clkp, 0); 758 752 } 759 753 754 + clkdev_add_table(s3c2412_clk_lookup, ARRAY_SIZE(s3c2412_clk_lookup)); 760 755 s3c_pwmclk_init(); 761 756 return 0; 762 757 }
+44
arch/arm/mach-s3c2440/clock.c
··· 33 33 #include <linux/mutex.h> 34 34 #include <linux/clk.h> 35 35 #include <linux/io.h> 36 + #include <linux/serial_core.h> 36 37 37 38 #include <mach/hardware.h> 38 39 #include <linux/atomic.h> ··· 43 42 44 43 #include <plat/clock.h> 45 44 #include <plat/cpu.h> 45 + #include <plat/regs-serial.h> 46 46 47 47 /* S3C2440 extended clock support */ 48 48 ··· 109 107 .ctrlbit = S3C2440_CLKCON_CAMERA, 110 108 }; 111 109 110 + static unsigned long s3c2440_fclk_n_getrate(struct clk *clk) 111 + { 112 + unsigned long ucon0, ucon1, ucon2, divisor; 113 + 114 + /* the fun of calculating the uart divisors on the s3c2440 */ 115 + ucon0 = __raw_readl(S3C24XX_VA_UART0 + S3C2410_UCON); 116 + ucon1 = __raw_readl(S3C24XX_VA_UART1 + S3C2410_UCON); 117 + ucon2 = __raw_readl(S3C24XX_VA_UART2 + S3C2410_UCON); 118 + 119 + ucon0 &= S3C2440_UCON0_DIVMASK; 120 + ucon1 &= S3C2440_UCON1_DIVMASK; 121 + ucon2 &= S3C2440_UCON2_DIVMASK; 122 + 123 + if (ucon0 != 0) 124 + divisor = (ucon0 >> S3C2440_UCON_DIVSHIFT) + 6; 125 + else if (ucon1 != 0) 126 + divisor = (ucon1 >> S3C2440_UCON_DIVSHIFT) + 21; 127 + else if (ucon2 != 0) 128 + divisor = (ucon2 >> S3C2440_UCON_DIVSHIFT) + 36; 129 + else 130 + /* manual calims 44, seems to be 9 */ 131 + divisor = 9; 132 + 133 + return clk_get_rate(clk->parent) / divisor; 134 + } 135 + 136 + static struct clk s3c2440_clk_fclk_n = { 137 + .name = "fclk_n", 138 + .parent = &clk_f, 139 + .ops = &(struct clk_ops) { 140 + .get_rate = s3c2440_fclk_n_getrate, 141 + }, 142 + }; 143 + 144 + static struct clk_lookup s3c2440_clk_lookup[] = { 145 + CLKDEV_INIT(NULL, "clk_uart_baud1", &s3c24xx_uclk), 146 + CLKDEV_INIT(NULL, "clk_uart_baud2", &clk_p), 147 + CLKDEV_INIT(NULL, "clk_uart_baud3", &s3c2440_clk_fclk_n), 148 + }; 149 + 112 150 static int s3c2440_clk_add(struct device *dev) 113 151 { 114 152 struct clk *clock_upll; ··· 167 125 s3c2440_clk_cam.parent = clock_h; 168 126 s3c2440_clk_ac97.parent = clock_p; 169 127 s3c2440_clk_cam_upll.parent = clock_upll; 128 + s3c24xx_register_clock(&s3c2440_clk_fclk_n); 170 129 171 130 s3c24xx_register_clock(&s3c2440_clk_ac97); 172 131 s3c24xx_register_clock(&s3c2440_clk_cam); 173 132 s3c24xx_register_clock(&s3c2440_clk_cam_upll); 133 + clkdev_add_table(s3c2440_clk_lookup, ARRAY_SIZE(s3c2440_clk_lookup)); 174 134 175 135 clk_disable(&s3c2440_clk_ac97); 176 136 clk_disable(&s3c2440_clk_cam);
+2 -20
arch/arm/mach-s3c2440/mach-anubis.c
··· 98 98 #define ULCON S3C2410_LCON_CS8 | S3C2410_LCON_PNONE | S3C2410_LCON_STOPB 99 99 #define UFCON S3C2410_UFCON_RXTRIG8 | S3C2410_UFCON_FIFOMODE 100 100 101 - static struct s3c24xx_uart_clksrc anubis_serial_clocks[] = { 102 - [0] = { 103 - .name = "uclk", 104 - .divisor = 1, 105 - .min_baud = 0, 106 - .max_baud = 0, 107 - }, 108 - [1] = { 109 - .name = "pclk", 110 - .divisor = 1, 111 - .min_baud = 0, 112 - .max_baud = 0, 113 - } 114 - }; 115 - 116 - 117 101 static struct s3c2410_uartcfg anubis_uartcfgs[] __initdata = { 118 102 [0] = { 119 103 .hwport = 0, ··· 105 121 .ucon = UCON, 106 122 .ulcon = ULCON, 107 123 .ufcon = UFCON, 108 - .clocks = anubis_serial_clocks, 109 - .clocks_size = ARRAY_SIZE(anubis_serial_clocks), 124 + .clk_sel = S3C2410_UCON_CLKSEL1 | S3C2410_UCON_CLKSEL2, 110 125 }, 111 126 [1] = { 112 127 .hwport = 2, ··· 113 130 .ucon = UCON, 114 131 .ulcon = ULCON, 115 132 .ufcon = UFCON, 116 - .clocks = anubis_serial_clocks, 117 - .clocks_size = ARRAY_SIZE(anubis_serial_clocks), 133 + .clk_sel = S3C2410_UCON_CLKSEL1 | S3C2410_UCON_CLKSEL2, 118 134 }, 119 135 }; 120 136
+2 -20
arch/arm/mach-s3c2440/mach-at2440evb.c
··· 59 59 #define ULCON (S3C2410_LCON_CS8 | S3C2410_LCON_PNONE) 60 60 #define UFCON (S3C2410_UFCON_RXTRIG8 | S3C2410_UFCON_FIFOMODE) 61 61 62 - static struct s3c24xx_uart_clksrc at2440evb_serial_clocks[] = { 63 - [0] = { 64 - .name = "uclk", 65 - .divisor = 1, 66 - .min_baud = 0, 67 - .max_baud = 0, 68 - }, 69 - [1] = { 70 - .name = "pclk", 71 - .divisor = 1, 72 - .min_baud = 0, 73 - .max_baud = 0, 74 - } 75 - }; 76 - 77 - 78 62 static struct s3c2410_uartcfg at2440evb_uartcfgs[] __initdata = { 79 63 [0] = { 80 64 .hwport = 0, ··· 66 82 .ucon = UCON, 67 83 .ulcon = ULCON, 68 84 .ufcon = UFCON, 69 - .clocks = at2440evb_serial_clocks, 70 - .clocks_size = ARRAY_SIZE(at2440evb_serial_clocks), 85 + .clk_sel = S3C2410_UCON_CLKSEL1 | S3C2410_UCON_CLKSEL2, 71 86 }, 72 87 [1] = { 73 88 .hwport = 1, ··· 74 91 .ucon = UCON, 75 92 .ulcon = ULCON, 76 93 .ufcon = UFCON, 77 - .clocks = at2440evb_serial_clocks, 78 - .clocks_size = ARRAY_SIZE(at2440evb_serial_clocks), 94 + .clk_sel = S3C2410_UCON_CLKSEL1 | S3C2410_UCON_CLKSEL2, 79 95 }, 80 96 }; 81 97
+3 -21
arch/arm/mach-s3c2440/mach-osiris.c
··· 102 102 #define ULCON S3C2410_LCON_CS8 | S3C2410_LCON_PNONE | S3C2410_LCON_STOPB 103 103 #define UFCON S3C2410_UFCON_RXTRIG8 | S3C2410_UFCON_FIFOMODE 104 104 105 - static struct s3c24xx_uart_clksrc osiris_serial_clocks[] = { 106 - [0] = { 107 - .name = "uclk", 108 - .divisor = 1, 109 - .min_baud = 0, 110 - .max_baud = 0, 111 - }, 112 - [1] = { 113 - .name = "pclk", 114 - .divisor = 1, 115 - .min_baud = 0, 116 - .max_baud = 0, 117 - } 118 - }; 119 - 120 105 static struct s3c2410_uartcfg osiris_uartcfgs[] __initdata = { 121 106 [0] = { 122 107 .hwport = 0, ··· 109 124 .ucon = UCON, 110 125 .ulcon = ULCON, 111 126 .ufcon = UFCON, 112 - .clocks = osiris_serial_clocks, 113 - .clocks_size = ARRAY_SIZE(osiris_serial_clocks), 127 + .clk_sel = S3C2410_UCON_CLKSEL1 | S3C2410_UCON_CLKSEL2, 114 128 }, 115 129 [1] = { 116 130 .hwport = 1, ··· 117 133 .ucon = UCON, 118 134 .ulcon = ULCON, 119 135 .ufcon = UFCON, 120 - .clocks = osiris_serial_clocks, 121 - .clocks_size = ARRAY_SIZE(osiris_serial_clocks), 136 + .clk_sel = S3C2410_UCON_CLKSEL1 | S3C2410_UCON_CLKSEL2, 122 137 }, 123 138 [2] = { 124 139 .hwport = 2, ··· 125 142 .ucon = UCON, 126 143 .ulcon = ULCON, 127 144 .ufcon = UFCON, 128 - .clocks = osiris_serial_clocks, 129 - .clocks_size = ARRAY_SIZE(osiris_serial_clocks), 145 + .clk_sel = S3C2410_UCON_CLKSEL1 | S3C2410_UCON_CLKSEL2, 130 146 } 131 147 }; 132 148
+3 -15
arch/arm/mach-s3c2440/mach-rx1950.c
··· 70 70 static struct map_desc rx1950_iodesc[] __initdata = { 71 71 }; 72 72 73 - static struct s3c24xx_uart_clksrc rx1950_serial_clocks[] = { 74 - [0] = { 75 - .name = "fclk", 76 - .divisor = 0x0a, 77 - .min_baud = 0, 78 - .max_baud = 0, 79 - }, 80 - }; 81 - 82 73 static struct s3c2410_uartcfg rx1950_uartcfgs[] __initdata = { 83 74 [0] = { 84 75 .hwport = 0, ··· 77 86 .ucon = 0x3c5, 78 87 .ulcon = 0x03, 79 88 .ufcon = 0x51, 80 - .clocks = rx1950_serial_clocks, 81 - .clocks_size = ARRAY_SIZE(rx1950_serial_clocks), 89 + .clk_sel = S3C2410_UCON_CLKSEL3, 82 90 }, 83 91 [1] = { 84 92 .hwport = 1, ··· 85 95 .ucon = 0x3c5, 86 96 .ulcon = 0x03, 87 97 .ufcon = 0x51, 88 - .clocks = rx1950_serial_clocks, 89 - .clocks_size = ARRAY_SIZE(rx1950_serial_clocks), 98 + .clk_sel = S3C2410_UCON_CLKSEL3, 90 99 }, 91 100 /* IR port */ 92 101 [2] = { ··· 94 105 .ucon = 0x3c5, 95 106 .ulcon = 0x43, 96 107 .ufcon = 0xf1, 97 - .clocks = rx1950_serial_clocks, 98 - .clocks_size = ARRAY_SIZE(rx1950_serial_clocks), 108 + .clk_sel = S3C2410_UCON_CLKSEL3, 99 109 }, 100 110 }; 101 111
+3 -16
arch/arm/mach-s3c2440/mach-rx3715.c
··· 69 69 }, 70 70 }; 71 71 72 - 73 - static struct s3c24xx_uart_clksrc rx3715_serial_clocks[] = { 74 - [0] = { 75 - .name = "fclk", 76 - .divisor = 0, 77 - .min_baud = 0, 78 - .max_baud = 0, 79 - } 80 - }; 81 - 82 72 static struct s3c2410_uartcfg rx3715_uartcfgs[] = { 83 73 [0] = { 84 74 .hwport = 0, ··· 76 86 .ucon = 0x3c5, 77 87 .ulcon = 0x03, 78 88 .ufcon = 0x51, 79 - .clocks = rx3715_serial_clocks, 80 - .clocks_size = ARRAY_SIZE(rx3715_serial_clocks), 89 + .clk_sel = S3C2410_UCON_CLKSEL3, 81 90 }, 82 91 [1] = { 83 92 .hwport = 1, ··· 84 95 .ucon = 0x3c5, 85 96 .ulcon = 0x03, 86 97 .ufcon = 0x00, 87 - .clocks = rx3715_serial_clocks, 88 - .clocks_size = ARRAY_SIZE(rx3715_serial_clocks), 98 + .clk_sel = S3C2410_UCON_CLKSEL3, 89 99 }, 90 100 /* IR port */ 91 101 [2] = { ··· 93 105 .ucon = 0x3c5, 94 106 .ulcon = 0x43, 95 107 .ufcon = 0x51, 96 - .clocks = rx3715_serial_clocks, 97 - .clocks_size = ARRAY_SIZE(rx3715_serial_clocks), 108 + .clk_sel = S3C2410_UCON_CLKSEL3, 98 109 } 99 110 }; 100 111
+27 -10
arch/arm/mach-s3c64xx/clock.c
··· 617 617 .sources = &clkset_uhost, 618 618 }, { 619 619 .clk = { 620 - .name = "uclk1", 621 - .ctrlbit = S3C_CLKCON_SCLK_UART, 622 - .enable = s3c64xx_sclk_ctrl, 623 - }, 624 - .reg_src = { .reg = S3C_CLK_SRC, .shift = 13, .size = 1 }, 625 - .reg_div = { .reg = S3C_CLK_DIV2, .shift = 16, .size = 4 }, 626 - .sources = &clkset_uart, 627 - }, { 628 - /* Where does UCLK0 come from? */ 629 - .clk = { 630 620 .name = "spi-bus", 631 621 .devname = "s3c64xx-spi.0", 632 622 .ctrlbit = S3C_CLKCON_SCLK_SPI0, ··· 685 695 }, 686 696 }; 687 697 698 + /* Where does UCLK0 come from? */ 699 + static struct clksrc_clk clk_sclk_uclk = { 700 + .clk = { 701 + .name = "uclk1", 702 + .ctrlbit = S3C_CLKCON_SCLK_UART, 703 + .enable = s3c64xx_sclk_ctrl, 704 + }, 705 + .reg_src = { .reg = S3C_CLK_SRC, .shift = 13, .size = 1 }, 706 + .reg_div = { .reg = S3C_CLK_DIV2, .shift = 16, .size = 4 }, 707 + .sources = &clkset_uart, 708 + }; 709 + 688 710 /* Clock initialisation code */ 689 711 690 712 static struct clksrc_clk *init_parents[] = { 691 713 &clk_mout_apll, 692 714 &clk_mout_epll, 693 715 &clk_mout_mpll, 716 + }; 717 + 718 + static struct clksrc_clk *clksrc_cdev[] = { 719 + &clk_sclk_uclk, 720 + }; 721 + 722 + static struct clk_lookup s3c64xx_clk_lookup[] = { 723 + CLKDEV_INIT(NULL, "clk_uart_baud2", &clk_p), 724 + CLKDEV_INIT(NULL, "clk_uart_baud3", &clk_sclk_uclk.clk), 694 725 }; 695 726 696 727 #define GET_DIV(clk, field) ((((clk) & field##_MASK) >> field##_SHIFT) + 1) ··· 822 811 void __init s3c64xx_register_clocks(unsigned long xtal, 823 812 unsigned armclk_divlimit) 824 813 { 814 + unsigned int cnt; 815 + 825 816 armclk_mask = armclk_divlimit; 826 817 827 818 s3c24xx_register_baseclocks(xtal); ··· 836 823 837 824 s3c24xx_register_clocks(clks1, ARRAY_SIZE(clks1)); 838 825 s3c_register_clksrc(clksrcs, ARRAY_SIZE(clksrcs)); 826 + for (cnt = 0; cnt < ARRAY_SIZE(clksrc_cdev); cnt++) 827 + s3c_register_clksrc(clksrc_cdev[cnt], 1); 828 + clkdev_add_table(s3c64xx_clk_lookup, ARRAY_SIZE(s3c64xx_clk_lookup)); 829 + 839 830 s3c_pwmclk_init(); 840 831 }
+23 -9
arch/arm/mach-s5p64x0/clock-s5p6440.c
··· 422 422 .reg_div = { .reg = S5P64X0_CLK_DIV1, .shift = 8, .size = 4 }, 423 423 }, { 424 424 .clk = { 425 - .name = "uclk1", 426 - .ctrlbit = (1 << 5), 427 - .enable = s5p64x0_sclk_ctrl, 428 - }, 429 - .sources = &clkset_uart, 430 - .reg_src = { .reg = S5P64X0_CLK_SRC0, .shift = 13, .size = 1 }, 431 - .reg_div = { .reg = S5P64X0_CLK_DIV2, .shift = 16, .size = 4 }, 432 - }, { 433 - .clk = { 434 425 .name = "sclk_spi", 435 426 .devname = "s3c64xx-spi.0", 436 427 .ctrlbit = (1 << 20), ··· 479 488 }, 480 489 }; 481 490 491 + static struct clksrc_clk clk_sclk_uclk = { 492 + .clk = { 493 + .name = "uclk1", 494 + .ctrlbit = (1 << 5), 495 + .enable = s5p64x0_sclk_ctrl, 496 + }, 497 + .sources = &clkset_uart, 498 + .reg_src = { .reg = S5P64X0_CLK_SRC0, .shift = 13, .size = 1 }, 499 + .reg_div = { .reg = S5P64X0_CLK_DIV2, .shift = 16, .size = 4 }, 500 + }; 501 + 482 502 /* Clock initialization code */ 483 503 static struct clksrc_clk *sysclks[] = { 484 504 &clk_mout_apll, ··· 506 504 static struct clk dummy_apb_pclk = { 507 505 .name = "apb_pclk", 508 506 .id = -1, 507 + }; 508 + 509 + static struct clksrc_clk *clksrc_cdev[] = { 510 + &clk_sclk_uclk, 511 + }; 512 + 513 + static struct clk_lookup s5p6440_clk_lookup[] = { 514 + CLKDEV_INIT(NULL, "clk_uart_baud2", &clk_pclk_low.clk), 515 + CLKDEV_INIT(NULL, "clk_uart_baud3", &clk_sclk_uclk.clk), 509 516 }; 510 517 511 518 void __init_or_cpufreq s5p6440_setup_clocks(void) ··· 595 584 596 585 s3c_register_clksrc(clksrcs, ARRAY_SIZE(clksrcs)); 597 586 s3c_register_clocks(init_clocks, ARRAY_SIZE(init_clocks)); 587 + for (ptr = 0; ptr < ARRAY_SIZE(clksrc_cdev); ptr++) 588 + s3c_register_clksrc(clksrc_cdev[ptr], 1); 598 589 599 590 s3c_register_clocks(init_clocks_off, ARRAY_SIZE(init_clocks_off)); 600 591 s3c_disable_clocks(init_clocks_off, ARRAY_SIZE(init_clocks_off)); 592 + clkdev_add_table(s5p6440_clk_lookup, ARRAY_SIZE(s5p6440_clk_lookup)); 601 593 602 594 s3c24xx_register_clock(&dummy_apb_pclk); 603 595
+23 -9
arch/arm/mach-s5p64x0/clock-s5p6450.c
··· 444 444 .reg_div = { .reg = S5P64X0_CLK_DIV1, .shift = 8, .size = 4 }, 445 445 }, { 446 446 .clk = { 447 - .name = "uclk1", 448 - .ctrlbit = (1 << 5), 449 - .enable = s5p64x0_sclk_ctrl, 450 - }, 451 - .sources = &clkset_uart, 452 - .reg_src = { .reg = S5P64X0_CLK_SRC0, .shift = 13, .size = 1 }, 453 - .reg_div = { .reg = S5P64X0_CLK_DIV2, .shift = 16, .size = 4 }, 454 - }, { 455 - .clk = { 456 447 .name = "sclk_spi", 457 448 .devname = "s3c64xx-spi.0", 458 449 .ctrlbit = (1 << 20), ··· 526 535 .reg_src = { .reg = S5P64X0_CLK_SRC0, .shift = 6, .size = 3 }, 527 536 .reg_div = { .reg = S5P64X0_CLK_DIV1, .shift = 28, .size = 4 }, 528 537 }, 538 + }; 539 + 540 + static struct clksrc_clk clk_sclk_uclk = { 541 + .clk = { 542 + .name = "uclk1", 543 + .ctrlbit = (1 << 5), 544 + .enable = s5p64x0_sclk_ctrl, 545 + }, 546 + .sources = &clkset_uart, 547 + .reg_src = { .reg = S5P64X0_CLK_SRC0, .shift = 13, .size = 1 }, 548 + .reg_div = { .reg = S5P64X0_CLK_DIV2, .shift = 16, .size = 4 }, 549 + }; 550 + 551 + static struct clksrc_clk *clksrc_cdev[] = { 552 + &clk_sclk_uclk, 553 + }; 554 + 555 + static struct clk_lookup s5p6450_clk_lookup[] = { 556 + CLKDEV_INIT(NULL, "clk_uart_baud2", &clk_pclk_low.clk), 557 + CLKDEV_INIT(NULL, "clk_uart_baud3", &clk_sclk_uclk.clk), 529 558 }; 530 559 531 560 /* Clock initialization code */ ··· 646 635 647 636 s3c_register_clksrc(clksrcs, ARRAY_SIZE(clksrcs)); 648 637 s3c_register_clocks(init_clocks, ARRAY_SIZE(init_clocks)); 638 + for (ptr = 0; ptr < ARRAY_SIZE(clksrc_cdev); ptr++) 639 + s3c_register_clksrc(clksrc_cdev[ptr], 1); 649 640 650 641 s3c_register_clocks(init_clocks_off, ARRAY_SIZE(init_clocks_off)); 651 642 s3c_disable_clocks(init_clocks_off, ARRAY_SIZE(init_clocks_off)); 643 + clkdev_add_table(s5p6450_clk_lookup, ARRAY_SIZE(s5p6450_clk_lookup)); 652 644 653 645 s3c24xx_register_clock(&dummy_apb_pclk); 654 646
-31
arch/arm/mach-s5p64x0/common.c
··· 282 282 return device_register(&s5p64x0_dev); 283 283 } 284 284 285 - static struct s3c24xx_uart_clksrc s5p64x0_serial_clocks[] = { 286 - [0] = { 287 - .name = "pclk_low", 288 - .divisor = 1, 289 - .min_baud = 0, 290 - .max_baud = 0, 291 - }, 292 - [1] = { 293 - .name = "uclk1", 294 - .divisor = 1, 295 - .min_baud = 0, 296 - .max_baud = 0, 297 - }, 298 - }; 299 - 300 285 /* uart registration process */ 301 - 302 - void __init s5p64x0_common_init_uarts(struct s3c2410_uartcfg *cfg, int no) 303 - { 304 - struct s3c2410_uartcfg *tcfg = cfg; 305 - u32 ucnt; 306 - 307 - for (ucnt = 0; ucnt < no; ucnt++, tcfg++) { 308 - if (!tcfg->clocks) { 309 - tcfg->clocks = s5p64x0_serial_clocks; 310 - tcfg->clocks_size = ARRAY_SIZE(s5p64x0_serial_clocks); 311 - } 312 - } 313 - } 314 - 315 286 void __init s5p6440_init_uarts(struct s3c2410_uartcfg *cfg, int no) 316 287 { 317 288 int uart; ··· 292 321 s5p_uart_resources[uart].resources->end = S5P6440_PA_UART(uart) + S5P_SZ_UART; 293 322 } 294 323 295 - s5p64x0_common_init_uarts(cfg, no); 296 324 s3c24xx_init_uartdevs("s3c6400-uart", s5p_uart_resources, cfg, no); 297 325 } 298 326 299 327 void __init s5p6450_init_uarts(struct s3c2410_uartcfg *cfg, int no) 300 328 { 301 - s5p64x0_common_init_uarts(cfg, no); 302 329 s3c24xx_init_uartdevs("s3c6400-uart", s5p_uart_resources, cfg, no); 303 330 } 304 331
+65 -162
arch/arm/mach-s5p64x0/dma.c
··· 38 38 39 39 static u64 dma_dmamask = DMA_BIT_MASK(32); 40 40 41 - struct dma_pl330_peri s5p6440_pdma_peri[22] = { 42 - { 43 - .peri_id = (u8)DMACH_UART0_RX, 44 - .rqtype = DEVTOMEM, 45 - }, { 46 - .peri_id = (u8)DMACH_UART0_TX, 47 - .rqtype = MEMTODEV, 48 - }, { 49 - .peri_id = (u8)DMACH_UART1_RX, 50 - .rqtype = DEVTOMEM, 51 - }, { 52 - .peri_id = (u8)DMACH_UART1_TX, 53 - .rqtype = MEMTODEV, 54 - }, { 55 - .peri_id = (u8)DMACH_UART2_RX, 56 - .rqtype = DEVTOMEM, 57 - }, { 58 - .peri_id = (u8)DMACH_UART2_TX, 59 - .rqtype = MEMTODEV, 60 - }, { 61 - .peri_id = (u8)DMACH_UART3_RX, 62 - .rqtype = DEVTOMEM, 63 - }, { 64 - .peri_id = (u8)DMACH_UART3_TX, 65 - .rqtype = MEMTODEV, 66 - }, { 67 - .peri_id = DMACH_MAX, 68 - }, { 69 - .peri_id = DMACH_MAX, 70 - }, { 71 - .peri_id = (u8)DMACH_PCM0_TX, 72 - .rqtype = MEMTODEV, 73 - }, { 74 - .peri_id = (u8)DMACH_PCM0_RX, 75 - .rqtype = DEVTOMEM, 76 - }, { 77 - .peri_id = (u8)DMACH_I2S0_TX, 78 - .rqtype = MEMTODEV, 79 - }, { 80 - .peri_id = (u8)DMACH_I2S0_RX, 81 - .rqtype = DEVTOMEM, 82 - }, { 83 - .peri_id = (u8)DMACH_SPI0_TX, 84 - .rqtype = MEMTODEV, 85 - }, { 86 - .peri_id = (u8)DMACH_SPI0_RX, 87 - .rqtype = DEVTOMEM, 88 - }, { 89 - .peri_id = (u8)DMACH_MAX, 90 - }, { 91 - .peri_id = (u8)DMACH_MAX, 92 - }, { 93 - .peri_id = (u8)DMACH_MAX, 94 - }, { 95 - .peri_id = (u8)DMACH_MAX, 96 - }, { 97 - .peri_id = (u8)DMACH_SPI1_TX, 98 - .rqtype = MEMTODEV, 99 - }, { 100 - .peri_id = (u8)DMACH_SPI1_RX, 101 - .rqtype = DEVTOMEM, 102 - }, 41 + u8 s5p6440_pdma_peri[] = { 42 + DMACH_UART0_RX, 43 + DMACH_UART0_TX, 44 + DMACH_UART1_RX, 45 + DMACH_UART1_TX, 46 + DMACH_UART2_RX, 47 + DMACH_UART2_TX, 48 + DMACH_UART3_RX, 49 + DMACH_UART3_TX, 50 + DMACH_MAX, 51 + DMACH_MAX, 52 + DMACH_PCM0_TX, 53 + DMACH_PCM0_RX, 54 + DMACH_I2S0_TX, 55 + DMACH_I2S0_RX, 56 + DMACH_SPI0_TX, 57 + DMACH_SPI0_RX, 58 + DMACH_MAX, 59 + DMACH_MAX, 60 + DMACH_MAX, 61 + DMACH_MAX, 62 + DMACH_SPI1_TX, 63 + DMACH_SPI1_RX, 103 64 }; 104 65 105 66 struct dma_pl330_platdata s5p6440_pdma_pdata = { 106 67 .nr_valid_peri = ARRAY_SIZE(s5p6440_pdma_peri), 107 - .peri = s5p6440_pdma_peri, 68 + .peri_id = s5p6440_pdma_peri, 108 69 }; 109 70 110 - struct dma_pl330_peri s5p6450_pdma_peri[32] = { 111 - { 112 - .peri_id = (u8)DMACH_UART0_RX, 113 - .rqtype = DEVTOMEM, 114 - }, { 115 - .peri_id = (u8)DMACH_UART0_TX, 116 - .rqtype = MEMTODEV, 117 - }, { 118 - .peri_id = (u8)DMACH_UART1_RX, 119 - .rqtype = DEVTOMEM, 120 - }, { 121 - .peri_id = (u8)DMACH_UART1_TX, 122 - .rqtype = MEMTODEV, 123 - }, { 124 - .peri_id = (u8)DMACH_UART2_RX, 125 - .rqtype = DEVTOMEM, 126 - }, { 127 - .peri_id = (u8)DMACH_UART2_TX, 128 - .rqtype = MEMTODEV, 129 - }, { 130 - .peri_id = (u8)DMACH_UART3_RX, 131 - .rqtype = DEVTOMEM, 132 - }, { 133 - .peri_id = (u8)DMACH_UART3_TX, 134 - .rqtype = MEMTODEV, 135 - }, { 136 - .peri_id = (u8)DMACH_UART4_RX, 137 - .rqtype = DEVTOMEM, 138 - }, { 139 - .peri_id = (u8)DMACH_UART4_TX, 140 - .rqtype = MEMTODEV, 141 - }, { 142 - .peri_id = (u8)DMACH_PCM0_TX, 143 - .rqtype = MEMTODEV, 144 - }, { 145 - .peri_id = (u8)DMACH_PCM0_RX, 146 - .rqtype = DEVTOMEM, 147 - }, { 148 - .peri_id = (u8)DMACH_I2S0_TX, 149 - .rqtype = MEMTODEV, 150 - }, { 151 - .peri_id = (u8)DMACH_I2S0_RX, 152 - .rqtype = DEVTOMEM, 153 - }, { 154 - .peri_id = (u8)DMACH_SPI0_TX, 155 - .rqtype = MEMTODEV, 156 - }, { 157 - .peri_id = (u8)DMACH_SPI0_RX, 158 - .rqtype = DEVTOMEM, 159 - }, { 160 - .peri_id = (u8)DMACH_PCM1_TX, 161 - .rqtype = MEMTODEV, 162 - }, { 163 - .peri_id = (u8)DMACH_PCM1_RX, 164 - .rqtype = DEVTOMEM, 165 - }, { 166 - .peri_id = (u8)DMACH_PCM2_TX, 167 - .rqtype = MEMTODEV, 168 - }, { 169 - .peri_id = (u8)DMACH_PCM2_RX, 170 - .rqtype = DEVTOMEM, 171 - }, { 172 - .peri_id = (u8)DMACH_SPI1_TX, 173 - .rqtype = MEMTODEV, 174 - }, { 175 - .peri_id = (u8)DMACH_SPI1_RX, 176 - .rqtype = DEVTOMEM, 177 - }, { 178 - .peri_id = (u8)DMACH_USI_TX, 179 - .rqtype = MEMTODEV, 180 - }, { 181 - .peri_id = (u8)DMACH_USI_RX, 182 - .rqtype = DEVTOMEM, 183 - }, { 184 - .peri_id = (u8)DMACH_MAX, 185 - }, { 186 - .peri_id = (u8)DMACH_I2S1_TX, 187 - .rqtype = MEMTODEV, 188 - }, { 189 - .peri_id = (u8)DMACH_I2S1_RX, 190 - .rqtype = DEVTOMEM, 191 - }, { 192 - .peri_id = (u8)DMACH_I2S2_TX, 193 - .rqtype = MEMTODEV, 194 - }, { 195 - .peri_id = (u8)DMACH_I2S2_RX, 196 - .rqtype = DEVTOMEM, 197 - }, { 198 - .peri_id = (u8)DMACH_PWM, 199 - }, { 200 - .peri_id = (u8)DMACH_UART5_RX, 201 - .rqtype = DEVTOMEM, 202 - }, { 203 - .peri_id = (u8)DMACH_UART5_TX, 204 - .rqtype = MEMTODEV, 205 - }, 71 + u8 s5p6450_pdma_peri[] = { 72 + DMACH_UART0_RX, 73 + DMACH_UART0_TX, 74 + DMACH_UART1_RX, 75 + DMACH_UART1_TX, 76 + DMACH_UART2_RX, 77 + DMACH_UART2_TX, 78 + DMACH_UART3_RX, 79 + DMACH_UART3_TX, 80 + DMACH_UART4_RX, 81 + DMACH_UART4_TX, 82 + DMACH_PCM0_TX, 83 + DMACH_PCM0_RX, 84 + DMACH_I2S0_TX, 85 + DMACH_I2S0_RX, 86 + DMACH_SPI0_TX, 87 + DMACH_SPI0_RX, 88 + DMACH_PCM1_TX, 89 + DMACH_PCM1_RX, 90 + DMACH_PCM2_TX, 91 + DMACH_PCM2_RX, 92 + DMACH_SPI1_TX, 93 + DMACH_SPI1_RX, 94 + DMACH_USI_TX, 95 + DMACH_USI_RX, 96 + DMACH_MAX, 97 + DMACH_I2S1_TX, 98 + DMACH_I2S1_RX, 99 + DMACH_I2S2_TX, 100 + DMACH_I2S2_RX, 101 + DMACH_PWM, 102 + DMACH_UART5_RX, 103 + DMACH_UART5_TX, 206 104 }; 207 105 208 106 struct dma_pl330_platdata s5p6450_pdma_pdata = { 209 107 .nr_valid_peri = ARRAY_SIZE(s5p6450_pdma_peri), 210 - .peri = s5p6450_pdma_peri, 108 + .peri_id = s5p6450_pdma_peri, 211 109 }; 212 110 213 111 struct amba_device s5p64x0_device_pdma = { ··· 125 227 126 228 static int __init s5p64x0_dma_init(void) 127 229 { 128 - if (soc_is_s5p6450()) 230 + if (soc_is_s5p6450()) { 231 + dma_cap_set(DMA_SLAVE, s5p6450_pdma_pdata.cap_mask); 232 + dma_cap_set(DMA_CYCLIC, s5p6450_pdma_pdata.cap_mask); 129 233 s5p64x0_device_pdma.dev.platform_data = &s5p6450_pdma_pdata; 130 - else 234 + } else { 235 + dma_cap_set(DMA_SLAVE, s5p6440_pdma_pdata.cap_mask); 236 + dma_cap_set(DMA_CYCLIC, s5p6440_pdma_pdata.cap_mask); 131 237 s5p64x0_device_pdma.dev.platform_data = &s5p6440_pdma_pdata; 238 + } 132 239 133 240 amba_device_register(&s5p64x0_device_pdma, &iomem_resource); 134 241
+2
arch/arm/mach-s5p64x0/include/mach/irqs.h
··· 141 141 142 142 #define IRQ_EINT_GROUP(grp, x) (IRQ_EINT_GROUP##grp##_BASE + (x)) 143 143 144 + #define IRQ_TIMER_BASE (11) 145 + 144 146 /* Set the default NR_IRQS */ 145 147 146 148 #define NR_IRQS (IRQ_EINT_GROUP8_BASE + IRQ_EINT_GROUP8_NR + 1)
+23 -10
arch/arm/mach-s5pc100/clock.c
··· 963 963 .reg_div = { .reg = S5P_CLK_DIV2, .shift = 12, .size = 4 }, 964 964 }, { 965 965 .clk = { 966 - .name = "uclk1", 967 - .ctrlbit = (1 << 3), 968 - .enable = s5pc100_sclk0_ctrl, 969 - 970 - }, 971 - .sources = &clk_src_group2, 972 - .reg_src = { .reg = S5P_CLK_SRC1, .shift = 0, .size = 1 }, 973 - .reg_div = { .reg = S5P_CLK_DIV2, .shift = 0, .size = 4 }, 974 - }, { 975 - .clk = { 976 966 .name = "sclk_mixer", 977 967 .ctrlbit = (1 << 6), 978 968 .enable = s5pc100_sclk0_ctrl, ··· 1089 1099 }, 1090 1100 }; 1091 1101 1102 + static struct clksrc_clk clk_sclk_uart = { 1103 + .clk = { 1104 + .name = "uclk1", 1105 + .ctrlbit = (1 << 3), 1106 + .enable = s5pc100_sclk0_ctrl, 1107 + }, 1108 + .sources = &clk_src_group2, 1109 + .reg_src = { .reg = S5P_CLK_SRC1, .shift = 0, .size = 1 }, 1110 + .reg_div = { .reg = S5P_CLK_DIV2, .shift = 0, .size = 4 }, 1111 + }; 1112 + 1092 1113 /* Clock initialisation code */ 1093 1114 static struct clksrc_clk *sysclks[] = { 1094 1115 &clk_mout_apll, ··· 1127 1126 &clk_sclk_audio1, 1128 1127 &clk_sclk_audio2, 1129 1128 &clk_sclk_spdif, 1129 + }; 1130 + 1131 + static struct clksrc_clk *clksrc_cdev[] = { 1132 + &clk_sclk_uart, 1130 1133 }; 1131 1134 1132 1135 void __init_or_cpufreq s5pc100_setup_clocks(void) ··· 1272 1267 &clk_pcmcdclk1, 1273 1268 }; 1274 1269 1270 + static struct clk_lookup s5pc100_clk_lookup[] = { 1271 + CLKDEV_INIT(NULL, "clk_uart_baud2", &clk_p), 1272 + CLKDEV_INIT(NULL, "clk_uart_baud3", &clk_sclk_uart.clk), 1273 + }; 1274 + 1275 1275 void __init s5pc100_register_clocks(void) 1276 1276 { 1277 1277 int ptr; ··· 1288 1278 1289 1279 s3c_register_clksrc(clksrcs, ARRAY_SIZE(clksrcs)); 1290 1280 s3c_register_clocks(init_clocks, ARRAY_SIZE(init_clocks)); 1281 + for (ptr = 0; ptr < ARRAY_SIZE(clksrc_cdev); ptr++) 1282 + s3c_register_clksrc(clksrc_cdev[ptr], 1); 1291 1283 1292 1284 s3c_register_clocks(init_clocks_off, ARRAY_SIZE(init_clocks_off)); 1293 1285 s3c_disable_clocks(init_clocks_off, ARRAY_SIZE(init_clocks_off)); 1286 + clkdev_add_table(s5pc100_clk_lookup, ARRAY_SIZE(s5pc100_clk_lookup)); 1294 1287 1295 1288 s3c24xx_register_clock(&dummy_apb_pclk); 1296 1289
+69 -178
arch/arm/mach-s5pc100/dma.c
··· 35 35 36 36 static u64 dma_dmamask = DMA_BIT_MASK(32); 37 37 38 - struct dma_pl330_peri pdma0_peri[30] = { 39 - { 40 - .peri_id = (u8)DMACH_UART0_RX, 41 - .rqtype = DEVTOMEM, 42 - }, { 43 - .peri_id = (u8)DMACH_UART0_TX, 44 - .rqtype = MEMTODEV, 45 - }, { 46 - .peri_id = (u8)DMACH_UART1_RX, 47 - .rqtype = DEVTOMEM, 48 - }, { 49 - .peri_id = (u8)DMACH_UART1_TX, 50 - .rqtype = MEMTODEV, 51 - }, { 52 - .peri_id = (u8)DMACH_UART2_RX, 53 - .rqtype = DEVTOMEM, 54 - }, { 55 - .peri_id = (u8)DMACH_UART2_TX, 56 - .rqtype = MEMTODEV, 57 - }, { 58 - .peri_id = (u8)DMACH_UART3_RX, 59 - .rqtype = DEVTOMEM, 60 - }, { 61 - .peri_id = (u8)DMACH_UART3_TX, 62 - .rqtype = MEMTODEV, 63 - }, { 64 - .peri_id = DMACH_IRDA, 65 - }, { 66 - .peri_id = (u8)DMACH_I2S0_RX, 67 - .rqtype = DEVTOMEM, 68 - }, { 69 - .peri_id = (u8)DMACH_I2S0_TX, 70 - .rqtype = MEMTODEV, 71 - }, { 72 - .peri_id = (u8)DMACH_I2S0S_TX, 73 - .rqtype = MEMTODEV, 74 - }, { 75 - .peri_id = (u8)DMACH_I2S1_RX, 76 - .rqtype = DEVTOMEM, 77 - }, { 78 - .peri_id = (u8)DMACH_I2S1_TX, 79 - .rqtype = MEMTODEV, 80 - }, { 81 - .peri_id = (u8)DMACH_I2S2_RX, 82 - .rqtype = DEVTOMEM, 83 - }, { 84 - .peri_id = (u8)DMACH_I2S2_TX, 85 - .rqtype = MEMTODEV, 86 - }, { 87 - .peri_id = (u8)DMACH_SPI0_RX, 88 - .rqtype = DEVTOMEM, 89 - }, { 90 - .peri_id = (u8)DMACH_SPI0_TX, 91 - .rqtype = MEMTODEV, 92 - }, { 93 - .peri_id = (u8)DMACH_SPI1_RX, 94 - .rqtype = DEVTOMEM, 95 - }, { 96 - .peri_id = (u8)DMACH_SPI1_TX, 97 - .rqtype = MEMTODEV, 98 - }, { 99 - .peri_id = (u8)DMACH_SPI2_RX, 100 - .rqtype = DEVTOMEM, 101 - }, { 102 - .peri_id = (u8)DMACH_SPI2_TX, 103 - .rqtype = MEMTODEV, 104 - }, { 105 - .peri_id = (u8)DMACH_AC97_MICIN, 106 - .rqtype = DEVTOMEM, 107 - }, { 108 - .peri_id = (u8)DMACH_AC97_PCMIN, 109 - .rqtype = DEVTOMEM, 110 - }, { 111 - .peri_id = (u8)DMACH_AC97_PCMOUT, 112 - .rqtype = MEMTODEV, 113 - }, { 114 - .peri_id = (u8)DMACH_EXTERNAL, 115 - }, { 116 - .peri_id = (u8)DMACH_PWM, 117 - }, { 118 - .peri_id = (u8)DMACH_SPDIF, 119 - .rqtype = MEMTODEV, 120 - }, { 121 - .peri_id = (u8)DMACH_HSI_RX, 122 - .rqtype = DEVTOMEM, 123 - }, { 124 - .peri_id = (u8)DMACH_HSI_TX, 125 - .rqtype = MEMTODEV, 126 - }, 38 + u8 pdma0_peri[] = { 39 + DMACH_UART0_RX, 40 + DMACH_UART0_TX, 41 + DMACH_UART1_RX, 42 + DMACH_UART1_TX, 43 + DMACH_UART2_RX, 44 + DMACH_UART2_TX, 45 + DMACH_UART3_RX, 46 + DMACH_UART3_TX, 47 + DMACH_IRDA, 48 + DMACH_I2S0_RX, 49 + DMACH_I2S0_TX, 50 + DMACH_I2S0S_TX, 51 + DMACH_I2S1_RX, 52 + DMACH_I2S1_TX, 53 + DMACH_I2S2_RX, 54 + DMACH_I2S2_TX, 55 + DMACH_SPI0_RX, 56 + DMACH_SPI0_TX, 57 + DMACH_SPI1_RX, 58 + DMACH_SPI1_TX, 59 + DMACH_SPI2_RX, 60 + DMACH_SPI2_TX, 61 + DMACH_AC97_MICIN, 62 + DMACH_AC97_PCMIN, 63 + DMACH_AC97_PCMOUT, 64 + DMACH_EXTERNAL, 65 + DMACH_PWM, 66 + DMACH_SPDIF, 67 + DMACH_HSI_RX, 68 + DMACH_HSI_TX, 127 69 }; 128 70 129 71 struct dma_pl330_platdata s5pc100_pdma0_pdata = { 130 72 .nr_valid_peri = ARRAY_SIZE(pdma0_peri), 131 - .peri = pdma0_peri, 73 + .peri_id = pdma0_peri, 132 74 }; 133 75 134 76 struct amba_device s5pc100_device_pdma0 = { ··· 89 147 .periphid = 0x00041330, 90 148 }; 91 149 92 - struct dma_pl330_peri pdma1_peri[30] = { 93 - { 94 - .peri_id = (u8)DMACH_UART0_RX, 95 - .rqtype = DEVTOMEM, 96 - }, { 97 - .peri_id = (u8)DMACH_UART0_TX, 98 - .rqtype = MEMTODEV, 99 - }, { 100 - .peri_id = (u8)DMACH_UART1_RX, 101 - .rqtype = DEVTOMEM, 102 - }, { 103 - .peri_id = (u8)DMACH_UART1_TX, 104 - .rqtype = MEMTODEV, 105 - }, { 106 - .peri_id = (u8)DMACH_UART2_RX, 107 - .rqtype = DEVTOMEM, 108 - }, { 109 - .peri_id = (u8)DMACH_UART2_TX, 110 - .rqtype = MEMTODEV, 111 - }, { 112 - .peri_id = (u8)DMACH_UART3_RX, 113 - .rqtype = DEVTOMEM, 114 - }, { 115 - .peri_id = (u8)DMACH_UART3_TX, 116 - .rqtype = MEMTODEV, 117 - }, { 118 - .peri_id = DMACH_IRDA, 119 - }, { 120 - .peri_id = (u8)DMACH_I2S0_RX, 121 - .rqtype = DEVTOMEM, 122 - }, { 123 - .peri_id = (u8)DMACH_I2S0_TX, 124 - .rqtype = MEMTODEV, 125 - }, { 126 - .peri_id = (u8)DMACH_I2S0S_TX, 127 - .rqtype = MEMTODEV, 128 - }, { 129 - .peri_id = (u8)DMACH_I2S1_RX, 130 - .rqtype = DEVTOMEM, 131 - }, { 132 - .peri_id = (u8)DMACH_I2S1_TX, 133 - .rqtype = MEMTODEV, 134 - }, { 135 - .peri_id = (u8)DMACH_I2S2_RX, 136 - .rqtype = DEVTOMEM, 137 - }, { 138 - .peri_id = (u8)DMACH_I2S2_TX, 139 - .rqtype = MEMTODEV, 140 - }, { 141 - .peri_id = (u8)DMACH_SPI0_RX, 142 - .rqtype = DEVTOMEM, 143 - }, { 144 - .peri_id = (u8)DMACH_SPI0_TX, 145 - .rqtype = MEMTODEV, 146 - }, { 147 - .peri_id = (u8)DMACH_SPI1_RX, 148 - .rqtype = DEVTOMEM, 149 - }, { 150 - .peri_id = (u8)DMACH_SPI1_TX, 151 - .rqtype = MEMTODEV, 152 - }, { 153 - .peri_id = (u8)DMACH_SPI2_RX, 154 - .rqtype = DEVTOMEM, 155 - }, { 156 - .peri_id = (u8)DMACH_SPI2_TX, 157 - .rqtype = MEMTODEV, 158 - }, { 159 - .peri_id = (u8)DMACH_PCM0_RX, 160 - .rqtype = DEVTOMEM, 161 - }, { 162 - .peri_id = (u8)DMACH_PCM1_TX, 163 - .rqtype = MEMTODEV, 164 - }, { 165 - .peri_id = (u8)DMACH_PCM1_RX, 166 - .rqtype = DEVTOMEM, 167 - }, { 168 - .peri_id = (u8)DMACH_PCM1_TX, 169 - .rqtype = MEMTODEV, 170 - }, { 171 - .peri_id = (u8)DMACH_MSM_REQ0, 172 - }, { 173 - .peri_id = (u8)DMACH_MSM_REQ1, 174 - }, { 175 - .peri_id = (u8)DMACH_MSM_REQ2, 176 - }, { 177 - .peri_id = (u8)DMACH_MSM_REQ3, 178 - }, 150 + u8 pdma1_peri[] = { 151 + DMACH_UART0_RX, 152 + DMACH_UART0_TX, 153 + DMACH_UART1_RX, 154 + DMACH_UART1_TX, 155 + DMACH_UART2_RX, 156 + DMACH_UART2_TX, 157 + DMACH_UART3_RX, 158 + DMACH_UART3_TX, 159 + DMACH_IRDA, 160 + DMACH_I2S0_RX, 161 + DMACH_I2S0_TX, 162 + DMACH_I2S0S_TX, 163 + DMACH_I2S1_RX, 164 + DMACH_I2S1_TX, 165 + DMACH_I2S2_RX, 166 + DMACH_I2S2_TX, 167 + DMACH_SPI0_RX, 168 + DMACH_SPI0_TX, 169 + DMACH_SPI1_RX, 170 + DMACH_SPI1_TX, 171 + DMACH_SPI2_RX, 172 + DMACH_SPI2_TX, 173 + DMACH_PCM0_RX, 174 + DMACH_PCM0_TX, 175 + DMACH_PCM1_RX, 176 + DMACH_PCM1_TX, 177 + DMACH_MSM_REQ0, 178 + DMACH_MSM_REQ1, 179 + DMACH_MSM_REQ2, 180 + DMACH_MSM_REQ3, 179 181 }; 180 182 181 183 struct dma_pl330_platdata s5pc100_pdma1_pdata = { 182 184 .nr_valid_peri = ARRAY_SIZE(pdma1_peri), 183 - .peri = pdma1_peri, 185 + .peri_id = pdma1_peri, 184 186 }; 185 187 186 188 struct amba_device s5pc100_device_pdma1 = { ··· 145 259 146 260 static int __init s5pc100_dma_init(void) 147 261 { 262 + dma_cap_set(DMA_SLAVE, s5pc100_pdma0_pdata.cap_mask); 263 + dma_cap_set(DMA_CYCLIC, s5pc100_pdma0_pdata.cap_mask); 148 264 amba_device_register(&s5pc100_device_pdma0, &iomem_resource); 265 + 266 + dma_cap_set(DMA_SLAVE, s5pc100_pdma1_pdata.cap_mask); 267 + dma_cap_set(DMA_CYCLIC, s5pc100_pdma1_pdata.cap_mask); 149 268 amba_device_register(&s5pc100_device_pdma1, &iomem_resource); 150 269 151 270 return 0;
+2
arch/arm/mach-s5pc100/include/mach/irqs.h
··· 97 97 #define IRQ_SDMFIQ S5P_IRQ_VIC2(31) 98 98 #define IRQ_VIC_END S5P_IRQ_VIC2(31) 99 99 100 + #define IRQ_TIMER_BASE (11) 101 + 100 102 #define S5P_EINT_BASE1 (S5P_IRQ_VIC0(0)) 101 103 #define S5P_EINT_BASE2 (IRQ_VIC_END + 1) 102 104
+67 -40
arch/arm/mach-s5pv210/clock.c
··· 810 810 .reg_div = { .reg = S5P_CLK_DIV6, .shift = 12, .size = 3 }, 811 811 }, { 812 812 .clk = { 813 - .name = "uclk1", 814 - .devname = "s5pv210-uart.0", 815 - .enable = s5pv210_clk_mask0_ctrl, 816 - .ctrlbit = (1 << 12), 817 - }, 818 - .sources = &clkset_uart, 819 - .reg_src = { .reg = S5P_CLK_SRC4, .shift = 16, .size = 4 }, 820 - .reg_div = { .reg = S5P_CLK_DIV4, .shift = 16, .size = 4 }, 821 - }, { 822 - .clk = { 823 - .name = "uclk1", 824 - .devname = "s5pv210-uart.1", 825 - .enable = s5pv210_clk_mask0_ctrl, 826 - .ctrlbit = (1 << 13), 827 - }, 828 - .sources = &clkset_uart, 829 - .reg_src = { .reg = S5P_CLK_SRC4, .shift = 20, .size = 4 }, 830 - .reg_div = { .reg = S5P_CLK_DIV4, .shift = 20, .size = 4 }, 831 - }, { 832 - .clk = { 833 - .name = "uclk1", 834 - .devname = "s5pv210-uart.2", 835 - .enable = s5pv210_clk_mask0_ctrl, 836 - .ctrlbit = (1 << 14), 837 - }, 838 - .sources = &clkset_uart, 839 - .reg_src = { .reg = S5P_CLK_SRC4, .shift = 24, .size = 4 }, 840 - .reg_div = { .reg = S5P_CLK_DIV4, .shift = 24, .size = 4 }, 841 - }, { 842 - .clk = { 843 - .name = "uclk1", 844 - .devname = "s5pv210-uart.3", 845 - .enable = s5pv210_clk_mask0_ctrl, 846 - .ctrlbit = (1 << 15), 847 - }, 848 - .sources = &clkset_uart, 849 - .reg_src = { .reg = S5P_CLK_SRC4, .shift = 28, .size = 4 }, 850 - .reg_div = { .reg = S5P_CLK_DIV4, .shift = 28, .size = 4 }, 851 - }, { 852 - .clk = { 853 813 .name = "sclk_fimc", 854 814 .devname = "s5pv210-fimc.0", 855 815 .enable = s5pv210_clk_mask1_ctrl, ··· 981 1021 .reg_src = { .reg = S5P_CLK_SRC5, .shift = 12, .size = 4 }, 982 1022 .reg_div = { .reg = S5P_CLK_DIV5, .shift = 12, .size = 4 }, 983 1023 }, 1024 + }; 1025 + 1026 + static struct clksrc_clk clk_sclk_uart0 = { 1027 + .clk = { 1028 + .name = "uclk1", 1029 + .devname = "s5pv210-uart.0", 1030 + .enable = s5pv210_clk_mask0_ctrl, 1031 + .ctrlbit = (1 << 12), 1032 + }, 1033 + .sources = &clkset_uart, 1034 + .reg_src = { .reg = S5P_CLK_SRC4, .shift = 16, .size = 4 }, 1035 + .reg_div = { .reg = S5P_CLK_DIV4, .shift = 16, .size = 4 }, 1036 + }; 1037 + 1038 + static struct clksrc_clk clk_sclk_uart1 = { 1039 + .clk = { 1040 + .name = "uclk1", 1041 + .devname = "s5pv210-uart.1", 1042 + .enable = s5pv210_clk_mask0_ctrl, 1043 + .ctrlbit = (1 << 13), 1044 + }, 1045 + .sources = &clkset_uart, 1046 + .reg_src = { .reg = S5P_CLK_SRC4, .shift = 20, .size = 4 }, 1047 + .reg_div = { .reg = S5P_CLK_DIV4, .shift = 20, .size = 4 }, 1048 + }; 1049 + 1050 + static struct clksrc_clk clk_sclk_uart2 = { 1051 + .clk = { 1052 + .name = "uclk1", 1053 + .devname = "s5pv210-uart.2", 1054 + .enable = s5pv210_clk_mask0_ctrl, 1055 + .ctrlbit = (1 << 14), 1056 + }, 1057 + .sources = &clkset_uart, 1058 + .reg_src = { .reg = S5P_CLK_SRC4, .shift = 24, .size = 4 }, 1059 + .reg_div = { .reg = S5P_CLK_DIV4, .shift = 24, .size = 4 }, 1060 + }; 1061 + 1062 + static struct clksrc_clk clk_sclk_uart3 = { 1063 + .clk = { 1064 + .name = "uclk1", 1065 + .devname = "s5pv210-uart.3", 1066 + .enable = s5pv210_clk_mask0_ctrl, 1067 + .ctrlbit = (1 << 15), 1068 + }, 1069 + .sources = &clkset_uart, 1070 + .reg_src = { .reg = S5P_CLK_SRC4, .shift = 28, .size = 4 }, 1071 + .reg_div = { .reg = S5P_CLK_DIV4, .shift = 28, .size = 4 }, 1072 + }; 1073 + 1074 + static struct clksrc_clk *clksrc_cdev[] = { 1075 + &clk_sclk_uart0, 1076 + &clk_sclk_uart1, 1077 + &clk_sclk_uart2, 1078 + &clk_sclk_uart3, 984 1079 }; 985 1080 986 1081 /* Clock initialisation code */ ··· 1277 1262 &clk_pcmcdclk2, 1278 1263 }; 1279 1264 1265 + static struct clk_lookup s5pv210_clk_lookup[] = { 1266 + CLKDEV_INIT(NULL, "clk_uart_baud0", &clk_p), 1267 + CLKDEV_INIT("s5pv210-uart.0", "clk_uart_baud1", &clk_sclk_uart0.clk), 1268 + CLKDEV_INIT("s5pv210-uart.1", "clk_uart_baud1", &clk_sclk_uart1.clk), 1269 + CLKDEV_INIT("s5pv210-uart.2", "clk_uart_baud1", &clk_sclk_uart2.clk), 1270 + CLKDEV_INIT("s5pv210-uart.3", "clk_uart_baud1", &clk_sclk_uart3.clk), 1271 + }; 1272 + 1280 1273 void __init s5pv210_register_clocks(void) 1281 1274 { 1282 1275 int ptr; ··· 1297 1274 for (ptr = 0; ptr < ARRAY_SIZE(sclk_tv); ptr++) 1298 1275 s3c_register_clksrc(sclk_tv[ptr], 1); 1299 1276 1277 + for (ptr = 0; ptr < ARRAY_SIZE(clksrc_cdev); ptr++) 1278 + s3c_register_clksrc(clksrc_cdev[ptr], 1); 1279 + 1300 1280 s3c_register_clksrc(clksrcs, ARRAY_SIZE(clksrcs)); 1301 1281 s3c_register_clocks(init_clocks, ARRAY_SIZE(init_clocks)); 1302 1282 1303 1283 s3c_register_clocks(init_clocks_off, ARRAY_SIZE(init_clocks_off)); 1304 1284 s3c_disable_clocks(init_clocks_off, ARRAY_SIZE(init_clocks_off)); 1285 + clkdev_add_table(s5pv210_clk_lookup, ARRAY_SIZE(s5pv210_clk_lookup)); 1305 1286 1306 1287 s3c24xx_register_clock(&dummy_apb_pclk); 1307 1288 s3c_pwmclk_init();
-19
arch/arm/mach-s5pv210/common.c
··· 254 254 return device_register(&s5pv210_dev); 255 255 } 256 256 257 - static struct s3c24xx_uart_clksrc s5pv210_serial_clocks[] = { 258 - [0] = { 259 - .name = "pclk", 260 - .divisor = 1, 261 - .min_baud = 0, 262 - .max_baud = 0, 263 - }, 264 - }; 265 - 266 257 /* uart registration process */ 267 258 268 259 void __init s5pv210_init_uarts(struct s3c2410_uartcfg *cfg, int no) 269 260 { 270 - struct s3c2410_uartcfg *tcfg = cfg; 271 - u32 ucnt; 272 - 273 - for (ucnt = 0; ucnt < no; ucnt++, tcfg++) { 274 - if (!tcfg->clocks) { 275 - tcfg->clocks = s5pv210_serial_clocks; 276 - tcfg->clocks_size = ARRAY_SIZE(s5pv210_serial_clocks); 277 - } 278 - } 279 - 280 261 s3c24xx_init_uartdevs("s5pv210-uart", s5p_uart_resources, cfg, no); 281 262 }
+69 -172
arch/arm/mach-s5pv210/dma.c
··· 35 35 36 36 static u64 dma_dmamask = DMA_BIT_MASK(32); 37 37 38 - struct dma_pl330_peri pdma0_peri[28] = { 39 - { 40 - .peri_id = (u8)DMACH_UART0_RX, 41 - .rqtype = DEVTOMEM, 42 - }, { 43 - .peri_id = (u8)DMACH_UART0_TX, 44 - .rqtype = MEMTODEV, 45 - }, { 46 - .peri_id = (u8)DMACH_UART1_RX, 47 - .rqtype = DEVTOMEM, 48 - }, { 49 - .peri_id = (u8)DMACH_UART1_TX, 50 - .rqtype = MEMTODEV, 51 - }, { 52 - .peri_id = (u8)DMACH_UART2_RX, 53 - .rqtype = DEVTOMEM, 54 - }, { 55 - .peri_id = (u8)DMACH_UART2_TX, 56 - .rqtype = MEMTODEV, 57 - }, { 58 - .peri_id = (u8)DMACH_UART3_RX, 59 - .rqtype = DEVTOMEM, 60 - }, { 61 - .peri_id = (u8)DMACH_UART3_TX, 62 - .rqtype = MEMTODEV, 63 - }, { 64 - .peri_id = DMACH_MAX, 65 - }, { 66 - .peri_id = (u8)DMACH_I2S0_RX, 67 - .rqtype = DEVTOMEM, 68 - }, { 69 - .peri_id = (u8)DMACH_I2S0_TX, 70 - .rqtype = MEMTODEV, 71 - }, { 72 - .peri_id = (u8)DMACH_I2S0S_TX, 73 - .rqtype = MEMTODEV, 74 - }, { 75 - .peri_id = (u8)DMACH_I2S1_RX, 76 - .rqtype = DEVTOMEM, 77 - }, { 78 - .peri_id = (u8)DMACH_I2S1_TX, 79 - .rqtype = MEMTODEV, 80 - }, { 81 - .peri_id = (u8)DMACH_MAX, 82 - }, { 83 - .peri_id = (u8)DMACH_MAX, 84 - }, { 85 - .peri_id = (u8)DMACH_SPI0_RX, 86 - .rqtype = DEVTOMEM, 87 - }, { 88 - .peri_id = (u8)DMACH_SPI0_TX, 89 - .rqtype = MEMTODEV, 90 - }, { 91 - .peri_id = (u8)DMACH_SPI1_RX, 92 - .rqtype = DEVTOMEM, 93 - }, { 94 - .peri_id = (u8)DMACH_SPI1_TX, 95 - .rqtype = MEMTODEV, 96 - }, { 97 - .peri_id = (u8)DMACH_MAX, 98 - }, { 99 - .peri_id = (u8)DMACH_MAX, 100 - }, { 101 - .peri_id = (u8)DMACH_AC97_MICIN, 102 - .rqtype = DEVTOMEM, 103 - }, { 104 - .peri_id = (u8)DMACH_AC97_PCMIN, 105 - .rqtype = DEVTOMEM, 106 - }, { 107 - .peri_id = (u8)DMACH_AC97_PCMOUT, 108 - .rqtype = MEMTODEV, 109 - }, { 110 - .peri_id = (u8)DMACH_MAX, 111 - }, { 112 - .peri_id = (u8)DMACH_PWM, 113 - }, { 114 - .peri_id = (u8)DMACH_SPDIF, 115 - .rqtype = MEMTODEV, 116 - }, 38 + u8 pdma0_peri[] = { 39 + DMACH_UART0_RX, 40 + DMACH_UART0_TX, 41 + DMACH_UART1_RX, 42 + DMACH_UART1_TX, 43 + DMACH_UART2_RX, 44 + DMACH_UART2_TX, 45 + DMACH_UART3_RX, 46 + DMACH_UART3_TX, 47 + DMACH_MAX, 48 + DMACH_I2S0_RX, 49 + DMACH_I2S0_TX, 50 + DMACH_I2S0S_TX, 51 + DMACH_I2S1_RX, 52 + DMACH_I2S1_TX, 53 + DMACH_MAX, 54 + DMACH_MAX, 55 + DMACH_SPI0_RX, 56 + DMACH_SPI0_TX, 57 + DMACH_SPI1_RX, 58 + DMACH_SPI1_TX, 59 + DMACH_MAX, 60 + DMACH_MAX, 61 + DMACH_AC97_MICIN, 62 + DMACH_AC97_PCMIN, 63 + DMACH_AC97_PCMOUT, 64 + DMACH_MAX, 65 + DMACH_PWM, 66 + DMACH_SPDIF, 117 67 }; 118 68 119 69 struct dma_pl330_platdata s5pv210_pdma0_pdata = { 120 70 .nr_valid_peri = ARRAY_SIZE(pdma0_peri), 121 - .peri = pdma0_peri, 71 + .peri_id = pdma0_peri, 122 72 }; 123 73 124 74 struct amba_device s5pv210_device_pdma0 = { ··· 87 137 .periphid = 0x00041330, 88 138 }; 89 139 90 - struct dma_pl330_peri pdma1_peri[32] = { 91 - { 92 - .peri_id = (u8)DMACH_UART0_RX, 93 - .rqtype = DEVTOMEM, 94 - }, { 95 - .peri_id = (u8)DMACH_UART0_TX, 96 - .rqtype = MEMTODEV, 97 - }, { 98 - .peri_id = (u8)DMACH_UART1_RX, 99 - .rqtype = DEVTOMEM, 100 - }, { 101 - .peri_id = (u8)DMACH_UART1_TX, 102 - .rqtype = MEMTODEV, 103 - }, { 104 - .peri_id = (u8)DMACH_UART2_RX, 105 - .rqtype = DEVTOMEM, 106 - }, { 107 - .peri_id = (u8)DMACH_UART2_TX, 108 - .rqtype = MEMTODEV, 109 - }, { 110 - .peri_id = (u8)DMACH_UART3_RX, 111 - .rqtype = DEVTOMEM, 112 - }, { 113 - .peri_id = (u8)DMACH_UART3_TX, 114 - .rqtype = MEMTODEV, 115 - }, { 116 - .peri_id = DMACH_MAX, 117 - }, { 118 - .peri_id = (u8)DMACH_I2S0_RX, 119 - .rqtype = DEVTOMEM, 120 - }, { 121 - .peri_id = (u8)DMACH_I2S0_TX, 122 - .rqtype = MEMTODEV, 123 - }, { 124 - .peri_id = (u8)DMACH_I2S0S_TX, 125 - .rqtype = MEMTODEV, 126 - }, { 127 - .peri_id = (u8)DMACH_I2S1_RX, 128 - .rqtype = DEVTOMEM, 129 - }, { 130 - .peri_id = (u8)DMACH_I2S1_TX, 131 - .rqtype = MEMTODEV, 132 - }, { 133 - .peri_id = (u8)DMACH_I2S2_RX, 134 - .rqtype = DEVTOMEM, 135 - }, { 136 - .peri_id = (u8)DMACH_I2S2_TX, 137 - .rqtype = MEMTODEV, 138 - }, { 139 - .peri_id = (u8)DMACH_SPI0_RX, 140 - .rqtype = DEVTOMEM, 141 - }, { 142 - .peri_id = (u8)DMACH_SPI0_TX, 143 - .rqtype = MEMTODEV, 144 - }, { 145 - .peri_id = (u8)DMACH_SPI1_RX, 146 - .rqtype = DEVTOMEM, 147 - }, { 148 - .peri_id = (u8)DMACH_SPI1_TX, 149 - .rqtype = MEMTODEV, 150 - }, { 151 - .peri_id = (u8)DMACH_MAX, 152 - }, { 153 - .peri_id = (u8)DMACH_MAX, 154 - }, { 155 - .peri_id = (u8)DMACH_PCM0_RX, 156 - .rqtype = DEVTOMEM, 157 - }, { 158 - .peri_id = (u8)DMACH_PCM0_TX, 159 - .rqtype = MEMTODEV, 160 - }, { 161 - .peri_id = (u8)DMACH_PCM1_RX, 162 - .rqtype = DEVTOMEM, 163 - }, { 164 - .peri_id = (u8)DMACH_PCM1_TX, 165 - .rqtype = MEMTODEV, 166 - }, { 167 - .peri_id = (u8)DMACH_MSM_REQ0, 168 - }, { 169 - .peri_id = (u8)DMACH_MSM_REQ1, 170 - }, { 171 - .peri_id = (u8)DMACH_MSM_REQ2, 172 - }, { 173 - .peri_id = (u8)DMACH_MSM_REQ3, 174 - }, { 175 - .peri_id = (u8)DMACH_PCM2_RX, 176 - .rqtype = DEVTOMEM, 177 - }, { 178 - .peri_id = (u8)DMACH_PCM2_TX, 179 - .rqtype = MEMTODEV, 180 - }, 140 + u8 pdma1_peri[] = { 141 + DMACH_UART0_RX, 142 + DMACH_UART0_TX, 143 + DMACH_UART1_RX, 144 + DMACH_UART1_TX, 145 + DMACH_UART2_RX, 146 + DMACH_UART2_TX, 147 + DMACH_UART3_RX, 148 + DMACH_UART3_TX, 149 + DMACH_MAX, 150 + DMACH_I2S0_RX, 151 + DMACH_I2S0_TX, 152 + DMACH_I2S0S_TX, 153 + DMACH_I2S1_RX, 154 + DMACH_I2S1_TX, 155 + DMACH_I2S2_RX, 156 + DMACH_I2S2_TX, 157 + DMACH_SPI0_RX, 158 + DMACH_SPI0_TX, 159 + DMACH_SPI1_RX, 160 + DMACH_SPI1_TX, 161 + DMACH_MAX, 162 + DMACH_MAX, 163 + DMACH_PCM0_RX, 164 + DMACH_PCM0_TX, 165 + DMACH_PCM1_RX, 166 + DMACH_PCM1_TX, 167 + DMACH_MSM_REQ0, 168 + DMACH_MSM_REQ1, 169 + DMACH_MSM_REQ2, 170 + DMACH_MSM_REQ3, 171 + DMACH_PCM2_RX, 172 + DMACH_PCM2_TX, 181 173 }; 182 174 183 175 struct dma_pl330_platdata s5pv210_pdma1_pdata = { 184 176 .nr_valid_peri = ARRAY_SIZE(pdma1_peri), 185 - .peri = pdma1_peri, 177 + .peri_id = pdma1_peri, 186 178 }; 187 179 188 180 struct amba_device s5pv210_device_pdma1 = { ··· 145 253 146 254 static int __init s5pv210_dma_init(void) 147 255 { 256 + dma_cap_set(DMA_SLAVE, s5pv210_pdma0_pdata.cap_mask); 257 + dma_cap_set(DMA_CYCLIC, s5pv210_pdma0_pdata.cap_mask); 148 258 amba_device_register(&s5pv210_device_pdma0, &iomem_resource); 259 + 260 + dma_cap_set(DMA_SLAVE, s5pv210_pdma1_pdata.cap_mask); 261 + dma_cap_set(DMA_CYCLIC, s5pv210_pdma1_pdata.cap_mask); 149 262 amba_device_register(&s5pv210_device_pdma1, &iomem_resource); 150 263 151 264 return 0;
+2
arch/arm/mach-s5pv210/include/mach/irqs.h
··· 118 118 #define IRQ_MDNIE3 S5P_IRQ_VIC3(8) 119 119 #define IRQ_VIC_END S5P_IRQ_VIC3(31) 120 120 121 + #define IRQ_TIMER_BASE (11) 122 + 121 123 #define S5P_EINT_BASE1 (S5P_IRQ_VIC0(0)) 122 124 #define S5P_EINT_BASE2 (IRQ_VIC_END + 1) 123 125
+2
arch/arm/mach-tegra/Makefile
··· 32 32 obj-$(CONFIG_MACH_TEGRA_DT) += board-dt.o 33 33 obj-$(CONFIG_MACH_TEGRA_DT) += board-harmony-pinmux.o 34 34 obj-$(CONFIG_MACH_TEGRA_DT) += board-seaboard-pinmux.o 35 + obj-$(CONFIG_MACH_TEGRA_DT) += board-paz00-pinmux.o 36 + obj-$(CONFIG_MACH_TEGRA_DT) += board-trimslice-pinmux.o 35 37 36 38 obj-$(CONFIG_MACH_TRIMSLICE) += board-trimslice.o 37 39 obj-$(CONFIG_MACH_TRIMSLICE) += board-trimslice-pinmux.o
+2
arch/arm/mach-tegra/Makefile.boot
··· 3 3 initrd_phys-$(CONFIG_ARCH_TEGRA_2x_SOC) := 0x00800000 4 4 5 5 dtb-$(CONFIG_MACH_HARMONY) += tegra-harmony.dtb 6 + dtb-$(CONFIG_MACH_PAZ00) += tegra-paz00.dtb 6 7 dtb-$(CONFIG_MACH_SEABOARD) += tegra-seaboard.dtb 8 + dtb-$(CONFIG_MACH_TRIMSLICE) += tegra-trimslice.dtb 7 9 dtb-$(CONFIG_MACH_VENTANA) += tegra-ventana.dtb
+35 -14
arch/arm/mach-tegra/board-dt.c
··· 37 37 #include <asm/mach/arch.h> 38 38 #include <asm/mach/time.h> 39 39 #include <asm/setup.h> 40 + #include <asm/hardware/gic.h> 40 41 41 42 #include <mach/iomap.h> 42 43 #include <mach/irqs.h> ··· 48 47 #include "devices.h" 49 48 50 49 void harmony_pinmux_init(void); 50 + void paz00_pinmux_init(void); 51 51 void seaboard_pinmux_init(void); 52 + void trimslice_pinmux_init(void); 52 53 void ventana_pinmux_init(void); 54 + 55 + static const struct of_device_id tegra_dt_irq_match[] __initconst = { 56 + { .compatible = "arm,cortex-a9-gic", .data = gic_of_init }, 57 + { } 58 + }; 59 + 60 + void __init tegra_dt_init_irq(void) 61 + { 62 + tegra_init_irq(); 63 + of_irq_init(tegra_dt_irq_match); 64 + } 53 65 54 66 struct of_dev_auxdata tegra20_auxdata_lookup[] __initdata = { 55 67 OF_DEV_AUXDATA("nvidia,tegra20-sdhci", TEGRA_SDMMC1_BASE, "sdhci-tegra.0", NULL), ··· 72 58 OF_DEV_AUXDATA("nvidia,tegra20-i2c", TEGRA_I2C_BASE, "tegra-i2c.0", NULL), 73 59 OF_DEV_AUXDATA("nvidia,tegra20-i2c", TEGRA_I2C2_BASE, "tegra-i2c.1", NULL), 74 60 OF_DEV_AUXDATA("nvidia,tegra20-i2c", TEGRA_I2C3_BASE, "tegra-i2c.2", NULL), 75 - OF_DEV_AUXDATA("nvidia,tegra20-i2c", TEGRA_DVC_BASE, "tegra-i2c.3", NULL), 61 + OF_DEV_AUXDATA("nvidia,tegra20-i2c-dvc", TEGRA_DVC_BASE, "tegra-i2c.3", NULL), 76 62 OF_DEV_AUXDATA("nvidia,tegra20-i2s", TEGRA_I2S1_BASE, "tegra-i2s.0", NULL), 77 - OF_DEV_AUXDATA("nvidia,tegra20-i2s", TEGRA_I2S1_BASE, "tegra-i2s.1", NULL), 63 + OF_DEV_AUXDATA("nvidia,tegra20-i2s", TEGRA_I2S2_BASE, "tegra-i2s.1", NULL), 78 64 OF_DEV_AUXDATA("nvidia,tegra20-das", TEGRA_APB_MISC_DAS_BASE, "tegra-das", NULL), 65 + OF_DEV_AUXDATA("nvidia,tegra20-ehci", TEGRA_USB_BASE, "tegra-ehci.0", 66 + &tegra_ehci1_device.dev.platform_data), 67 + OF_DEV_AUXDATA("nvidia,tegra20-ehci", TEGRA_USB2_BASE, "tegra-ehci.1", 68 + &tegra_ehci2_device.dev.platform_data), 69 + OF_DEV_AUXDATA("nvidia,tegra20-ehci", TEGRA_USB3_BASE, "tegra-ehci.2", 70 + &tegra_ehci3_device.dev.platform_data), 79 71 {} 80 72 }; 81 73 82 74 static __initdata struct tegra_clk_init_table tegra_dt_clk_init_table[] = { 83 75 /* name parent rate enabled */ 84 76 { "uartd", "pll_p", 216000000, true }, 77 + { "usbd", "clk_m", 12000000, false }, 78 + { "usb2", "clk_m", 12000000, false }, 79 + { "usb3", "clk_m", 12000000, false }, 80 + { "pll_a", "pll_p_out1", 56448000, true }, 81 + { "pll_a_out0", "pll_a", 11289600, true }, 82 + { "cdev1", NULL, 0, true }, 83 + { "i2s1", "pll_a_out0", 11289600, false}, 84 + { "i2s2", "pll_a_out0", 11289600, false}, 85 85 { NULL, NULL, 0, 0}, 86 86 }; 87 87 ··· 104 76 {} 105 77 }; 106 78 107 - static struct of_device_id tegra_dt_gic_match[] __initdata = { 108 - { .compatible = "nvidia,tegra20-gic", }, 109 - {} 110 - }; 111 - 112 79 static struct { 113 80 char *machine; 114 81 void (*init)(void); 115 82 } pinmux_configs[] = { 83 + { "compulab,trimslice", trimslice_pinmux_init }, 116 84 { "nvidia,harmony", harmony_pinmux_init }, 85 + { "compal,paz00", paz00_pinmux_init }, 117 86 { "nvidia,seaboard", seaboard_pinmux_init }, 118 87 { "nvidia,ventana", ventana_pinmux_init }, 119 88 }; 120 89 121 90 static void __init tegra_dt_init(void) 122 91 { 123 - struct device_node *node; 124 92 int i; 125 - 126 - node = of_find_matching_node_by_address(NULL, tegra_dt_gic_match, 127 - TEGRA_ARM_INT_DIST_BASE); 128 - if (node) 129 - irq_domain_add_simple(node, INT_GIC_BASE); 130 93 131 94 tegra_clk_init_from_table(tegra_dt_clk_init_table); 132 95 ··· 140 121 } 141 122 142 123 static const char * tegra_dt_board_compat[] = { 124 + "compulab,trimslice", 143 125 "nvidia,harmony", 126 + "compal,paz00", 144 127 "nvidia,seaboard", 145 128 "nvidia,ventana", 146 129 NULL ··· 151 130 DT_MACHINE_START(TEGRA_DT, "nVidia Tegra (Flattened Device Tree)") 152 131 .map_io = tegra_map_common_io, 153 132 .init_early = tegra_init_early, 154 - .init_irq = tegra_init_irq, 133 + .init_irq = tegra_dt_init_irq, 155 134 .handle_irq = gic_handle_irq, 156 135 .timer = &tegra_timer, 157 136 .init_machine = tegra_dt_init,
+8 -2
arch/arm/mach-tegra/irq.c
··· 21 21 #include <linux/interrupt.h> 22 22 #include <linux/irq.h> 23 23 #include <linux/io.h> 24 + #include <linux/of.h> 24 25 25 26 #include <asm/hardware/gic.h> 26 27 ··· 126 125 gic_arch_extn.irq_unmask = tegra_unmask; 127 126 gic_arch_extn.irq_retrigger = tegra_retrigger; 128 127 129 - gic_init(0, 29, IO_ADDRESS(TEGRA_ARM_INT_DIST_BASE), 130 - IO_ADDRESS(TEGRA_ARM_PERIF_BASE + 0x100)); 128 + /* 129 + * Check if there is a devicetree present, since the GIC will be 130 + * initialized elsewhere under DT. 131 + */ 132 + if (!of_have_populated_dt()) 133 + gic_init(0, 29, IO_ADDRESS(TEGRA_ARM_INT_DIST_BASE), 134 + IO_ADDRESS(TEGRA_ARM_PERIF_BASE + 0x100)); 131 135 }
+16 -7
arch/arm/plat-s3c24xx/s3c2443-clock.c
··· 297 297 298 298 static struct clksrc_clk clksrc_clks[] = { 299 299 { 300 - /* ART baud-rate clock sourced from esysclk via a divisor */ 301 - .clk = { 302 - .name = "uartclk", 303 - .parent = &clk_esysclk.clk, 304 - }, 305 - .reg_div = { .reg = S3C2443_CLKDIV1, .size = 4, .shift = 8 }, 306 - }, { 307 300 /* camera interface bus-clock, divided down from esysclk */ 308 301 .clk = { 309 302 .name = "camif-upll", /* same as 2440 name */ ··· 314 321 }, 315 322 .reg_div = { .reg = S3C2443_CLKDIV1, .size = 8, .shift = 16 }, 316 323 }, 324 + }; 325 + 326 + static struct clksrc_clk clk_esys_uart = { 327 + /* ART baud-rate clock sourced from esysclk via a divisor */ 328 + .clk = { 329 + .name = "uartclk", 330 + .parent = &clk_esysclk.clk, 331 + }, 332 + .reg_div = { .reg = S3C2443_CLKDIV1, .size = 4, .shift = 8 }, 317 333 }; 318 334 319 335 static struct clk clk_i2s_ext = { ··· 591 589 &clk_arm, 592 590 }; 593 591 592 + static struct clk_lookup s3c2443_clk_lookup[] = { 593 + CLKDEV_INIT(NULL, "clk_uart_baud1", &s3c24xx_uclk), 594 + CLKDEV_INIT(NULL, "clk_uart_baud2", &clk_p), 595 + CLKDEV_INIT(NULL, "clk_uart_baud3", &clk_esys_uart.clk), 596 + }; 597 + 594 598 void __init s3c2443_common_init_clocks(int xtal, pll_fn get_mpll, 595 599 unsigned int *divs, int nr_divs, 596 600 int divmask) ··· 626 618 /* See s3c2443/etc notes on disabling clocks at init time */ 627 619 s3c_register_clocks(init_clocks_off, ARRAY_SIZE(init_clocks_off)); 628 620 s3c_disable_clocks(init_clocks_off, ARRAY_SIZE(init_clocks_off)); 621 + clkdev_add_table(s3c2443_clk_lookup, ARRAY_SIZE(s3c2443_clk_lookup)); 629 622 630 623 s3c2443_common_setup_clocks(get_mpll); 631 624 }
+8 -7
arch/arm/plat-samsung/dma-ops.c
··· 18 18 19 19 #include <mach/dma.h> 20 20 21 - static inline bool pl330_filter(struct dma_chan *chan, void *param) 22 - { 23 - struct dma_pl330_peri *peri = chan->private; 24 - return peri->peri_id == (unsigned)param; 25 - } 26 - 27 21 static unsigned samsung_dmadev_request(enum dma_ch dma_ch, 28 22 struct samsung_dma_info *info) 29 23 { 30 24 struct dma_chan *chan; 31 25 dma_cap_mask_t mask; 32 26 struct dma_slave_config slave_config; 27 + void *filter_param; 33 28 34 29 dma_cap_zero(mask); 35 30 dma_cap_set(info->cap, mask); 36 31 37 - chan = dma_request_channel(mask, pl330_filter, (void *)dma_ch); 32 + /* 33 + * If a dma channel property of a device node from device tree is 34 + * specified, use that as the fliter parameter. 35 + */ 36 + filter_param = (dma_ch == DMACH_DT_PROP) ? (void *)info->dt_dmach_prop : 37 + (void *)dma_ch; 38 + chan = dma_request_channel(mask, pl330_filter, filter_param); 38 39 39 40 if (info->direction == DMA_FROM_DEVICE) { 40 41 memset(&slave_config, 0, sizeof(struct dma_slave_config));
+1
arch/arm/plat-samsung/include/plat/dma-ops.h
··· 31 31 enum dma_slave_buswidth width; 32 32 dma_addr_t fifo; 33 33 struct s3c2410_dma_client *client; 34 + struct property *dt_dmach_prop; 34 35 }; 35 36 36 37 struct samsung_dma_ops {
+2 -1
arch/arm/plat-samsung/include/plat/dma-pl330.h
··· 21 21 * use these just as IDs. 22 22 */ 23 23 enum dma_ch { 24 - DMACH_UART0_RX, 24 + DMACH_DT_PROP = -1, 25 + DMACH_UART0_RX = 0, 25 26 DMACH_UART0_TX, 26 27 DMACH_UART1_RX, 27 28 DMACH_UART1_TX,
+2 -1
arch/arm/plat-samsung/include/plat/irqs.h
··· 44 44 #define S5P_IRQ_VIC2(x) (S5P_VIC2_BASE + (x)) 45 45 #define S5P_IRQ_VIC3(x) (S5P_VIC3_BASE + (x)) 46 46 47 - #define S5P_TIMER_IRQ(x) (11 + (x)) 47 + #define S5P_TIMER_IRQ(x) (IRQ_TIMER_BASE + (x)) 48 48 49 49 #define IRQ_TIMER0 S5P_TIMER_IRQ(0) 50 50 #define IRQ_TIMER1 S5P_TIMER_IRQ(1) 51 51 #define IRQ_TIMER2 S5P_TIMER_IRQ(2) 52 52 #define IRQ_TIMER3 S5P_TIMER_IRQ(3) 53 53 #define IRQ_TIMER4 S5P_TIMER_IRQ(4) 54 + #define IRQ_TIMER_COUNT (5) 54 55 55 56 #define IRQ_EINT(x) ((x) < 16 ? ((x) + S5P_EINT_BASE1) \ 56 57 : ((x) - 16 + S5P_EINT_BASE2))
+23 -24
arch/arm/plat-samsung/include/plat/regs-serial.h
··· 71 71 #define S3C2410_LCON_IRM (1<<6) 72 72 73 73 #define S3C2440_UCON_CLKMASK (3<<10) 74 + #define S3C2440_UCON_CLKSHIFT (10) 74 75 #define S3C2440_UCON_PCLK (0<<10) 75 76 #define S3C2440_UCON_UCLK (1<<10) 76 77 #define S3C2440_UCON_PCLK2 (2<<10) ··· 79 78 #define S3C2443_UCON_EPLL (3<<10) 80 79 81 80 #define S3C6400_UCON_CLKMASK (3<<10) 81 + #define S3C6400_UCON_CLKSHIFT (10) 82 82 #define S3C6400_UCON_PCLK (0<<10) 83 83 #define S3C6400_UCON_PCLK2 (2<<10) 84 84 #define S3C6400_UCON_UCLK0 (1<<10) ··· 92 90 #define S3C2440_UCON_DIVSHIFT (12) 93 91 94 92 #define S3C2412_UCON_CLKMASK (3<<10) 93 + #define S3C2412_UCON_CLKSHIFT (10) 95 94 #define S3C2412_UCON_UCLK (1<<10) 96 95 #define S3C2412_UCON_USYSCLK (3<<10) 97 96 #define S3C2412_UCON_PCLK (0<<10) 98 97 #define S3C2412_UCON_PCLK2 (2<<10) 99 98 99 + #define S3C2410_UCON_CLKMASK (1 << 10) 100 + #define S3C2410_UCON_CLKSHIFT (10) 100 101 #define S3C2410_UCON_UCLK (1<<10) 101 102 #define S3C2410_UCON_SBREAK (1<<4) 102 103 ··· 198 193 199 194 /* Following are specific to S5PV210 */ 200 195 #define S5PV210_UCON_CLKMASK (1<<10) 196 + #define S5PV210_UCON_CLKSHIFT (10) 201 197 #define S5PV210_UCON_PCLK (0<<10) 202 198 #define S5PV210_UCON_UCLK (1<<10) 203 199 ··· 227 221 #define S5PV210_UFSTAT_RXMASK (255<<0) 228 222 #define S5PV210_UFSTAT_RXSHIFT (0) 229 223 230 - #define NO_NEED_CHECK_CLKSRC 1 224 + #define S3C2410_UCON_CLKSEL0 (1 << 0) 225 + #define S3C2410_UCON_CLKSEL1 (1 << 1) 226 + #define S3C2410_UCON_CLKSEL2 (1 << 2) 227 + #define S3C2410_UCON_CLKSEL3 (1 << 3) 228 + 229 + /* Default values for s5pv210 UCON and UFCON uart registers */ 230 + #define S5PV210_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \ 231 + S3C2410_UCON_RXILEVEL | \ 232 + S3C2410_UCON_TXIRQMODE | \ 233 + S3C2410_UCON_RXIRQMODE | \ 234 + S3C2410_UCON_RXFIFO_TOI | \ 235 + S3C2443_UCON_RXERR_IRQEN) 236 + 237 + #define S5PV210_UFCON_DEFAULT (S3C2410_UFCON_FIFOMODE | \ 238 + S5PV210_UFCON_TXTRIG4 | \ 239 + S5PV210_UFCON_RXTRIG4) 231 240 232 241 #ifndef __ASSEMBLY__ 233 - 234 - /* struct s3c24xx_uart_clksrc 235 - * 236 - * this structure defines a named clock source that can be used for the 237 - * uart, so that the best clock can be selected for the requested baud 238 - * rate. 239 - * 240 - * min_baud and max_baud define the range of baud-rates this clock is 241 - * acceptable for, if they are both zero, it is assumed any baud rate that 242 - * can be generated from this clock will be used. 243 - * 244 - * divisor gives the divisor from the clock to the one seen by the uart 245 - */ 246 - 247 - struct s3c24xx_uart_clksrc { 248 - const char *name; 249 - unsigned int divisor; 250 - unsigned int min_baud; 251 - unsigned int max_baud; 252 - }; 253 242 254 243 /* configuration structure for per-machine configurations for the 255 244 * serial port ··· 258 257 unsigned char unused; 259 258 unsigned short flags; 260 259 upf_t uart_flags; /* default uart flags */ 260 + unsigned int clk_sel; 261 261 262 262 unsigned int has_fracval; 263 263 264 264 unsigned long ucon; /* value of ucon for port */ 265 265 unsigned long ulcon; /* value of ulcon for port */ 266 266 unsigned long ufcon; /* value of ufcon for port */ 267 - 268 - struct s3c24xx_uart_clksrc *clocks; 269 - unsigned int clocks_size; 270 267 }; 271 268 272 269 /* s3c24xx_uart_devs
+53 -46
drivers/dma/pl330.c
··· 19 19 #include <linux/amba/pl330.h> 20 20 #include <linux/pm_runtime.h> 21 21 #include <linux/scatterlist.h> 22 + #include <linux/of.h> 22 23 23 24 #define NR_DEFAULT_DESC 16 24 25 ··· 116 115 /* The channel which currently holds this desc */ 117 116 struct dma_pl330_chan *pchan; 118 117 }; 118 + 119 + /* forward declaration */ 120 + static struct amba_driver pl330_driver; 119 121 120 122 static inline struct dma_pl330_chan * 121 123 to_pchan(struct dma_chan *ch) ··· 270 266 271 267 tasklet_schedule(&pch->task); 272 268 } 269 + 270 + bool pl330_filter(struct dma_chan *chan, void *param) 271 + { 272 + u8 *peri_id; 273 + 274 + if (chan->device->dev->driver != &pl330_driver.drv) 275 + return false; 276 + 277 + #ifdef CONFIG_OF 278 + if (chan->device->dev->of_node) { 279 + const __be32 *prop_value; 280 + phandle phandle; 281 + struct device_node *node; 282 + 283 + prop_value = ((struct property *)param)->value; 284 + phandle = be32_to_cpup(prop_value++); 285 + node = of_find_node_by_phandle(phandle); 286 + return ((chan->private == node) && 287 + (chan->chan_id == be32_to_cpup(prop_value))); 288 + } 289 + #endif 290 + 291 + peri_id = chan->private; 292 + return *peri_id == (unsigned)param; 293 + } 294 + EXPORT_SYMBOL(pl330_filter); 273 295 274 296 static int pl330_alloc_chan_resources(struct dma_chan *chan) 275 297 { ··· 527 497 static struct dma_pl330_desc *pl330_get_desc(struct dma_pl330_chan *pch) 528 498 { 529 499 struct dma_pl330_dmac *pdmac = pch->dmac; 530 - struct dma_pl330_peri *peri = pch->chan.private; 500 + u8 *peri_id = pch->chan.private; 531 501 struct dma_pl330_desc *desc; 532 502 533 503 /* Pluck one desc from the pool of DMAC */ ··· 552 522 desc->txd.cookie = 0; 553 523 async_tx_ack(&desc->txd); 554 524 555 - if (peri) { 556 - desc->req.rqtype = peri->rqtype; 557 - desc->req.peri = pch->chan.chan_id; 558 - } else { 559 - desc->req.rqtype = MEMTOMEM; 560 - desc->req.peri = 0; 561 - } 525 + desc->req.peri = peri_id ? pch->chan.chan_id : 0; 562 526 563 527 dma_async_tx_descriptor_init(&desc->txd, &pch->chan); 564 528 ··· 639 615 case DMA_TO_DEVICE: 640 616 desc->rqcfg.src_inc = 1; 641 617 desc->rqcfg.dst_inc = 0; 618 + desc->req.rqtype = MEMTODEV; 642 619 src = dma_addr; 643 620 dst = pch->fifo_addr; 644 621 break; 645 622 case DMA_FROM_DEVICE: 646 623 desc->rqcfg.src_inc = 0; 647 624 desc->rqcfg.dst_inc = 1; 625 + desc->req.rqtype = DEVTOMEM; 648 626 src = pch->fifo_addr; 649 627 dst = dma_addr; 650 628 break; ··· 672 646 { 673 647 struct dma_pl330_desc *desc; 674 648 struct dma_pl330_chan *pch = to_pchan(chan); 675 - struct dma_pl330_peri *peri = chan->private; 676 649 struct pl330_info *pi; 677 650 int burst; 678 651 679 652 if (unlikely(!pch || !len)) 680 - return NULL; 681 - 682 - if (peri && peri->rqtype != MEMTOMEM) 683 653 return NULL; 684 654 685 655 pi = &pch->dmac->pif; ··· 686 664 687 665 desc->rqcfg.src_inc = 1; 688 666 desc->rqcfg.dst_inc = 1; 667 + desc->req.rqtype = MEMTOMEM; 689 668 690 669 /* Select max possible burst size */ 691 670 burst = pi->pcfg.data_bus_width / 8; ··· 715 692 { 716 693 struct dma_pl330_desc *first, *desc = NULL; 717 694 struct dma_pl330_chan *pch = to_pchan(chan); 718 - struct dma_pl330_peri *peri = chan->private; 719 695 struct scatterlist *sg; 720 696 unsigned long flags; 721 697 int i; 722 698 dma_addr_t addr; 723 699 724 - if (unlikely(!pch || !sgl || !sg_len || !peri)) 700 + if (unlikely(!pch || !sgl || !sg_len)) 725 701 return NULL; 726 - 727 - /* Make sure the direction is consistent */ 728 - if ((direction == DMA_TO_DEVICE && 729 - peri->rqtype != MEMTODEV) || 730 - (direction == DMA_FROM_DEVICE && 731 - peri->rqtype != DEVTOMEM)) { 732 - dev_err(pch->dmac->pif.dev, "%s:%d Invalid Direction\n", 733 - __func__, __LINE__); 734 - return NULL; 735 - } 736 702 737 703 addr = pch->fifo_addr; 738 704 ··· 762 750 if (direction == DMA_TO_DEVICE) { 763 751 desc->rqcfg.src_inc = 1; 764 752 desc->rqcfg.dst_inc = 0; 753 + desc->req.rqtype = MEMTODEV; 765 754 fill_px(&desc->px, 766 755 addr, sg_dma_address(sg), sg_dma_len(sg)); 767 756 } else { 768 757 desc->rqcfg.src_inc = 0; 769 758 desc->rqcfg.dst_inc = 1; 759 + desc->req.rqtype = DEVTOMEM; 770 760 fill_px(&desc->px, 771 761 sg_dma_address(sg), addr, sg_dma_len(sg)); 772 762 } ··· 870 856 INIT_LIST_HEAD(&pd->channels); 871 857 872 858 /* Initialize channel parameters */ 873 - num_chan = max(pdat ? pdat->nr_valid_peri : 0, (u8)pi->pcfg.num_chan); 859 + num_chan = max(pdat ? pdat->nr_valid_peri : (u8)pi->pcfg.num_peri, 860 + (u8)pi->pcfg.num_chan); 874 861 pdmac->peripherals = kzalloc(num_chan * sizeof(*pch), GFP_KERNEL); 875 862 876 863 for (i = 0; i < num_chan; i++) { 877 864 pch = &pdmac->peripherals[i]; 878 - if (pdat) { 879 - struct dma_pl330_peri *peri = &pdat->peri[i]; 880 - 881 - switch (peri->rqtype) { 882 - case MEMTOMEM: 883 - dma_cap_set(DMA_MEMCPY, pd->cap_mask); 884 - break; 885 - case MEMTODEV: 886 - case DEVTOMEM: 887 - dma_cap_set(DMA_SLAVE, pd->cap_mask); 888 - dma_cap_set(DMA_CYCLIC, pd->cap_mask); 889 - break; 890 - default: 891 - dev_err(&adev->dev, "DEVTODEV Not Supported\n"); 892 - continue; 893 - } 894 - pch->chan.private = peri; 895 - } else { 896 - dma_cap_set(DMA_MEMCPY, pd->cap_mask); 897 - pch->chan.private = NULL; 898 - } 865 + if (!adev->dev.of_node) 866 + pch->chan.private = pdat ? &pdat->peri_id[i] : NULL; 867 + else 868 + pch->chan.private = adev->dev.of_node; 899 869 900 870 INIT_LIST_HEAD(&pch->work_list); 901 871 spin_lock_init(&pch->lock); ··· 892 894 } 893 895 894 896 pd->dev = &adev->dev; 897 + if (pdat) { 898 + pd->cap_mask = pdat->cap_mask; 899 + } else { 900 + dma_cap_set(DMA_MEMCPY, pd->cap_mask); 901 + if (pi->pcfg.num_peri) { 902 + dma_cap_set(DMA_SLAVE, pd->cap_mask); 903 + dma_cap_set(DMA_CYCLIC, pd->cap_mask); 904 + } 905 + } 895 906 896 907 pd->device_alloc_chan_resources = pl330_alloc_chan_resources; 897 908 pd->device_free_chan_resources = pl330_free_chan_resources;
+72
drivers/gpio/gpio-samsung.c
··· 24 24 #include <linux/interrupt.h> 25 25 #include <linux/device.h> 26 26 #include <linux/ioport.h> 27 + #include <linux/of.h> 28 + #include <linux/slab.h> 29 + #include <linux/of_address.h> 27 30 28 31 #include <asm/irq.h> 29 32 ··· 2386 2383 #endif 2387 2384 }; 2388 2385 2386 + #if defined(CONFIG_ARCH_EXYNOS4) && defined(CONFIG_OF) 2387 + static int exynos4_gpio_xlate(struct gpio_chip *gc, struct device_node *np, 2388 + const void *gpio_spec, u32 *flags) 2389 + { 2390 + const __be32 *gpio = gpio_spec; 2391 + const u32 n = be32_to_cpup(gpio); 2392 + unsigned int pin = gc->base + be32_to_cpu(gpio[0]); 2393 + 2394 + if (WARN_ON(gc->of_gpio_n_cells < 4)) 2395 + return -EINVAL; 2396 + 2397 + if (n > gc->ngpio) 2398 + return -EINVAL; 2399 + 2400 + if (s3c_gpio_cfgpin(pin, S3C_GPIO_SFN(be32_to_cpu(gpio[1])))) 2401 + pr_warn("gpio_xlate: failed to set pin function\n"); 2402 + if (s3c_gpio_setpull(pin, be32_to_cpu(gpio[2]))) 2403 + pr_warn("gpio_xlate: failed to set pin pull up/down\n"); 2404 + if (s5p_gpio_set_drvstr(pin, be32_to_cpu(gpio[3]))) 2405 + pr_warn("gpio_xlate: failed to set pin drive strength\n"); 2406 + 2407 + return n; 2408 + } 2409 + 2410 + static const struct of_device_id exynos4_gpio_dt_match[] __initdata = { 2411 + { .compatible = "samsung,exynos4-gpio", }, 2412 + {} 2413 + }; 2414 + 2415 + static __init void exynos4_gpiolib_attach_ofnode(struct samsung_gpio_chip *chip, 2416 + u64 base, u64 offset) 2417 + { 2418 + struct gpio_chip *gc = &chip->chip; 2419 + u64 address; 2420 + 2421 + if (!of_have_populated_dt()) 2422 + return; 2423 + 2424 + address = chip->base ? base + ((u32)chip->base & 0xfff) : base + offset; 2425 + gc->of_node = of_find_matching_node_by_address(NULL, 2426 + exynos4_gpio_dt_match, address); 2427 + if (!gc->of_node) { 2428 + pr_info("gpio: device tree node not found for gpio controller" 2429 + " with base address %08llx\n", address); 2430 + return; 2431 + } 2432 + gc->of_gpio_n_cells = 4; 2433 + gc->of_xlate = exynos4_gpio_xlate; 2434 + } 2435 + #elif defined(CONFIG_ARCH_EXYNOS4) 2436 + static __init void exynos4_gpiolib_attach_ofnode(struct samsung_gpio_chip *chip, 2437 + u64 base, u64 offset) 2438 + { 2439 + return; 2440 + } 2441 + #endif /* defined(CONFIG_ARCH_EXYNOS4) && defined(CONFIG_OF) */ 2442 + 2389 2443 /* TODO: cleanup soc_is_* */ 2390 2444 static __init int samsung_gpiolib_init(void) 2391 2445 { ··· 2524 2464 chip->config = &exynos4_gpio_cfg; 2525 2465 chip->group = group++; 2526 2466 } 2467 + #ifdef CONFIG_CPU_EXYNOS4210 2468 + exynos4_gpiolib_attach_ofnode(chip, 2469 + EXYNOS4_PA_GPIO1, i * 0x20); 2470 + #endif 2527 2471 } 2528 2472 samsung_gpiolib_add_4bit_chips(exynos4_gpios_1, nr_chips, S5P_VA_GPIO1); 2529 2473 ··· 2540 2476 chip->config = &exynos4_gpio_cfg; 2541 2477 chip->group = group++; 2542 2478 } 2479 + #ifdef CONFIG_CPU_EXYNOS4210 2480 + exynos4_gpiolib_attach_ofnode(chip, 2481 + EXYNOS4_PA_GPIO2, i * 0x20); 2482 + #endif 2543 2483 } 2544 2484 samsung_gpiolib_add_4bit_chips(exynos4_gpios_2, nr_chips, S5P_VA_GPIO2); 2545 2485 ··· 2556 2488 chip->config = &exynos4_gpio_cfg; 2557 2489 chip->group = group++; 2558 2490 } 2491 + #ifdef CONFIG_CPU_EXYNOS4210 2492 + exynos4_gpiolib_attach_ofnode(chip, 2493 + EXYNOS4_PA_GPIO3, i * 0x20); 2494 + #endif 2559 2495 } 2560 2496 samsung_gpiolib_add_4bit_chips(exynos4_gpios_3, nr_chips, S5P_VA_GPIO3); 2561 2497
+162 -12
drivers/input/keyboard/samsung-keypad.c
··· 21 21 #include <linux/module.h> 22 22 #include <linux/platform_device.h> 23 23 #include <linux/slab.h> 24 + #include <linux/of.h> 25 + #include <linux/of_gpio.h> 24 26 #include <linux/sched.h> 25 27 #include <plat/keypad.h> 26 28 ··· 70 68 wait_queue_head_t wait; 71 69 bool stopped; 72 70 int irq; 71 + enum samsung_keypad_type type; 73 72 unsigned int row_shift; 74 73 unsigned int rows; 75 74 unsigned int cols; 76 75 unsigned int row_state[SAMSUNG_MAX_COLS]; 76 + #ifdef CONFIG_OF 77 + int row_gpios[SAMSUNG_MAX_ROWS]; 78 + int col_gpios[SAMSUNG_MAX_COLS]; 79 + #endif 77 80 unsigned short keycodes[]; 78 81 }; 79 - 80 - static int samsung_keypad_is_s5pv210(struct device *dev) 81 - { 82 - struct platform_device *pdev = to_platform_device(dev); 83 - enum samsung_keypad_type type = 84 - platform_get_device_id(pdev)->driver_data; 85 - 86 - return type == KEYPAD_TYPE_S5PV210; 87 - } 88 82 89 83 static void samsung_keypad_scan(struct samsung_keypad *keypad, 90 84 unsigned int *row_state) 91 85 { 92 - struct device *dev = keypad->input_dev->dev.parent; 93 86 unsigned int col; 94 87 unsigned int val; 95 88 96 89 for (col = 0; col < keypad->cols; col++) { 97 - if (samsung_keypad_is_s5pv210(dev)) { 90 + if (keypad->type == KEYPAD_TYPE_S5PV210) { 98 91 val = S5PV210_KEYIFCOLEN_MASK; 99 92 val &= ~(1 << col) << 8; 100 93 } else { ··· 232 235 samsung_keypad_stop(keypad); 233 236 } 234 237 238 + #ifdef CONFIG_OF 239 + static struct samsung_keypad_platdata *samsung_keypad_parse_dt( 240 + struct device *dev) 241 + { 242 + struct samsung_keypad_platdata *pdata; 243 + struct matrix_keymap_data *keymap_data; 244 + uint32_t *keymap, num_rows = 0, num_cols = 0; 245 + struct device_node *np = dev->of_node, *key_np; 246 + unsigned int key_count = 0; 247 + 248 + pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL); 249 + if (!pdata) { 250 + dev_err(dev, "could not allocate memory for platform data\n"); 251 + return NULL; 252 + } 253 + 254 + of_property_read_u32(np, "samsung,keypad-num-rows", &num_rows); 255 + of_property_read_u32(np, "samsung,keypad-num-columns", &num_cols); 256 + if (!num_rows || !num_cols) { 257 + dev_err(dev, "number of keypad rows/columns not specified\n"); 258 + return NULL; 259 + } 260 + pdata->rows = num_rows; 261 + pdata->cols = num_cols; 262 + 263 + keymap_data = devm_kzalloc(dev, sizeof(*keymap_data), GFP_KERNEL); 264 + if (!keymap_data) { 265 + dev_err(dev, "could not allocate memory for keymap data\n"); 266 + return NULL; 267 + } 268 + pdata->keymap_data = keymap_data; 269 + 270 + for_each_child_of_node(np, key_np) 271 + key_count++; 272 + 273 + keymap_data->keymap_size = key_count; 274 + keymap = devm_kzalloc(dev, sizeof(uint32_t) * key_count, GFP_KERNEL); 275 + if (!keymap) { 276 + dev_err(dev, "could not allocate memory for keymap\n"); 277 + return NULL; 278 + } 279 + keymap_data->keymap = keymap; 280 + 281 + for_each_child_of_node(np, key_np) { 282 + u32 row, col, key_code; 283 + of_property_read_u32(key_np, "keypad,row", &row); 284 + of_property_read_u32(key_np, "keypad,column", &col); 285 + of_property_read_u32(key_np, "linux,code", &key_code); 286 + *keymap++ = KEY(row, col, key_code); 287 + } 288 + 289 + if (of_get_property(np, "linux,input-no-autorepeat", NULL)) 290 + pdata->no_autorepeat = true; 291 + if (of_get_property(np, "linux,input-wakeup", NULL)) 292 + pdata->wakeup = true; 293 + 294 + return pdata; 295 + } 296 + 297 + static void samsung_keypad_parse_dt_gpio(struct device *dev, 298 + struct samsung_keypad *keypad) 299 + { 300 + struct device_node *np = dev->of_node; 301 + int gpio, ret, row, col; 302 + 303 + for (row = 0; row < keypad->rows; row++) { 304 + gpio = of_get_named_gpio(np, "row-gpios", row); 305 + keypad->row_gpios[row] = gpio; 306 + if (!gpio_is_valid(gpio)) { 307 + dev_err(dev, "keypad row[%d]: invalid gpio %d\n", 308 + row, gpio); 309 + continue; 310 + } 311 + 312 + ret = gpio_request(gpio, "keypad-row"); 313 + if (ret) 314 + dev_err(dev, "keypad row[%d] gpio request failed\n", 315 + row); 316 + } 317 + 318 + for (col = 0; col < keypad->cols; col++) { 319 + gpio = of_get_named_gpio(np, "col-gpios", col); 320 + keypad->col_gpios[col] = gpio; 321 + if (!gpio_is_valid(gpio)) { 322 + dev_err(dev, "keypad column[%d]: invalid gpio %d\n", 323 + col, gpio); 324 + continue; 325 + } 326 + 327 + ret = gpio_request(gpio, "keypad-col"); 328 + if (ret) 329 + dev_err(dev, "keypad column[%d] gpio request failed\n", 330 + col); 331 + } 332 + } 333 + 334 + static void samsung_keypad_dt_gpio_free(struct samsung_keypad *keypad) 335 + { 336 + int cnt; 337 + 338 + for (cnt = 0; cnt < keypad->rows; cnt++) 339 + if (gpio_is_valid(keypad->row_gpios[cnt])) 340 + gpio_free(keypad->row_gpios[cnt]); 341 + 342 + for (cnt = 0; cnt < keypad->cols; cnt++) 343 + if (gpio_is_valid(keypad->col_gpios[cnt])) 344 + gpio_free(keypad->col_gpios[cnt]); 345 + } 346 + #else 347 + static 348 + struct samsung_keypad_platdata *samsung_keypad_parse_dt(struct device *dev) 349 + { 350 + return NULL; 351 + } 352 + 353 + static void samsung_keypad_dt_gpio_free(struct samsung_keypad *keypad) 354 + { 355 + } 356 + #endif 357 + 235 358 static int __devinit samsung_keypad_probe(struct platform_device *pdev) 236 359 { 237 360 const struct samsung_keypad_platdata *pdata; ··· 363 246 unsigned int keymap_size; 364 247 int error; 365 248 366 - pdata = pdev->dev.platform_data; 249 + if (pdev->dev.of_node) 250 + pdata = samsung_keypad_parse_dt(&pdev->dev); 251 + else 252 + pdata = pdev->dev.platform_data; 367 253 if (!pdata) { 368 254 dev_err(&pdev->dev, "no platform data defined\n"); 369 255 return -EINVAL; ··· 423 303 keypad->cols = pdata->cols; 424 304 init_waitqueue_head(&keypad->wait); 425 305 306 + if (pdev->dev.of_node) { 307 + #ifdef CONFIG_OF 308 + samsung_keypad_parse_dt_gpio(&pdev->dev, keypad); 309 + keypad->type = of_device_is_compatible(pdev->dev.of_node, 310 + "samsung,s5pv210-keypad"); 311 + #endif 312 + } else { 313 + keypad->type = platform_get_device_id(pdev)->driver_data; 314 + } 315 + 426 316 input_dev->name = pdev->name; 427 317 input_dev->id.bustype = BUS_HOST; 428 318 input_dev->dev.parent = &pdev->dev; ··· 473 343 474 344 device_init_wakeup(&pdev->dev, pdata->wakeup); 475 345 platform_set_drvdata(pdev, keypad); 346 + 347 + if (pdev->dev.of_node) { 348 + devm_kfree(&pdev->dev, (void *)pdata->keymap_data->keymap); 349 + devm_kfree(&pdev->dev, (void *)pdata->keymap_data); 350 + devm_kfree(&pdev->dev, (void *)pdata); 351 + } 476 352 return 0; 477 353 478 354 err_free_irq: 479 355 free_irq(keypad->irq, keypad); 480 356 err_put_clk: 481 357 clk_put(keypad->clk); 358 + samsung_keypad_dt_gpio_free(keypad); 482 359 err_unmap_base: 483 360 iounmap(keypad->base); 484 361 err_free_mem: ··· 511 374 free_irq(keypad->irq, keypad); 512 375 513 376 clk_put(keypad->clk); 377 + samsung_keypad_dt_gpio_free(keypad); 514 378 515 379 iounmap(keypad->base); 516 380 kfree(keypad); ··· 585 447 }; 586 448 #endif 587 449 450 + #ifdef CONFIG_OF 451 + static const struct of_device_id samsung_keypad_dt_match[] = { 452 + { .compatible = "samsung,s3c6410-keypad" }, 453 + { .compatible = "samsung,s5pv210-keypad" }, 454 + {}, 455 + }; 456 + MODULE_DEVICE_TABLE(of, samsung_keypad_dt_match); 457 + #else 458 + #define samsung_keypad_dt_match NULL 459 + #endif 460 + 588 461 static struct platform_device_id samsung_keypad_driver_ids[] = { 589 462 { 590 463 .name = "samsung-keypad", ··· 614 465 .driver = { 615 466 .name = "samsung-keypad", 616 467 .owner = THIS_MODULE, 468 + .of_match_table = samsung_keypad_dt_match, 617 469 #ifdef CONFIG_PM 618 470 .pm = &samsung_keypad_pm_ops, 619 471 #endif
+20 -1
drivers/rtc/rtc-s3c.c
··· 25 25 #include <linux/clk.h> 26 26 #include <linux/log2.h> 27 27 #include <linux/slab.h> 28 + #include <linux/of.h> 28 29 29 30 #include <mach/hardware.h> 30 31 #include <asm/uaccess.h> ··· 508 507 goto err_nortc; 509 508 } 510 509 511 - s3c_rtc_cpu_type = platform_get_device_id(pdev)->driver_data; 510 + #ifdef CONFIG_OF 511 + if (pdev->dev.of_node) 512 + s3c_rtc_cpu_type = of_device_is_compatible(pdev->dev.of_node, 513 + "samsung,s3c6410-rtc") ? TYPE_S3C64XX : TYPE_S3C2410; 514 + else 515 + #endif 516 + s3c_rtc_cpu_type = platform_get_device_id(pdev)->driver_data; 512 517 513 518 /* Check RTC Time */ 514 519 ··· 636 629 #define s3c_rtc_resume NULL 637 630 #endif 638 631 632 + #ifdef CONFIG_OF 633 + static const struct of_device_id s3c_rtc_dt_match[] = { 634 + { .compatible = "samsung,s3c2410-rtc" }, 635 + { .compatible = "samsung,s3c6410-rtc" }, 636 + {}, 637 + }; 638 + MODULE_DEVICE_TABLE(of, s3c_rtc_dt_match); 639 + #else 640 + #define s3c_rtc_dt_match NULL 641 + #endif 642 + 639 643 static struct platform_device_id s3c_rtc_driver_ids[] = { 640 644 { 641 645 .name = "s3c2410-rtc", ··· 669 651 .driver = { 670 652 .name = "s3c-rtc", 671 653 .owner = THIS_MODULE, 654 + .of_match_table = s3c_rtc_dt_match, 672 655 }, 673 656 }; 674 657
+2 -42
drivers/tty/serial/Kconfig
··· 462 462 config SERIAL_SAMSUNG_UARTS_4 463 463 bool 464 464 depends on ARM && PLAT_SAMSUNG 465 - default y if CPU_S3C2443 465 + default y if !(CPU_S3C2410 || SERIAL_S3C2412 || CPU_S3C2440 || CPU_S3C2442) 466 466 help 467 467 Internal node for the common case of 4 Samsung compatible UARTs 468 468 ··· 470 470 int 471 471 depends on ARM && PLAT_SAMSUNG 472 472 default 6 if ARCH_S5P6450 473 - default 4 if SERIAL_SAMSUNG_UARTS_4 473 + default 4 if SERIAL_SAMSUNG_UARTS_4 || CPU_S3C2416 474 474 default 3 475 475 help 476 476 Select the number of available UART ports for the Samsung S3C ··· 499 499 "console=ttySACx". (Try "man bootparam" or see the documentation of 500 500 your boot loader about how to pass options to the kernel at 501 501 boot time.) 502 - 503 - config SERIAL_S3C2410 504 - tristate "Samsung S3C2410 Serial port support" 505 - depends on SERIAL_SAMSUNG && CPU_S3C2410 506 - default y if CPU_S3C2410 507 - help 508 - Serial port support for the Samsung S3C2410 SoC 509 - 510 - config SERIAL_S3C2412 511 - tristate "Samsung S3C2412/S3C2413 Serial port support" 512 - depends on SERIAL_SAMSUNG && CPU_S3C2412 513 - default y if CPU_S3C2412 514 - help 515 - Serial port support for the Samsung S3C2412 and S3C2413 SoC 516 - 517 - config SERIAL_S3C2440 518 - tristate "Samsung S3C2440/S3C2442/S3C2416 Serial port support" 519 - depends on SERIAL_SAMSUNG && (CPU_S3C2440 || CPU_S3C2442 || CPU_S3C2416) 520 - default y if CPU_S3C2440 521 - default y if CPU_S3C2442 522 - select SERIAL_SAMSUNG_UARTS_4 if CPU_S3C2416 523 - help 524 - Serial port support for the Samsung S3C2440, S3C2416 and S3C2442 SoC 525 - 526 - config SERIAL_S3C6400 527 - tristate "Samsung S3C6400/S3C6410/S5P6440/S5P6450/S5PC100 Serial port support" 528 - depends on SERIAL_SAMSUNG && (CPU_S3C6400 || CPU_S3C6410 || CPU_S5P6440 || CPU_S5P6450 || CPU_S5PC100) 529 - select SERIAL_SAMSUNG_UARTS_4 530 - default y 531 - help 532 - Serial port support for the Samsung S3C6400, S3C6410, S5P6440, S5P6450 533 - and S5PC100 SoCs 534 - 535 - config SERIAL_S5PV210 536 - tristate "Samsung S5PV210 Serial port support" 537 - depends on SERIAL_SAMSUNG && (CPU_S5PV210 || CPU_EXYNOS4210 || SOC_EXYNOS4212) 538 - select SERIAL_SAMSUNG_UARTS_4 if (CPU_S5PV210 || CPU_EXYNOS4210 || SOC_EXYNOS4212) 539 - default y 540 - help 541 - Serial port support for Samsung's S5P Family of SoC's 542 502 543 503 config SERIAL_SIRFSOC 544 504 tristate "SiRF SoC Platform Serial port support"
-5
drivers/tty/serial/Makefile
··· 40 40 obj-$(CONFIG_SERIAL_BFIN) += bfin_uart.o 41 41 obj-$(CONFIG_SERIAL_BFIN_SPORT) += bfin_sport_uart.o 42 42 obj-$(CONFIG_SERIAL_SAMSUNG) += samsung.o 43 - obj-$(CONFIG_SERIAL_S3C2410) += s3c2410.o 44 - obj-$(CONFIG_SERIAL_S3C2412) += s3c2412.o 45 - obj-$(CONFIG_SERIAL_S3C2440) += s3c2440.o 46 - obj-$(CONFIG_SERIAL_S3C6400) += s3c6400.o 47 - obj-$(CONFIG_SERIAL_S5PV210) += s5pv210.o 48 43 obj-$(CONFIG_SERIAL_MAX3100) += max3100.o 49 44 obj-$(CONFIG_SERIAL_MAX3107) += max3107.o 50 45 obj-$(CONFIG_SERIAL_MAX3107_AAVA) += max3107-aava.o
-115
drivers/tty/serial/s3c2410.c
··· 1 - /* 2 - * Driver for Samsung S3C2410 SoC onboard UARTs. 3 - * 4 - * Ben Dooks, Copyright (c) 2003-2008 Simtec Electronics 5 - * http://armlinux.simtec.co.uk/ 6 - * 7 - * This program is free software; you can redistribute it and/or modify 8 - * it under the terms of the GNU General Public License version 2 as 9 - * published by the Free Software Foundation. 10 - */ 11 - 12 - #include <linux/module.h> 13 - #include <linux/ioport.h> 14 - #include <linux/io.h> 15 - #include <linux/platform_device.h> 16 - #include <linux/init.h> 17 - #include <linux/serial_core.h> 18 - #include <linux/serial.h> 19 - 20 - #include <asm/irq.h> 21 - #include <mach/hardware.h> 22 - 23 - #include <plat/regs-serial.h> 24 - #include <mach/regs-gpio.h> 25 - 26 - #include "samsung.h" 27 - 28 - static int s3c2410_serial_setsource(struct uart_port *port, 29 - struct s3c24xx_uart_clksrc *clk) 30 - { 31 - unsigned long ucon = rd_regl(port, S3C2410_UCON); 32 - 33 - if (strcmp(clk->name, "uclk") == 0) 34 - ucon |= S3C2410_UCON_UCLK; 35 - else 36 - ucon &= ~S3C2410_UCON_UCLK; 37 - 38 - wr_regl(port, S3C2410_UCON, ucon); 39 - return 0; 40 - } 41 - 42 - static int s3c2410_serial_getsource(struct uart_port *port, 43 - struct s3c24xx_uart_clksrc *clk) 44 - { 45 - unsigned long ucon = rd_regl(port, S3C2410_UCON); 46 - 47 - clk->divisor = 1; 48 - clk->name = (ucon & S3C2410_UCON_UCLK) ? "uclk" : "pclk"; 49 - 50 - return 0; 51 - } 52 - 53 - static int s3c2410_serial_resetport(struct uart_port *port, 54 - struct s3c2410_uartcfg *cfg) 55 - { 56 - dbg("s3c2410_serial_resetport: port=%p (%08lx), cfg=%p\n", 57 - port, port->mapbase, cfg); 58 - 59 - wr_regl(port, S3C2410_UCON, cfg->ucon); 60 - wr_regl(port, S3C2410_ULCON, cfg->ulcon); 61 - 62 - /* reset both fifos */ 63 - 64 - wr_regl(port, S3C2410_UFCON, cfg->ufcon | S3C2410_UFCON_RESETBOTH); 65 - wr_regl(port, S3C2410_UFCON, cfg->ufcon); 66 - 67 - return 0; 68 - } 69 - 70 - static struct s3c24xx_uart_info s3c2410_uart_inf = { 71 - .name = "Samsung S3C2410 UART", 72 - .type = PORT_S3C2410, 73 - .fifosize = 16, 74 - .rx_fifomask = S3C2410_UFSTAT_RXMASK, 75 - .rx_fifoshift = S3C2410_UFSTAT_RXSHIFT, 76 - .rx_fifofull = S3C2410_UFSTAT_RXFULL, 77 - .tx_fifofull = S3C2410_UFSTAT_TXFULL, 78 - .tx_fifomask = S3C2410_UFSTAT_TXMASK, 79 - .tx_fifoshift = S3C2410_UFSTAT_TXSHIFT, 80 - .get_clksrc = s3c2410_serial_getsource, 81 - .set_clksrc = s3c2410_serial_setsource, 82 - .reset_port = s3c2410_serial_resetport, 83 - }; 84 - 85 - static int s3c2410_serial_probe(struct platform_device *dev) 86 - { 87 - return s3c24xx_serial_probe(dev, &s3c2410_uart_inf); 88 - } 89 - 90 - static struct platform_driver s3c2410_serial_driver = { 91 - .probe = s3c2410_serial_probe, 92 - .remove = __devexit_p(s3c24xx_serial_remove), 93 - .driver = { 94 - .name = "s3c2410-uart", 95 - .owner = THIS_MODULE, 96 - }, 97 - }; 98 - 99 - static int __init s3c2410_serial_init(void) 100 - { 101 - return s3c24xx_serial_init(&s3c2410_serial_driver, &s3c2410_uart_inf); 102 - } 103 - 104 - static void __exit s3c2410_serial_exit(void) 105 - { 106 - platform_driver_unregister(&s3c2410_serial_driver); 107 - } 108 - 109 - module_init(s3c2410_serial_init); 110 - module_exit(s3c2410_serial_exit); 111 - 112 - MODULE_LICENSE("GPL v2"); 113 - MODULE_AUTHOR("Ben Dooks <ben@simtec.co.uk>"); 114 - MODULE_DESCRIPTION("Samsung S3C2410 SoC Serial port driver"); 115 - MODULE_ALIAS("platform:s3c2410-uart");
-149
drivers/tty/serial/s3c2412.c
··· 1 - /* 2 - * Driver for Samsung S3C2412 and S3C2413 SoC onboard UARTs. 3 - * 4 - * Ben Dooks, Copyright (c) 2003-2008 Simtec Electronics 5 - * http://armlinux.simtec.co.uk/ 6 - * 7 - * This program is free software; you can redistribute it and/or modify 8 - * it under the terms of the GNU General Public License version 2 as 9 - * published by the Free Software Foundation. 10 - */ 11 - 12 - #include <linux/module.h> 13 - #include <linux/ioport.h> 14 - #include <linux/io.h> 15 - #include <linux/platform_device.h> 16 - #include <linux/init.h> 17 - #include <linux/serial_core.h> 18 - #include <linux/serial.h> 19 - 20 - #include <asm/irq.h> 21 - #include <mach/hardware.h> 22 - 23 - #include <plat/regs-serial.h> 24 - #include <mach/regs-gpio.h> 25 - 26 - #include "samsung.h" 27 - 28 - static int s3c2412_serial_setsource(struct uart_port *port, 29 - struct s3c24xx_uart_clksrc *clk) 30 - { 31 - unsigned long ucon = rd_regl(port, S3C2410_UCON); 32 - 33 - ucon &= ~S3C2412_UCON_CLKMASK; 34 - 35 - if (strcmp(clk->name, "uclk") == 0) 36 - ucon |= S3C2440_UCON_UCLK; 37 - else if (strcmp(clk->name, "pclk") == 0) 38 - ucon |= S3C2440_UCON_PCLK; 39 - else if (strcmp(clk->name, "usysclk") == 0) 40 - ucon |= S3C2412_UCON_USYSCLK; 41 - else { 42 - printk(KERN_ERR "unknown clock source %s\n", clk->name); 43 - return -EINVAL; 44 - } 45 - 46 - wr_regl(port, S3C2410_UCON, ucon); 47 - return 0; 48 - } 49 - 50 - 51 - static int s3c2412_serial_getsource(struct uart_port *port, 52 - struct s3c24xx_uart_clksrc *clk) 53 - { 54 - unsigned long ucon = rd_regl(port, S3C2410_UCON); 55 - 56 - switch (ucon & S3C2412_UCON_CLKMASK) { 57 - case S3C2412_UCON_UCLK: 58 - clk->divisor = 1; 59 - clk->name = "uclk"; 60 - break; 61 - 62 - case S3C2412_UCON_PCLK: 63 - case S3C2412_UCON_PCLK2: 64 - clk->divisor = 1; 65 - clk->name = "pclk"; 66 - break; 67 - 68 - case S3C2412_UCON_USYSCLK: 69 - clk->divisor = 1; 70 - clk->name = "usysclk"; 71 - break; 72 - } 73 - 74 - return 0; 75 - } 76 - 77 - static int s3c2412_serial_resetport(struct uart_port *port, 78 - struct s3c2410_uartcfg *cfg) 79 - { 80 - unsigned long ucon = rd_regl(port, S3C2410_UCON); 81 - 82 - dbg("%s: port=%p (%08lx), cfg=%p\n", 83 - __func__, port, port->mapbase, cfg); 84 - 85 - /* ensure we don't change the clock settings... */ 86 - 87 - ucon &= S3C2412_UCON_CLKMASK; 88 - 89 - wr_regl(port, S3C2410_UCON, ucon | cfg->ucon); 90 - wr_regl(port, S3C2410_ULCON, cfg->ulcon); 91 - 92 - /* reset both fifos */ 93 - 94 - wr_regl(port, S3C2410_UFCON, cfg->ufcon | S3C2410_UFCON_RESETBOTH); 95 - wr_regl(port, S3C2410_UFCON, cfg->ufcon); 96 - 97 - return 0; 98 - } 99 - 100 - static struct s3c24xx_uart_info s3c2412_uart_inf = { 101 - .name = "Samsung S3C2412 UART", 102 - .type = PORT_S3C2412, 103 - .fifosize = 64, 104 - .has_divslot = 1, 105 - .rx_fifomask = S3C2440_UFSTAT_RXMASK, 106 - .rx_fifoshift = S3C2440_UFSTAT_RXSHIFT, 107 - .rx_fifofull = S3C2440_UFSTAT_RXFULL, 108 - .tx_fifofull = S3C2440_UFSTAT_TXFULL, 109 - .tx_fifomask = S3C2440_UFSTAT_TXMASK, 110 - .tx_fifoshift = S3C2440_UFSTAT_TXSHIFT, 111 - .get_clksrc = s3c2412_serial_getsource, 112 - .set_clksrc = s3c2412_serial_setsource, 113 - .reset_port = s3c2412_serial_resetport, 114 - }; 115 - 116 - /* device management */ 117 - 118 - static int s3c2412_serial_probe(struct platform_device *dev) 119 - { 120 - dbg("s3c2440_serial_probe: dev=%p\n", dev); 121 - return s3c24xx_serial_probe(dev, &s3c2412_uart_inf); 122 - } 123 - 124 - static struct platform_driver s3c2412_serial_driver = { 125 - .probe = s3c2412_serial_probe, 126 - .remove = __devexit_p(s3c24xx_serial_remove), 127 - .driver = { 128 - .name = "s3c2412-uart", 129 - .owner = THIS_MODULE, 130 - }, 131 - }; 132 - 133 - static inline int s3c2412_serial_init(void) 134 - { 135 - return s3c24xx_serial_init(&s3c2412_serial_driver, &s3c2412_uart_inf); 136 - } 137 - 138 - static inline void s3c2412_serial_exit(void) 139 - { 140 - platform_driver_unregister(&s3c2412_serial_driver); 141 - } 142 - 143 - module_init(s3c2412_serial_init); 144 - module_exit(s3c2412_serial_exit); 145 - 146 - MODULE_DESCRIPTION("Samsung S3C2412,S3C2413 SoC Serial port driver"); 147 - MODULE_AUTHOR("Ben Dooks <ben@simtec.co.uk>"); 148 - MODULE_LICENSE("GPL v2"); 149 - MODULE_ALIAS("platform:s3c2412-uart");
-178
drivers/tty/serial/s3c2440.c
··· 1 - /* 2 - * Driver for Samsung S3C2440 and S3C2442 SoC onboard UARTs. 3 - * 4 - * Ben Dooks, Copyright (c) 2003-2008 Simtec Electronics 5 - * http://armlinux.simtec.co.uk/ 6 - * 7 - * This program is free software; you can redistribute it and/or modify 8 - * it under the terms of the GNU General Public License version 2 as 9 - * published by the Free Software Foundation. 10 - */ 11 - 12 - #include <linux/module.h> 13 - #include <linux/ioport.h> 14 - #include <linux/io.h> 15 - #include <linux/platform_device.h> 16 - #include <linux/init.h> 17 - #include <linux/serial_core.h> 18 - #include <linux/serial.h> 19 - 20 - #include <asm/irq.h> 21 - #include <mach/hardware.h> 22 - 23 - #include <plat/regs-serial.h> 24 - #include <mach/regs-gpio.h> 25 - 26 - #include "samsung.h" 27 - 28 - 29 - static int s3c2440_serial_setsource(struct uart_port *port, 30 - struct s3c24xx_uart_clksrc *clk) 31 - { 32 - unsigned long ucon = rd_regl(port, S3C2410_UCON); 33 - 34 - /* todo - proper fclk<>nonfclk switch. */ 35 - 36 - ucon &= ~S3C2440_UCON_CLKMASK; 37 - 38 - if (strcmp(clk->name, "uclk") == 0) 39 - ucon |= S3C2440_UCON_UCLK; 40 - else if (strcmp(clk->name, "pclk") == 0) 41 - ucon |= S3C2440_UCON_PCLK; 42 - else if (strcmp(clk->name, "fclk") == 0) 43 - ucon |= S3C2440_UCON_FCLK; 44 - else { 45 - printk(KERN_ERR "unknown clock source %s\n", clk->name); 46 - return -EINVAL; 47 - } 48 - 49 - wr_regl(port, S3C2410_UCON, ucon); 50 - return 0; 51 - } 52 - 53 - 54 - static int s3c2440_serial_getsource(struct uart_port *port, 55 - struct s3c24xx_uart_clksrc *clk) 56 - { 57 - unsigned long ucon = rd_regl(port, S3C2410_UCON); 58 - unsigned long ucon0, ucon1, ucon2; 59 - 60 - switch (ucon & S3C2440_UCON_CLKMASK) { 61 - case S3C2440_UCON_UCLK: 62 - clk->divisor = 1; 63 - clk->name = "uclk"; 64 - break; 65 - 66 - case S3C2440_UCON_PCLK: 67 - case S3C2440_UCON_PCLK2: 68 - clk->divisor = 1; 69 - clk->name = "pclk"; 70 - break; 71 - 72 - case S3C2440_UCON_FCLK: 73 - /* the fun of calculating the uart divisors on 74 - * the s3c2440 */ 75 - 76 - ucon0 = __raw_readl(S3C24XX_VA_UART0 + S3C2410_UCON); 77 - ucon1 = __raw_readl(S3C24XX_VA_UART1 + S3C2410_UCON); 78 - ucon2 = __raw_readl(S3C24XX_VA_UART2 + S3C2410_UCON); 79 - 80 - printk("ucons: %08lx, %08lx, %08lx\n", ucon0, ucon1, ucon2); 81 - 82 - ucon0 &= S3C2440_UCON0_DIVMASK; 83 - ucon1 &= S3C2440_UCON1_DIVMASK; 84 - ucon2 &= S3C2440_UCON2_DIVMASK; 85 - 86 - if (ucon0 != 0) { 87 - clk->divisor = ucon0 >> S3C2440_UCON_DIVSHIFT; 88 - clk->divisor += 6; 89 - } else if (ucon1 != 0) { 90 - clk->divisor = ucon1 >> S3C2440_UCON_DIVSHIFT; 91 - clk->divisor += 21; 92 - } else if (ucon2 != 0) { 93 - clk->divisor = ucon2 >> S3C2440_UCON_DIVSHIFT; 94 - clk->divisor += 36; 95 - } else { 96 - /* manual calims 44, seems to be 9 */ 97 - clk->divisor = 9; 98 - } 99 - 100 - clk->name = "fclk"; 101 - break; 102 - } 103 - 104 - return 0; 105 - } 106 - 107 - static int s3c2440_serial_resetport(struct uart_port *port, 108 - struct s3c2410_uartcfg *cfg) 109 - { 110 - unsigned long ucon = rd_regl(port, S3C2410_UCON); 111 - 112 - dbg("s3c2440_serial_resetport: port=%p (%08lx), cfg=%p\n", 113 - port, port->mapbase, cfg); 114 - 115 - /* ensure we don't change the clock settings... */ 116 - 117 - ucon &= (S3C2440_UCON0_DIVMASK | (3<<10)); 118 - 119 - wr_regl(port, S3C2410_UCON, ucon | cfg->ucon); 120 - wr_regl(port, S3C2410_ULCON, cfg->ulcon); 121 - 122 - /* reset both fifos */ 123 - 124 - wr_regl(port, S3C2410_UFCON, cfg->ufcon | S3C2410_UFCON_RESETBOTH); 125 - wr_regl(port, S3C2410_UFCON, cfg->ufcon); 126 - 127 - return 0; 128 - } 129 - 130 - static struct s3c24xx_uart_info s3c2440_uart_inf = { 131 - .name = "Samsung S3C2440 UART", 132 - .type = PORT_S3C2440, 133 - .fifosize = 64, 134 - .rx_fifomask = S3C2440_UFSTAT_RXMASK, 135 - .rx_fifoshift = S3C2440_UFSTAT_RXSHIFT, 136 - .rx_fifofull = S3C2440_UFSTAT_RXFULL, 137 - .tx_fifofull = S3C2440_UFSTAT_TXFULL, 138 - .tx_fifomask = S3C2440_UFSTAT_TXMASK, 139 - .tx_fifoshift = S3C2440_UFSTAT_TXSHIFT, 140 - .get_clksrc = s3c2440_serial_getsource, 141 - .set_clksrc = s3c2440_serial_setsource, 142 - .reset_port = s3c2440_serial_resetport, 143 - }; 144 - 145 - /* device management */ 146 - 147 - static int s3c2440_serial_probe(struct platform_device *dev) 148 - { 149 - dbg("s3c2440_serial_probe: dev=%p\n", dev); 150 - return s3c24xx_serial_probe(dev, &s3c2440_uart_inf); 151 - } 152 - 153 - static struct platform_driver s3c2440_serial_driver = { 154 - .probe = s3c2440_serial_probe, 155 - .remove = __devexit_p(s3c24xx_serial_remove), 156 - .driver = { 157 - .name = "s3c2440-uart", 158 - .owner = THIS_MODULE, 159 - }, 160 - }; 161 - 162 - static int __init s3c2440_serial_init(void) 163 - { 164 - return s3c24xx_serial_init(&s3c2440_serial_driver, &s3c2440_uart_inf); 165 - } 166 - 167 - static void __exit s3c2440_serial_exit(void) 168 - { 169 - platform_driver_unregister(&s3c2440_serial_driver); 170 - } 171 - 172 - module_init(s3c2440_serial_init); 173 - module_exit(s3c2440_serial_exit); 174 - 175 - MODULE_DESCRIPTION("Samsung S3C2440,S3C2442 SoC Serial port driver"); 176 - MODULE_AUTHOR("Ben Dooks <ben@simtec.co.uk>"); 177 - MODULE_LICENSE("GPL v2"); 178 - MODULE_ALIAS("platform:s3c2440-uart");
-149
drivers/tty/serial/s3c6400.c
··· 1 - /* 2 - * Driver for Samsung S3C6400 and S3C6410 SoC onboard UARTs. 3 - * 4 - * Copyright 2008 Openmoko, Inc. 5 - * Copyright 2008 Simtec Electronics 6 - * Ben Dooks <ben@simtec.co.uk> 7 - * http://armlinux.simtec.co.uk/ 8 - * 9 - * This program is free software; you can redistribute it and/or modify 10 - * it under the terms of the GNU General Public License version 2 as 11 - * published by the Free Software Foundation. 12 - */ 13 - 14 - #include <linux/module.h> 15 - #include <linux/ioport.h> 16 - #include <linux/io.h> 17 - #include <linux/platform_device.h> 18 - #include <linux/init.h> 19 - #include <linux/serial_core.h> 20 - #include <linux/serial.h> 21 - 22 - #include <asm/irq.h> 23 - #include <mach/hardware.h> 24 - 25 - #include <plat/regs-serial.h> 26 - 27 - #include "samsung.h" 28 - 29 - static int s3c6400_serial_setsource(struct uart_port *port, 30 - struct s3c24xx_uart_clksrc *clk) 31 - { 32 - unsigned long ucon = rd_regl(port, S3C2410_UCON); 33 - 34 - if (strcmp(clk->name, "uclk0") == 0) { 35 - ucon &= ~S3C6400_UCON_CLKMASK; 36 - ucon |= S3C6400_UCON_UCLK0; 37 - } else if (strcmp(clk->name, "uclk1") == 0) 38 - ucon |= S3C6400_UCON_UCLK1; 39 - else if (strcmp(clk->name, "pclk") == 0) { 40 - /* See notes about transitioning from UCLK to PCLK */ 41 - ucon &= ~S3C6400_UCON_UCLK0; 42 - } else { 43 - printk(KERN_ERR "unknown clock source %s\n", clk->name); 44 - return -EINVAL; 45 - } 46 - 47 - wr_regl(port, S3C2410_UCON, ucon); 48 - return 0; 49 - } 50 - 51 - 52 - static int s3c6400_serial_getsource(struct uart_port *port, 53 - struct s3c24xx_uart_clksrc *clk) 54 - { 55 - u32 ucon = rd_regl(port, S3C2410_UCON); 56 - 57 - clk->divisor = 1; 58 - 59 - switch (ucon & S3C6400_UCON_CLKMASK) { 60 - case S3C6400_UCON_UCLK0: 61 - clk->name = "uclk0"; 62 - break; 63 - 64 - case S3C6400_UCON_UCLK1: 65 - clk->name = "uclk1"; 66 - break; 67 - 68 - case S3C6400_UCON_PCLK: 69 - case S3C6400_UCON_PCLK2: 70 - clk->name = "pclk"; 71 - break; 72 - } 73 - 74 - return 0; 75 - } 76 - 77 - static int s3c6400_serial_resetport(struct uart_port *port, 78 - struct s3c2410_uartcfg *cfg) 79 - { 80 - unsigned long ucon = rd_regl(port, S3C2410_UCON); 81 - 82 - dbg("s3c6400_serial_resetport: port=%p (%08lx), cfg=%p\n", 83 - port, port->mapbase, cfg); 84 - 85 - /* ensure we don't change the clock settings... */ 86 - 87 - ucon &= S3C6400_UCON_CLKMASK; 88 - 89 - wr_regl(port, S3C2410_UCON, ucon | cfg->ucon); 90 - wr_regl(port, S3C2410_ULCON, cfg->ulcon); 91 - 92 - /* reset both fifos */ 93 - 94 - wr_regl(port, S3C2410_UFCON, cfg->ufcon | S3C2410_UFCON_RESETBOTH); 95 - wr_regl(port, S3C2410_UFCON, cfg->ufcon); 96 - 97 - return 0; 98 - } 99 - 100 - static struct s3c24xx_uart_info s3c6400_uart_inf = { 101 - .name = "Samsung S3C6400 UART", 102 - .type = PORT_S3C6400, 103 - .fifosize = 64, 104 - .has_divslot = 1, 105 - .rx_fifomask = S3C2440_UFSTAT_RXMASK, 106 - .rx_fifoshift = S3C2440_UFSTAT_RXSHIFT, 107 - .rx_fifofull = S3C2440_UFSTAT_RXFULL, 108 - .tx_fifofull = S3C2440_UFSTAT_TXFULL, 109 - .tx_fifomask = S3C2440_UFSTAT_TXMASK, 110 - .tx_fifoshift = S3C2440_UFSTAT_TXSHIFT, 111 - .get_clksrc = s3c6400_serial_getsource, 112 - .set_clksrc = s3c6400_serial_setsource, 113 - .reset_port = s3c6400_serial_resetport, 114 - }; 115 - 116 - /* device management */ 117 - 118 - static int s3c6400_serial_probe(struct platform_device *dev) 119 - { 120 - dbg("s3c6400_serial_probe: dev=%p\n", dev); 121 - return s3c24xx_serial_probe(dev, &s3c6400_uart_inf); 122 - } 123 - 124 - static struct platform_driver s3c6400_serial_driver = { 125 - .probe = s3c6400_serial_probe, 126 - .remove = __devexit_p(s3c24xx_serial_remove), 127 - .driver = { 128 - .name = "s3c6400-uart", 129 - .owner = THIS_MODULE, 130 - }, 131 - }; 132 - 133 - static int __init s3c6400_serial_init(void) 134 - { 135 - return s3c24xx_serial_init(&s3c6400_serial_driver, &s3c6400_uart_inf); 136 - } 137 - 138 - static void __exit s3c6400_serial_exit(void) 139 - { 140 - platform_driver_unregister(&s3c6400_serial_driver); 141 - } 142 - 143 - module_init(s3c6400_serial_init); 144 - module_exit(s3c6400_serial_exit); 145 - 146 - MODULE_DESCRIPTION("Samsung S3C6400,S3C6410 SoC Serial port driver"); 147 - MODULE_AUTHOR("Ben Dooks <ben@simtec.co.uk>"); 148 - MODULE_LICENSE("GPL v2"); 149 - MODULE_ALIAS("platform:s3c6400-uart");
-158
drivers/tty/serial/s5pv210.c
··· 1 - /* 2 - * Copyright (c) 2010 Samsung Electronics Co., Ltd. 3 - * http://www.samsung.com/ 4 - * 5 - * Based on drivers/serial/s3c6400.c 6 - * 7 - * Driver for Samsung S5PV210 SoC UARTs. 8 - * 9 - * This program is free software; you can redistribute it and/or modify 10 - * it under the terms of the GNU General Public License version 2 as 11 - * published by the Free Software Foundation. 12 - */ 13 - 14 - #include <linux/module.h> 15 - #include <linux/ioport.h> 16 - #include <linux/io.h> 17 - #include <linux/platform_device.h> 18 - #include <linux/init.h> 19 - #include <linux/serial_core.h> 20 - #include <linux/serial.h> 21 - #include <linux/delay.h> 22 - 23 - #include <asm/irq.h> 24 - #include <mach/hardware.h> 25 - #include <plat/regs-serial.h> 26 - #include "samsung.h" 27 - 28 - static int s5pv210_serial_setsource(struct uart_port *port, 29 - struct s3c24xx_uart_clksrc *clk) 30 - { 31 - struct s3c2410_uartcfg *cfg = port->dev->platform_data; 32 - unsigned long ucon = rd_regl(port, S3C2410_UCON); 33 - 34 - if (cfg->flags & NO_NEED_CHECK_CLKSRC) 35 - return 0; 36 - 37 - if (strcmp(clk->name, "pclk") == 0) 38 - ucon &= ~S5PV210_UCON_CLKMASK; 39 - else if (strcmp(clk->name, "uclk1") == 0) 40 - ucon |= S5PV210_UCON_CLKMASK; 41 - else { 42 - printk(KERN_ERR "unknown clock source %s\n", clk->name); 43 - return -EINVAL; 44 - } 45 - 46 - wr_regl(port, S3C2410_UCON, ucon); 47 - return 0; 48 - } 49 - 50 - 51 - static int s5pv210_serial_getsource(struct uart_port *port, 52 - struct s3c24xx_uart_clksrc *clk) 53 - { 54 - struct s3c2410_uartcfg *cfg = port->dev->platform_data; 55 - u32 ucon = rd_regl(port, S3C2410_UCON); 56 - 57 - clk->divisor = 1; 58 - 59 - if (cfg->flags & NO_NEED_CHECK_CLKSRC) 60 - return 0; 61 - 62 - switch (ucon & S5PV210_UCON_CLKMASK) { 63 - case S5PV210_UCON_PCLK: 64 - clk->name = "pclk"; 65 - break; 66 - case S5PV210_UCON_UCLK: 67 - clk->name = "uclk1"; 68 - break; 69 - } 70 - 71 - return 0; 72 - } 73 - 74 - static int s5pv210_serial_resetport(struct uart_port *port, 75 - struct s3c2410_uartcfg *cfg) 76 - { 77 - unsigned long ucon = rd_regl(port, S3C2410_UCON); 78 - 79 - ucon &= S5PV210_UCON_CLKMASK; 80 - wr_regl(port, S3C2410_UCON, ucon | cfg->ucon); 81 - wr_regl(port, S3C2410_ULCON, cfg->ulcon); 82 - 83 - /* reset both fifos */ 84 - wr_regl(port, S3C2410_UFCON, cfg->ufcon | S3C2410_UFCON_RESETBOTH); 85 - wr_regl(port, S3C2410_UFCON, cfg->ufcon); 86 - 87 - /* It is need to delay When reset FIFO register */ 88 - udelay(1); 89 - 90 - return 0; 91 - } 92 - 93 - #define S5PV210_UART_DEFAULT_INFO(fifo_size) \ 94 - .name = "Samsung S5PV210 UART0", \ 95 - .type = PORT_S3C6400, \ 96 - .fifosize = fifo_size, \ 97 - .has_divslot = 1, \ 98 - .rx_fifomask = S5PV210_UFSTAT_RXMASK, \ 99 - .rx_fifoshift = S5PV210_UFSTAT_RXSHIFT, \ 100 - .rx_fifofull = S5PV210_UFSTAT_RXFULL, \ 101 - .tx_fifofull = S5PV210_UFSTAT_TXFULL, \ 102 - .tx_fifomask = S5PV210_UFSTAT_TXMASK, \ 103 - .tx_fifoshift = S5PV210_UFSTAT_TXSHIFT, \ 104 - .get_clksrc = s5pv210_serial_getsource, \ 105 - .set_clksrc = s5pv210_serial_setsource, \ 106 - .reset_port = s5pv210_serial_resetport 107 - 108 - static struct s3c24xx_uart_info s5p_port_fifo256 = { 109 - S5PV210_UART_DEFAULT_INFO(256), 110 - }; 111 - 112 - static struct s3c24xx_uart_info s5p_port_fifo64 = { 113 - S5PV210_UART_DEFAULT_INFO(64), 114 - }; 115 - 116 - static struct s3c24xx_uart_info s5p_port_fifo16 = { 117 - S5PV210_UART_DEFAULT_INFO(16), 118 - }; 119 - 120 - static struct s3c24xx_uart_info *s5p_uart_inf[] = { 121 - [0] = &s5p_port_fifo256, 122 - [1] = &s5p_port_fifo64, 123 - [2] = &s5p_port_fifo16, 124 - [3] = &s5p_port_fifo16, 125 - }; 126 - 127 - /* device management */ 128 - static int s5p_serial_probe(struct platform_device *pdev) 129 - { 130 - return s3c24xx_serial_probe(pdev, s5p_uart_inf[pdev->id]); 131 - } 132 - 133 - static struct platform_driver s5p_serial_driver = { 134 - .probe = s5p_serial_probe, 135 - .remove = __devexit_p(s3c24xx_serial_remove), 136 - .driver = { 137 - .name = "s5pv210-uart", 138 - .owner = THIS_MODULE, 139 - }, 140 - }; 141 - 142 - static int __init s5p_serial_init(void) 143 - { 144 - return s3c24xx_serial_init(&s5p_serial_driver, *s5p_uart_inf); 145 - } 146 - 147 - static void __exit s5p_serial_exit(void) 148 - { 149 - platform_driver_unregister(&s5p_serial_driver); 150 - } 151 - 152 - module_init(s5p_serial_init); 153 - module_exit(s5p_serial_exit); 154 - 155 - MODULE_LICENSE("GPL"); 156 - MODULE_ALIAS("platform:s5pv210-uart"); 157 - MODULE_DESCRIPTION("Samsung S5PV210 UART Driver support"); 158 - MODULE_AUTHOR("Thomas Abraham <thomas.ab@samsung.com>");
+390 -265
drivers/tty/serial/samsung.c
··· 42 42 #include <linux/delay.h> 43 43 #include <linux/clk.h> 44 44 #include <linux/cpufreq.h> 45 + #include <linux/of.h> 45 46 46 47 #include <asm/irq.h> 47 48 ··· 50 49 #include <mach/map.h> 51 50 52 51 #include <plat/regs-serial.h> 52 + #include <plat/clock.h> 53 53 54 54 #include "samsung.h" 55 55 ··· 192 190 193 191 static inline struct s3c2410_uartcfg *s3c24xx_port_to_cfg(struct uart_port *port) 194 192 { 193 + struct s3c24xx_uart_port *ourport; 194 + 195 195 if (port->dev == NULL) 196 196 return NULL; 197 197 198 - return (struct s3c2410_uartcfg *)port->dev->platform_data; 198 + ourport = container_of(port, struct s3c24xx_uart_port, port); 199 + return ourport->cfg; 199 200 } 200 201 201 202 static int s3c24xx_serial_rx_fifocnt(struct s3c24xx_uart_port *ourport, ··· 207 202 struct s3c24xx_uart_info *info = ourport->info; 208 203 209 204 if (ufstat & info->rx_fifofull) 210 - return info->fifosize; 205 + return ourport->port.fifosize; 211 206 212 207 return (ufstat & info->rx_fifomask) >> info->rx_fifoshift; 213 208 } ··· 560 555 * 561 556 */ 562 557 558 + #define MAX_CLK_NAME_LENGTH 15 563 559 564 - #define MAX_CLKS (8) 565 - 566 - static struct s3c24xx_uart_clksrc tmp_clksrc = { 567 - .name = "pclk", 568 - .min_baud = 0, 569 - .max_baud = 0, 570 - .divisor = 1, 571 - }; 572 - 573 - static inline int 574 - s3c24xx_serial_getsource(struct uart_port *port, struct s3c24xx_uart_clksrc *c) 560 + static inline int s3c24xx_serial_getsource(struct uart_port *port) 575 561 { 576 562 struct s3c24xx_uart_info *info = s3c24xx_port_to_info(port); 563 + unsigned int ucon; 577 564 578 - return (info->get_clksrc)(port, c); 579 - } 580 - 581 - static inline int 582 - s3c24xx_serial_setsource(struct uart_port *port, struct s3c24xx_uart_clksrc *c) 583 - { 584 - struct s3c24xx_uart_info *info = s3c24xx_port_to_info(port); 585 - 586 - return (info->set_clksrc)(port, c); 587 - } 588 - 589 - struct baud_calc { 590 - struct s3c24xx_uart_clksrc *clksrc; 591 - unsigned int calc; 592 - unsigned int divslot; 593 - unsigned int quot; 594 - struct clk *src; 595 - }; 596 - 597 - static int s3c24xx_serial_calcbaud(struct baud_calc *calc, 598 - struct uart_port *port, 599 - struct s3c24xx_uart_clksrc *clksrc, 600 - unsigned int baud) 601 - { 602 - struct s3c24xx_uart_port *ourport = to_ourport(port); 603 - unsigned long rate; 604 - 605 - calc->src = clk_get(port->dev, clksrc->name); 606 - if (calc->src == NULL || IS_ERR(calc->src)) 565 + if (info->num_clks == 1) 607 566 return 0; 608 567 609 - rate = clk_get_rate(calc->src); 610 - rate /= clksrc->divisor; 611 - 612 - calc->clksrc = clksrc; 613 - 614 - if (ourport->info->has_divslot) { 615 - unsigned long div = rate / baud; 616 - 617 - /* The UDIVSLOT register on the newer UARTs allows us to 618 - * get a divisor adjustment of 1/16th on the baud clock. 619 - * 620 - * We don't keep the UDIVSLOT value (the 16ths we calculated 621 - * by not multiplying the baud by 16) as it is easy enough 622 - * to recalculate. 623 - */ 624 - 625 - calc->quot = div / 16; 626 - calc->calc = rate / div; 627 - } else { 628 - calc->quot = (rate + (8 * baud)) / (16 * baud); 629 - calc->calc = (rate / (calc->quot * 16)); 630 - } 631 - 632 - calc->quot--; 633 - return 1; 568 + ucon = rd_regl(port, S3C2410_UCON); 569 + ucon &= info->clksel_mask; 570 + return ucon >> info->clksel_shift; 634 571 } 635 572 636 - static unsigned int s3c24xx_serial_getclk(struct uart_port *port, 637 - struct s3c24xx_uart_clksrc **clksrc, 638 - struct clk **clk, 639 - unsigned int baud) 573 + static void s3c24xx_serial_setsource(struct uart_port *port, 574 + unsigned int clk_sel) 640 575 { 641 - struct s3c2410_uartcfg *cfg = s3c24xx_port_to_cfg(port); 642 - struct s3c24xx_uart_clksrc *clkp; 643 - struct baud_calc res[MAX_CLKS]; 644 - struct baud_calc *resptr, *best, *sptr; 645 - int i; 576 + struct s3c24xx_uart_info *info = s3c24xx_port_to_info(port); 577 + unsigned int ucon; 646 578 647 - clkp = cfg->clocks; 648 - best = NULL; 579 + if (info->num_clks == 1) 580 + return; 649 581 650 - if (cfg->clocks_size < 2) { 651 - if (cfg->clocks_size == 0) 652 - clkp = &tmp_clksrc; 582 + ucon = rd_regl(port, S3C2410_UCON); 583 + if ((ucon & info->clksel_mask) >> info->clksel_shift == clk_sel) 584 + return; 653 585 654 - /* check to see if we're sourcing fclk, and if so we're 655 - * going to have to update the clock source 656 - */ 586 + ucon &= ~info->clksel_mask; 587 + ucon |= clk_sel << info->clksel_shift; 588 + wr_regl(port, S3C2410_UCON, ucon); 589 + } 657 590 658 - if (strcmp(clkp->name, "fclk") == 0) { 659 - struct s3c24xx_uart_clksrc src; 591 + static unsigned int s3c24xx_serial_getclk(struct s3c24xx_uart_port *ourport, 592 + unsigned int req_baud, struct clk **best_clk, 593 + unsigned int *clk_num) 594 + { 595 + struct s3c24xx_uart_info *info = ourport->info; 596 + struct clk *clk; 597 + unsigned long rate; 598 + unsigned int cnt, baud, quot, clk_sel, best_quot = 0; 599 + char clkname[MAX_CLK_NAME_LENGTH]; 600 + int calc_deviation, deviation = (1 << 30) - 1; 660 601 661 - s3c24xx_serial_getsource(port, &src); 602 + *best_clk = NULL; 603 + clk_sel = (ourport->cfg->clk_sel) ? ourport->cfg->clk_sel : 604 + ourport->info->def_clk_sel; 605 + for (cnt = 0; cnt < info->num_clks; cnt++) { 606 + if (!(clk_sel & (1 << cnt))) 607 + continue; 662 608 663 - /* check that the port already using fclk, and if 664 - * not, then re-select fclk 609 + sprintf(clkname, "clk_uart_baud%d", cnt); 610 + clk = clk_get(ourport->port.dev, clkname); 611 + if (IS_ERR_OR_NULL(clk)) 612 + continue; 613 + 614 + rate = clk_get_rate(clk); 615 + if (!rate) 616 + continue; 617 + 618 + if (ourport->info->has_divslot) { 619 + unsigned long div = rate / req_baud; 620 + 621 + /* The UDIVSLOT register on the newer UARTs allows us to 622 + * get a divisor adjustment of 1/16th on the baud clock. 623 + * 624 + * We don't keep the UDIVSLOT value (the 16ths we 625 + * calculated by not multiplying the baud by 16) as it 626 + * is easy enough to recalculate. 665 627 */ 666 628 667 - if (strcmp(src.name, clkp->name) == 0) { 668 - s3c24xx_serial_setsource(port, clkp); 669 - s3c24xx_serial_getsource(port, &src); 670 - } 671 - 672 - clkp->divisor = src.divisor; 629 + quot = div / 16; 630 + baud = rate / div; 631 + } else { 632 + quot = (rate + (8 * req_baud)) / (16 * req_baud); 633 + baud = rate / (quot * 16); 673 634 } 635 + quot--; 674 636 675 - s3c24xx_serial_calcbaud(res, port, clkp, baud); 676 - best = res; 677 - resptr = best + 1; 678 - } else { 679 - resptr = res; 637 + calc_deviation = req_baud - baud; 638 + if (calc_deviation < 0) 639 + calc_deviation = -calc_deviation; 680 640 681 - for (i = 0; i < cfg->clocks_size; i++, clkp++) { 682 - if (s3c24xx_serial_calcbaud(resptr, port, clkp, baud)) 683 - resptr++; 684 - } 685 - } 686 - 687 - /* ok, we now need to select the best clock we found */ 688 - 689 - if (!best) { 690 - unsigned int deviation = (1<<30)|((1<<30)-1); 691 - int calc_deviation; 692 - 693 - for (sptr = res; sptr < resptr; sptr++) { 694 - calc_deviation = baud - sptr->calc; 695 - if (calc_deviation < 0) 696 - calc_deviation = -calc_deviation; 697 - 698 - if (calc_deviation < deviation) { 699 - best = sptr; 700 - deviation = calc_deviation; 701 - } 641 + if (calc_deviation < deviation) { 642 + *best_clk = clk; 643 + best_quot = quot; 644 + *clk_num = cnt; 645 + deviation = calc_deviation; 702 646 } 703 647 } 704 648 705 - /* store results to pass back */ 706 - 707 - *clksrc = best->clksrc; 708 - *clk = best->src; 709 - 710 - return best->quot; 649 + return best_quot; 711 650 } 712 651 713 652 /* udivslot_table[] ··· 684 735 { 685 736 struct s3c2410_uartcfg *cfg = s3c24xx_port_to_cfg(port); 686 737 struct s3c24xx_uart_port *ourport = to_ourport(port); 687 - struct s3c24xx_uart_clksrc *clksrc = NULL; 688 738 struct clk *clk = NULL; 689 739 unsigned long flags; 690 - unsigned int baud, quot; 740 + unsigned int baud, quot, clk_sel = 0; 691 741 unsigned int ulcon; 692 742 unsigned int umcon; 693 743 unsigned int udivslot = 0; ··· 702 754 */ 703 755 704 756 baud = uart_get_baud_rate(port, termios, old, 0, 115200*8); 705 - 757 + quot = s3c24xx_serial_getclk(ourport, baud, &clk, &clk_sel); 706 758 if (baud == 38400 && (port->flags & UPF_SPD_MASK) == UPF_SPD_CUST) 707 759 quot = port->custom_divisor; 708 - else 709 - quot = s3c24xx_serial_getclk(port, &clksrc, &clk, baud); 760 + if (!clk) 761 + return; 710 762 711 763 /* check to see if we need to change clock source */ 712 764 713 - if (ourport->clksrc != clksrc || ourport->baudclk != clk) { 714 - dbg("selecting clock %p\n", clk); 715 - s3c24xx_serial_setsource(port, clksrc); 765 + if (ourport->baudclk != clk) { 766 + s3c24xx_serial_setsource(port, clk_sel); 716 767 717 768 if (ourport->baudclk != NULL && !IS_ERR(ourport->baudclk)) { 718 769 clk_disable(ourport->baudclk); ··· 720 773 721 774 clk_enable(clk); 722 775 723 - ourport->clksrc = clksrc; 724 776 ourport->baudclk = clk; 725 777 ourport->baudclk_rate = clk ? clk_get_rate(clk) : 0; 726 778 } ··· 966 1020 967 1021 /* s3c24xx_serial_resetport 968 1022 * 969 - * wrapper to call the specific reset for this port (reset the fifos 970 - * and the settings) 1023 + * reset the fifos and other the settings. 971 1024 */ 972 1025 973 - static inline int s3c24xx_serial_resetport(struct uart_port *port, 974 - struct s3c2410_uartcfg *cfg) 1026 + static void s3c24xx_serial_resetport(struct uart_port *port, 1027 + struct s3c2410_uartcfg *cfg) 975 1028 { 976 1029 struct s3c24xx_uart_info *info = s3c24xx_port_to_info(port); 1030 + unsigned long ucon = rd_regl(port, S3C2410_UCON); 1031 + unsigned int ucon_mask; 977 1032 978 - return (info->reset_port)(port, cfg); 1033 + ucon_mask = info->clksel_mask; 1034 + if (info->type == PORT_S3C2440) 1035 + ucon_mask |= S3C2440_UCON0_DIVMASK; 1036 + 1037 + ucon &= ucon_mask; 1038 + wr_regl(port, S3C2410_UCON, ucon | cfg->ucon); 1039 + 1040 + /* reset both fifos */ 1041 + wr_regl(port, S3C2410_UFCON, cfg->ufcon | S3C2410_UFCON_RESETBOTH); 1042 + wr_regl(port, S3C2410_UFCON, cfg->ufcon); 1043 + 1044 + /* some delay is required after fifo reset */ 1045 + udelay(1); 979 1046 } 980 1047 981 1048 ··· 1080 1121 */ 1081 1122 1082 1123 static int s3c24xx_serial_init_port(struct s3c24xx_uart_port *ourport, 1083 - struct s3c24xx_uart_info *info, 1084 1124 struct platform_device *platdev) 1085 1125 { 1086 1126 struct uart_port *port = &ourport->port; 1087 - struct s3c2410_uartcfg *cfg; 1127 + struct s3c2410_uartcfg *cfg = ourport->cfg; 1088 1128 struct resource *res; 1089 1129 int ret; 1090 1130 ··· 1092 1134 if (platdev == NULL) 1093 1135 return -ENODEV; 1094 1136 1095 - cfg = s3c24xx_dev_to_cfg(&platdev->dev); 1096 - 1097 1137 if (port->mapbase != 0) 1098 1138 return 0; 1099 1139 1100 - if (cfg->hwport > CONFIG_SERIAL_SAMSUNG_UARTS) { 1101 - printk(KERN_ERR "%s: port %d bigger than %d\n", __func__, 1102 - cfg->hwport, CONFIG_SERIAL_SAMSUNG_UARTS); 1103 - return -ERANGE; 1104 - } 1105 - 1106 1140 /* setup info for port */ 1107 1141 port->dev = &platdev->dev; 1108 - ourport->info = info; 1109 1142 1110 1143 /* Startup sequence is different for s3c64xx and higher SoC's */ 1111 1144 if (s3c24xx_serial_has_interrupt_mask(port)) 1112 1145 s3c24xx_serial_ops.startup = s3c64xx_serial_startup; 1113 - 1114 - /* copy the info in from provided structure */ 1115 - ourport->port.fifosize = info->fifosize; 1116 - 1117 - dbg("s3c24xx_serial_init_port: %p (hw %d)...\n", port, cfg->hwport); 1118 1146 1119 1147 port->uartclk = 1; 1120 1148 ··· 1159 1215 struct uart_port *port = s3c24xx_dev_to_port(dev); 1160 1216 struct s3c24xx_uart_port *ourport = to_ourport(port); 1161 1217 1162 - return snprintf(buf, PAGE_SIZE, "* %s\n", ourport->clksrc->name); 1218 + return snprintf(buf, PAGE_SIZE, "* %s\n", ourport->baudclk->name); 1163 1219 } 1164 1220 1165 1221 static DEVICE_ATTR(clock_source, S_IRUGO, s3c24xx_serial_show_clksrc, NULL); 1166 1222 1223 + 1167 1224 /* Device driver serial port probe */ 1168 1225 1226 + static const struct of_device_id s3c24xx_uart_dt_match[]; 1169 1227 static int probe_index; 1170 1228 1171 - int s3c24xx_serial_probe(struct platform_device *dev, 1172 - struct s3c24xx_uart_info *info) 1229 + static inline struct s3c24xx_serial_drv_data *s3c24xx_get_driver_data( 1230 + struct platform_device *pdev) 1231 + { 1232 + #ifdef CONFIG_OF 1233 + if (pdev->dev.of_node) { 1234 + const struct of_device_id *match; 1235 + match = of_match_node(s3c24xx_uart_dt_match, pdev->dev.of_node); 1236 + return (struct s3c24xx_serial_drv_data *)match->data; 1237 + } 1238 + #endif 1239 + return (struct s3c24xx_serial_drv_data *) 1240 + platform_get_device_id(pdev)->driver_data; 1241 + } 1242 + 1243 + static int s3c24xx_serial_probe(struct platform_device *pdev) 1173 1244 { 1174 1245 struct s3c24xx_uart_port *ourport; 1175 1246 int ret; 1176 1247 1177 - dbg("s3c24xx_serial_probe(%p, %p) %d\n", dev, info, probe_index); 1248 + dbg("s3c24xx_serial_probe(%p) %d\n", pdev, probe_index); 1178 1249 1179 1250 ourport = &s3c24xx_serial_ports[probe_index]; 1251 + 1252 + ourport->drv_data = s3c24xx_get_driver_data(pdev); 1253 + if (!ourport->drv_data) { 1254 + dev_err(&pdev->dev, "could not find driver data\n"); 1255 + return -ENODEV; 1256 + } 1257 + 1258 + ourport->info = ourport->drv_data->info; 1259 + ourport->cfg = (pdev->dev.platform_data) ? 1260 + (struct s3c2410_uartcfg *)pdev->dev.platform_data : 1261 + ourport->drv_data->def_cfg; 1262 + 1263 + ourport->port.fifosize = (ourport->info->fifosize) ? 1264 + ourport->info->fifosize : 1265 + ourport->drv_data->fifosize[probe_index]; 1266 + 1180 1267 probe_index++; 1181 1268 1182 1269 dbg("%s: initialising port %p...\n", __func__, ourport); 1183 1270 1184 - ret = s3c24xx_serial_init_port(ourport, info, dev); 1271 + ret = s3c24xx_serial_init_port(ourport, pdev); 1185 1272 if (ret < 0) 1186 1273 goto probe_err; 1187 1274 1188 1275 dbg("%s: adding port\n", __func__); 1189 1276 uart_add_one_port(&s3c24xx_uart_drv, &ourport->port); 1190 - platform_set_drvdata(dev, &ourport->port); 1277 + platform_set_drvdata(pdev, &ourport->port); 1191 1278 1192 - ret = device_create_file(&dev->dev, &dev_attr_clock_source); 1279 + ret = device_create_file(&pdev->dev, &dev_attr_clock_source); 1193 1280 if (ret < 0) 1194 - printk(KERN_ERR "%s: failed to add clksrc attr.\n", __func__); 1281 + dev_err(&pdev->dev, "failed to add clock source attr.\n"); 1195 1282 1196 1283 ret = s3c24xx_serial_cpufreq_register(ourport); 1197 1284 if (ret < 0) 1198 - dev_err(&dev->dev, "failed to add cpufreq notifier\n"); 1285 + dev_err(&pdev->dev, "failed to add cpufreq notifier\n"); 1199 1286 1200 1287 return 0; 1201 1288 ··· 1234 1259 return ret; 1235 1260 } 1236 1261 1237 - EXPORT_SYMBOL_GPL(s3c24xx_serial_probe); 1238 - 1239 - int __devexit s3c24xx_serial_remove(struct platform_device *dev) 1262 + static int __devexit s3c24xx_serial_remove(struct platform_device *dev) 1240 1263 { 1241 1264 struct uart_port *port = s3c24xx_dev_to_port(&dev->dev); 1242 1265 ··· 1246 1273 1247 1274 return 0; 1248 1275 } 1249 - 1250 - EXPORT_SYMBOL_GPL(s3c24xx_serial_remove); 1251 1276 1252 1277 /* UART power management code */ 1253 1278 #ifdef CONFIG_PM_SLEEP ··· 1285 1314 1286 1315 #define SERIAL_SAMSUNG_PM_OPS NULL 1287 1316 #endif /* CONFIG_PM_SLEEP */ 1288 - 1289 - int s3c24xx_serial_init(struct platform_driver *drv, 1290 - struct s3c24xx_uart_info *info) 1291 - { 1292 - dbg("s3c24xx_serial_init(%p,%p)\n", drv, info); 1293 - 1294 - drv->driver.pm = SERIAL_SAMSUNG_PM_OPS; 1295 - 1296 - return platform_driver_register(drv); 1297 - } 1298 - 1299 - EXPORT_SYMBOL_GPL(s3c24xx_serial_init); 1300 - 1301 - /* module initialisation code */ 1302 - 1303 - static int __init s3c24xx_serial_modinit(void) 1304 - { 1305 - int ret; 1306 - 1307 - ret = uart_register_driver(&s3c24xx_uart_drv); 1308 - if (ret < 0) { 1309 - printk(KERN_ERR "failed to register UART driver\n"); 1310 - return -1; 1311 - } 1312 - 1313 - return 0; 1314 - } 1315 - 1316 - static void __exit s3c24xx_serial_modexit(void) 1317 - { 1318 - uart_unregister_driver(&s3c24xx_uart_drv); 1319 - } 1320 - 1321 - module_init(s3c24xx_serial_modinit); 1322 - module_exit(s3c24xx_serial_modexit); 1323 1317 1324 1318 /* Console code */ 1325 1319 ··· 1331 1395 s3c24xx_serial_get_options(struct uart_port *port, int *baud, 1332 1396 int *parity, int *bits) 1333 1397 { 1334 - struct s3c24xx_uart_clksrc clksrc; 1335 1398 struct clk *clk; 1336 1399 unsigned int ulcon; 1337 1400 unsigned int ucon; 1338 1401 unsigned int ubrdiv; 1339 1402 unsigned long rate; 1403 + unsigned int clk_sel; 1404 + char clk_name[MAX_CLK_NAME_LENGTH]; 1340 1405 1341 1406 ulcon = rd_regl(port, S3C2410_ULCON); 1342 1407 ucon = rd_regl(port, S3C2410_UCON); ··· 1382 1445 1383 1446 /* now calculate the baud rate */ 1384 1447 1385 - s3c24xx_serial_getsource(port, &clksrc); 1448 + clk_sel = s3c24xx_serial_getsource(port); 1449 + sprintf(clk_name, "clk_uart_baud%d", clk_sel); 1386 1450 1387 - clk = clk_get(port->dev, clksrc.name); 1451 + clk = clk_get(port->dev, clk_name); 1388 1452 if (!IS_ERR(clk) && clk != NULL) 1389 - rate = clk_get_rate(clk) / clksrc.divisor; 1453 + rate = clk_get_rate(clk); 1390 1454 else 1391 1455 rate = 1; 1392 - 1393 1456 1394 1457 *baud = rate / (16 * (ubrdiv + 1)); 1395 1458 dbg("calculated baud %d\n", *baud); 1396 1459 } 1397 1460 1398 - } 1399 - 1400 - /* s3c24xx_serial_init_ports 1401 - * 1402 - * initialise the serial ports from the machine provided initialisation 1403 - * data. 1404 - */ 1405 - 1406 - static int s3c24xx_serial_init_ports(struct s3c24xx_uart_info **info) 1407 - { 1408 - struct s3c24xx_uart_port *ptr = s3c24xx_serial_ports; 1409 - struct platform_device **platdev_ptr; 1410 - int i; 1411 - 1412 - dbg("s3c24xx_serial_init_ports: initialising ports...\n"); 1413 - 1414 - platdev_ptr = s3c24xx_uart_devs; 1415 - 1416 - for (i = 0; i < CONFIG_SERIAL_SAMSUNG_UARTS; i++, ptr++, platdev_ptr++) { 1417 - s3c24xx_serial_init_port(ptr, info[i], *platdev_ptr); 1418 - } 1419 - 1420 - return 0; 1421 1461 } 1422 1462 1423 1463 static int __init ··· 1440 1526 return uart_set_options(port, co, baud, parity, bits, flow); 1441 1527 } 1442 1528 1443 - /* s3c24xx_serial_initconsole 1444 - * 1445 - * initialise the console from one of the uart drivers 1446 - */ 1447 - 1448 1529 static struct console s3c24xx_serial_console = { 1449 1530 .name = S3C24XX_SERIAL_NAME, 1450 1531 .device = uart_console_device, ··· 1449 1540 .setup = s3c24xx_serial_console_setup, 1450 1541 .data = &s3c24xx_uart_drv, 1451 1542 }; 1452 - 1453 - int s3c24xx_serial_initconsole(struct platform_driver *drv, 1454 - struct s3c24xx_uart_info **info) 1455 - 1456 - { 1457 - struct platform_device *dev = s3c24xx_uart_devs[0]; 1458 - 1459 - dbg("s3c24xx_serial_initconsole\n"); 1460 - 1461 - /* select driver based on the cpu */ 1462 - 1463 - if (dev == NULL) { 1464 - printk(KERN_ERR "s3c24xx: no devices for console init\n"); 1465 - return 0; 1466 - } 1467 - 1468 - if (strcmp(dev->name, drv->driver.name) != 0) 1469 - return 0; 1470 - 1471 - s3c24xx_serial_console.data = &s3c24xx_uart_drv; 1472 - s3c24xx_serial_init_ports(info); 1473 - 1474 - register_console(&s3c24xx_serial_console); 1475 - return 0; 1476 - } 1477 - 1478 1543 #endif /* CONFIG_SERIAL_SAMSUNG_CONSOLE */ 1479 1544 1545 + #ifdef CONFIG_CPU_S3C2410 1546 + static struct s3c24xx_serial_drv_data s3c2410_serial_drv_data = { 1547 + .info = &(struct s3c24xx_uart_info) { 1548 + .name = "Samsung S3C2410 UART", 1549 + .type = PORT_S3C2410, 1550 + .fifosize = 16, 1551 + .rx_fifomask = S3C2410_UFSTAT_RXMASK, 1552 + .rx_fifoshift = S3C2410_UFSTAT_RXSHIFT, 1553 + .rx_fifofull = S3C2410_UFSTAT_RXFULL, 1554 + .tx_fifofull = S3C2410_UFSTAT_TXFULL, 1555 + .tx_fifomask = S3C2410_UFSTAT_TXMASK, 1556 + .tx_fifoshift = S3C2410_UFSTAT_TXSHIFT, 1557 + .def_clk_sel = S3C2410_UCON_CLKSEL0, 1558 + .num_clks = 2, 1559 + .clksel_mask = S3C2410_UCON_CLKMASK, 1560 + .clksel_shift = S3C2410_UCON_CLKSHIFT, 1561 + }, 1562 + .def_cfg = &(struct s3c2410_uartcfg) { 1563 + .ucon = S3C2410_UCON_DEFAULT, 1564 + .ufcon = S3C2410_UFCON_DEFAULT, 1565 + }, 1566 + }; 1567 + #define S3C2410_SERIAL_DRV_DATA ((kernel_ulong_t)&s3c2410_serial_drv_data) 1568 + #else 1569 + #define S3C2410_SERIAL_DRV_DATA (kernel_ulong_t)NULL 1570 + #endif 1571 + 1572 + #ifdef CONFIG_CPU_S3C2412 1573 + static struct s3c24xx_serial_drv_data s3c2412_serial_drv_data = { 1574 + .info = &(struct s3c24xx_uart_info) { 1575 + .name = "Samsung S3C2412 UART", 1576 + .type = PORT_S3C2412, 1577 + .fifosize = 64, 1578 + .has_divslot = 1, 1579 + .rx_fifomask = S3C2440_UFSTAT_RXMASK, 1580 + .rx_fifoshift = S3C2440_UFSTAT_RXSHIFT, 1581 + .rx_fifofull = S3C2440_UFSTAT_RXFULL, 1582 + .tx_fifofull = S3C2440_UFSTAT_TXFULL, 1583 + .tx_fifomask = S3C2440_UFSTAT_TXMASK, 1584 + .tx_fifoshift = S3C2440_UFSTAT_TXSHIFT, 1585 + .def_clk_sel = S3C2410_UCON_CLKSEL2, 1586 + .num_clks = 4, 1587 + .clksel_mask = S3C2412_UCON_CLKMASK, 1588 + .clksel_shift = S3C2412_UCON_CLKSHIFT, 1589 + }, 1590 + .def_cfg = &(struct s3c2410_uartcfg) { 1591 + .ucon = S3C2410_UCON_DEFAULT, 1592 + .ufcon = S3C2410_UFCON_DEFAULT, 1593 + }, 1594 + }; 1595 + #define S3C2412_SERIAL_DRV_DATA ((kernel_ulong_t)&s3c2412_serial_drv_data) 1596 + #else 1597 + #define S3C2412_SERIAL_DRV_DATA (kernel_ulong_t)NULL 1598 + #endif 1599 + 1600 + #if defined(CONFIG_CPU_S3C2440) || defined(CONFIG_CPU_S3C2416) || \ 1601 + defined(CONFIG_CPU_S3C2443) 1602 + static struct s3c24xx_serial_drv_data s3c2440_serial_drv_data = { 1603 + .info = &(struct s3c24xx_uart_info) { 1604 + .name = "Samsung S3C2440 UART", 1605 + .type = PORT_S3C2440, 1606 + .fifosize = 64, 1607 + .has_divslot = 1, 1608 + .rx_fifomask = S3C2440_UFSTAT_RXMASK, 1609 + .rx_fifoshift = S3C2440_UFSTAT_RXSHIFT, 1610 + .rx_fifofull = S3C2440_UFSTAT_RXFULL, 1611 + .tx_fifofull = S3C2440_UFSTAT_TXFULL, 1612 + .tx_fifomask = S3C2440_UFSTAT_TXMASK, 1613 + .tx_fifoshift = S3C2440_UFSTAT_TXSHIFT, 1614 + .def_clk_sel = S3C2410_UCON_CLKSEL2, 1615 + .num_clks = 4, 1616 + .clksel_mask = S3C2412_UCON_CLKMASK, 1617 + .clksel_shift = S3C2412_UCON_CLKSHIFT, 1618 + }, 1619 + .def_cfg = &(struct s3c2410_uartcfg) { 1620 + .ucon = S3C2410_UCON_DEFAULT, 1621 + .ufcon = S3C2410_UFCON_DEFAULT, 1622 + }, 1623 + }; 1624 + #define S3C2440_SERIAL_DRV_DATA ((kernel_ulong_t)&s3c2440_serial_drv_data) 1625 + #else 1626 + #define S3C2440_SERIAL_DRV_DATA (kernel_ulong_t)NULL 1627 + #endif 1628 + 1629 + #if defined(CONFIG_CPU_S3C6400) || defined(CONFIG_CPU_S3C6410) || \ 1630 + defined(CONFIG_CPU_S5P6440) || defined(CONFIG_CPU_S5P6450) || \ 1631 + defined(CONFIG_CPU_S5PC100) 1632 + static struct s3c24xx_serial_drv_data s3c6400_serial_drv_data = { 1633 + .info = &(struct s3c24xx_uart_info) { 1634 + .name = "Samsung S3C6400 UART", 1635 + .type = PORT_S3C6400, 1636 + .fifosize = 64, 1637 + .has_divslot = 1, 1638 + .rx_fifomask = S3C2440_UFSTAT_RXMASK, 1639 + .rx_fifoshift = S3C2440_UFSTAT_RXSHIFT, 1640 + .rx_fifofull = S3C2440_UFSTAT_RXFULL, 1641 + .tx_fifofull = S3C2440_UFSTAT_TXFULL, 1642 + .tx_fifomask = S3C2440_UFSTAT_TXMASK, 1643 + .tx_fifoshift = S3C2440_UFSTAT_TXSHIFT, 1644 + .def_clk_sel = S3C2410_UCON_CLKSEL2, 1645 + .num_clks = 4, 1646 + .clksel_mask = S3C6400_UCON_CLKMASK, 1647 + .clksel_shift = S3C6400_UCON_CLKSHIFT, 1648 + }, 1649 + .def_cfg = &(struct s3c2410_uartcfg) { 1650 + .ucon = S3C2410_UCON_DEFAULT, 1651 + .ufcon = S3C2410_UFCON_DEFAULT, 1652 + }, 1653 + }; 1654 + #define S3C6400_SERIAL_DRV_DATA ((kernel_ulong_t)&s3c6400_serial_drv_data) 1655 + #else 1656 + #define S3C6400_SERIAL_DRV_DATA (kernel_ulong_t)NULL 1657 + #endif 1658 + 1659 + #ifdef CONFIG_CPU_S5PV210 1660 + static struct s3c24xx_serial_drv_data s5pv210_serial_drv_data = { 1661 + .info = &(struct s3c24xx_uart_info) { 1662 + .name = "Samsung S5PV210 UART", 1663 + .type = PORT_S3C6400, 1664 + .has_divslot = 1, 1665 + .rx_fifomask = S5PV210_UFSTAT_RXMASK, 1666 + .rx_fifoshift = S5PV210_UFSTAT_RXSHIFT, 1667 + .rx_fifofull = S5PV210_UFSTAT_RXFULL, 1668 + .tx_fifofull = S5PV210_UFSTAT_TXFULL, 1669 + .tx_fifomask = S5PV210_UFSTAT_TXMASK, 1670 + .tx_fifoshift = S5PV210_UFSTAT_TXSHIFT, 1671 + .def_clk_sel = S3C2410_UCON_CLKSEL0, 1672 + .num_clks = 2, 1673 + .clksel_mask = S5PV210_UCON_CLKMASK, 1674 + .clksel_shift = S5PV210_UCON_CLKSHIFT, 1675 + }, 1676 + .def_cfg = &(struct s3c2410_uartcfg) { 1677 + .ucon = S5PV210_UCON_DEFAULT, 1678 + .ufcon = S5PV210_UFCON_DEFAULT, 1679 + }, 1680 + .fifosize = { 256, 64, 16, 16 }, 1681 + }; 1682 + #define S5PV210_SERIAL_DRV_DATA ((kernel_ulong_t)&s5pv210_serial_drv_data) 1683 + #else 1684 + #define S5PV210_SERIAL_DRV_DATA (kernel_ulong_t)NULL 1685 + #endif 1686 + 1687 + #ifdef CONFIG_CPU_EXYNOS4210 1688 + static struct s3c24xx_serial_drv_data exynos4210_serial_drv_data = { 1689 + .info = &(struct s3c24xx_uart_info) { 1690 + .name = "Samsung Exynos4 UART", 1691 + .type = PORT_S3C6400, 1692 + .has_divslot = 1, 1693 + .rx_fifomask = S5PV210_UFSTAT_RXMASK, 1694 + .rx_fifoshift = S5PV210_UFSTAT_RXSHIFT, 1695 + .rx_fifofull = S5PV210_UFSTAT_RXFULL, 1696 + .tx_fifofull = S5PV210_UFSTAT_TXFULL, 1697 + .tx_fifomask = S5PV210_UFSTAT_TXMASK, 1698 + .tx_fifoshift = S5PV210_UFSTAT_TXSHIFT, 1699 + .def_clk_sel = S3C2410_UCON_CLKSEL0, 1700 + .num_clks = 1, 1701 + .clksel_mask = 0, 1702 + .clksel_shift = 0, 1703 + }, 1704 + .def_cfg = &(struct s3c2410_uartcfg) { 1705 + .ucon = S5PV210_UCON_DEFAULT, 1706 + .ufcon = S5PV210_UFCON_DEFAULT, 1707 + .has_fracval = 1, 1708 + }, 1709 + .fifosize = { 256, 64, 16, 16 }, 1710 + }; 1711 + #define EXYNOS4210_SERIAL_DRV_DATA ((kernel_ulong_t)&exynos4210_serial_drv_data) 1712 + #else 1713 + #define EXYNOS4210_SERIAL_DRV_DATA (kernel_ulong_t)NULL 1714 + #endif 1715 + 1716 + static struct platform_device_id s3c24xx_serial_driver_ids[] = { 1717 + { 1718 + .name = "s3c2410-uart", 1719 + .driver_data = S3C2410_SERIAL_DRV_DATA, 1720 + }, { 1721 + .name = "s3c2412-uart", 1722 + .driver_data = S3C2412_SERIAL_DRV_DATA, 1723 + }, { 1724 + .name = "s3c2440-uart", 1725 + .driver_data = S3C2440_SERIAL_DRV_DATA, 1726 + }, { 1727 + .name = "s3c6400-uart", 1728 + .driver_data = S3C6400_SERIAL_DRV_DATA, 1729 + }, { 1730 + .name = "s5pv210-uart", 1731 + .driver_data = S5PV210_SERIAL_DRV_DATA, 1732 + }, { 1733 + .name = "exynos4210-uart", 1734 + .driver_data = EXYNOS4210_SERIAL_DRV_DATA, 1735 + }, 1736 + { }, 1737 + }; 1738 + MODULE_DEVICE_TABLE(platform, s3c24xx_serial_driver_ids); 1739 + 1740 + #ifdef CONFIG_OF 1741 + static const struct of_device_id s3c24xx_uart_dt_match[] = { 1742 + { .compatible = "samsung,exynos4210-uart", 1743 + .data = (void *)EXYNOS4210_SERIAL_DRV_DATA }, 1744 + {}, 1745 + }; 1746 + MODULE_DEVICE_TABLE(of, s3c24xx_uart_dt_match); 1747 + #else 1748 + #define s3c24xx_uart_dt_match NULL 1749 + #endif 1750 + 1751 + static struct platform_driver samsung_serial_driver = { 1752 + .probe = s3c24xx_serial_probe, 1753 + .remove = __devexit_p(s3c24xx_serial_remove), 1754 + .id_table = s3c24xx_serial_driver_ids, 1755 + .driver = { 1756 + .name = "samsung-uart", 1757 + .owner = THIS_MODULE, 1758 + .pm = SERIAL_SAMSUNG_PM_OPS, 1759 + .of_match_table = s3c24xx_uart_dt_match, 1760 + }, 1761 + }; 1762 + 1763 + /* module initialisation code */ 1764 + 1765 + static int __init s3c24xx_serial_modinit(void) 1766 + { 1767 + int ret; 1768 + 1769 + ret = uart_register_driver(&s3c24xx_uart_drv); 1770 + if (ret < 0) { 1771 + printk(KERN_ERR "failed to register UART driver\n"); 1772 + return -1; 1773 + } 1774 + 1775 + return platform_driver_register(&samsung_serial_driver); 1776 + } 1777 + 1778 + static void __exit s3c24xx_serial_modexit(void) 1779 + { 1780 + uart_unregister_driver(&s3c24xx_uart_drv); 1781 + } 1782 + 1783 + module_init(s3c24xx_serial_modinit); 1784 + module_exit(s3c24xx_serial_modexit); 1785 + 1786 + MODULE_ALIAS("platform:samsung-uart"); 1480 1787 MODULE_DESCRIPTION("Samsung SoC Serial port driver"); 1481 1788 MODULE_AUTHOR("Ben Dooks <ben@simtec.co.uk>"); 1482 1789 MODULE_LICENSE("GPL v2");
+14 -18
drivers/tty/serial/samsung.h
··· 19 19 unsigned long tx_fifomask; 20 20 unsigned long tx_fifoshift; 21 21 unsigned long tx_fifofull; 22 + unsigned int def_clk_sel; 23 + unsigned long num_clks; 24 + unsigned long clksel_mask; 25 + unsigned long clksel_shift; 22 26 23 27 /* uart port features */ 24 28 25 29 unsigned int has_divslot:1; 26 30 27 - /* clock source control */ 28 - 29 - int (*get_clksrc)(struct uart_port *, struct s3c24xx_uart_clksrc *clk); 30 - int (*set_clksrc)(struct uart_port *, struct s3c24xx_uart_clksrc *clk); 31 - 32 31 /* uart controls */ 33 32 int (*reset_port)(struct uart_port *, struct s3c2410_uartcfg *); 33 + }; 34 + 35 + struct s3c24xx_serial_drv_data { 36 + struct s3c24xx_uart_info *info; 37 + struct s3c2410_uartcfg *def_cfg; 38 + unsigned int fifosize[CONFIG_SERIAL_SAMSUNG_UARTS]; 34 39 }; 35 40 36 41 struct s3c24xx_uart_port { ··· 48 43 unsigned int tx_irq; 49 44 50 45 struct s3c24xx_uart_info *info; 51 - struct s3c24xx_uart_clksrc *clksrc; 52 46 struct clk *clk; 53 47 struct clk *baudclk; 54 48 struct uart_port port; 49 + struct s3c24xx_serial_drv_data *drv_data; 50 + 51 + /* reference to platform data */ 52 + struct s3c2410_uartcfg *cfg; 55 53 56 54 #ifdef CONFIG_CPU_FREQ 57 55 struct notifier_block freq_transition; ··· 64 56 /* conversion functions */ 65 57 66 58 #define s3c24xx_dev_to_port(__dev) (struct uart_port *)dev_get_drvdata(__dev) 67 - #define s3c24xx_dev_to_cfg(__dev) (struct s3c2410_uartcfg *)((__dev)->platform_data) 68 59 69 60 /* register access controls */ 70 61 ··· 75 68 76 69 #define wr_regb(port, reg, val) __raw_writeb(val, portaddr(port, reg)) 77 70 #define wr_regl(port, reg, val) __raw_writel(val, portaddr(port, reg)) 78 - 79 - extern int s3c24xx_serial_probe(struct platform_device *dev, 80 - struct s3c24xx_uart_info *uart); 81 - 82 - extern int __devexit s3c24xx_serial_remove(struct platform_device *dev); 83 - 84 - extern int s3c24xx_serial_initconsole(struct platform_driver *drv, 85 - struct s3c24xx_uart_info **uart); 86 - 87 - extern int s3c24xx_serial_init(struct platform_driver *drv, 88 - struct s3c24xx_uart_info *info); 89 71 90 72 #ifdef CONFIG_SERIAL_SAMSUNG_DEBUG 91 73
+71
drivers/usb/host/ehci-tegra.c
··· 21 21 #include <linux/platform_data/tegra_usb.h> 22 22 #include <linux/irq.h> 23 23 #include <linux/usb/otg.h> 24 + #include <linux/gpio.h> 25 + #include <linux/of.h> 26 + #include <linux/of_gpio.h> 27 + 24 28 #include <mach/usb_phy.h> 29 + #include <mach/iomap.h> 25 30 26 31 #define TEGRA_USB_DMA_ALIGN 32 27 32 ··· 579 574 .port_handed_over = ehci_port_handed_over, 580 575 }; 581 576 577 + static int setup_vbus_gpio(struct platform_device *pdev) 578 + { 579 + int err = 0; 580 + int gpio; 581 + 582 + if (!pdev->dev.of_node) 583 + return 0; 584 + 585 + gpio = of_get_named_gpio(pdev->dev.of_node, "nvidia,vbus-gpio", 0); 586 + if (!gpio_is_valid(gpio)) 587 + return 0; 588 + 589 + err = gpio_request(gpio, "vbus_gpio"); 590 + if (err) { 591 + dev_err(&pdev->dev, "can't request vbus gpio %d", gpio); 592 + return err; 593 + } 594 + err = gpio_direction_output(gpio, 1); 595 + if (err) { 596 + dev_err(&pdev->dev, "can't enable vbus\n"); 597 + return err; 598 + } 599 + gpio_set_value(gpio, 1); 600 + 601 + return err; 602 + } 603 + 604 + static u64 tegra_ehci_dma_mask = DMA_BIT_MASK(32); 605 + 582 606 static int tegra_ehci_probe(struct platform_device *pdev) 583 607 { 584 608 struct resource *res; ··· 623 589 dev_err(&pdev->dev, "Platform data missing\n"); 624 590 return -EINVAL; 625 591 } 592 + 593 + /* Right now device-tree probed devices don't get dma_mask set. 594 + * Since shared usb code relies on it, set it here for now. 595 + * Once we have dma capability bindings this can go away. 596 + */ 597 + if (!pdev->dev.dma_mask) 598 + pdev->dev.dma_mask = &tegra_ehci_dma_mask; 599 + 600 + setup_vbus_gpio(pdev); 626 601 627 602 tegra = kzalloc(sizeof(struct tegra_ehci_hcd), GFP_KERNEL); 628 603 if (!tegra) ··· 681 638 dev_err(&pdev->dev, "Failed to remap I/O memory\n"); 682 639 err = -ENOMEM; 683 640 goto fail_io; 641 + } 642 + 643 + /* This is pretty ugly and needs to be fixed when we do only 644 + * device-tree probing. Old code relies on the platform_device 645 + * numbering that we lack for device-tree-instantiated devices. 646 + */ 647 + if (instance < 0) { 648 + switch (res->start) { 649 + case TEGRA_USB_BASE: 650 + instance = 0; 651 + break; 652 + case TEGRA_USB2_BASE: 653 + instance = 1; 654 + break; 655 + case TEGRA_USB3_BASE: 656 + instance = 2; 657 + break; 658 + default: 659 + err = -ENODEV; 660 + dev_err(&pdev->dev, "unknown usb instance\n"); 661 + goto fail_phy; 662 + } 684 663 } 685 664 686 665 tegra->phy = tegra_usb_phy_open(instance, hcd->regs, pdata->phy_config, ··· 838 773 hcd->driver->shutdown(hcd); 839 774 } 840 775 776 + static struct of_device_id tegra_ehci_of_match[] __devinitdata = { 777 + { .compatible = "nvidia,tegra20-ehci", }, 778 + { }, 779 + }; 780 + 841 781 static struct platform_driver tegra_ehci_driver = { 842 782 .probe = tegra_ehci_probe, 843 783 .remove = tegra_ehci_remove, ··· 853 783 .shutdown = tegra_ehci_hcd_shutdown, 854 784 .driver = { 855 785 .name = "tegra-ehci", 786 + .of_match_table = tegra_ehci_of_match, 856 787 } 857 788 };
+5 -10
include/linux/amba/pl330.h
··· 12 12 #ifndef __AMBA_PL330_H_ 13 13 #define __AMBA_PL330_H_ 14 14 15 + #include <linux/dmaengine.h> 15 16 #include <asm/hardware/pl330.h> 16 - 17 - struct dma_pl330_peri { 18 - /* 19 - * Peri_Req i/f of the DMAC that is 20 - * peripheral could be reached from. 21 - */ 22 - u8 peri_id; /* specific dma id */ 23 - enum pl330_reqtype rqtype; 24 - }; 25 17 26 18 struct dma_pl330_platdata { 27 19 /* ··· 25 33 */ 26 34 u8 nr_valid_peri; 27 35 /* Array of valid peripherals */ 28 - struct dma_pl330_peri *peri; 36 + u8 *peri_id; 37 + /* Operational capabilities */ 38 + dma_cap_mask_t cap_mask; 29 39 /* Bytes to allocate for MC buffer */ 30 40 unsigned mcbuf_sz; 31 41 }; 32 42 43 + extern bool pl330_filter(struct dma_chan *chan, void *param); 33 44 #endif /* __AMBA_PL330_H_ */