diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2013-07-02 17:23:01 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-07-02 17:23:01 -0400 |
| commit | ee1a8d402e7e204d57fb108aa40003b6d1633036 (patch) | |
| tree | 3abf4be63d11bbbd04c89bd668a17533f942b911 /drivers | |
| parent | 40e71e7015ab85c8606f50736525220948a3b24b (diff) | |
| parent | 9686bb66a4c50e43ffee903a9fc62237ee2de1e6 (diff) | |
Merge tag 'dt-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc
Pull ARM SoC device tree changes from Arnd Bergmann:
"These changes from 30 individual branches for the most part update
device tree files, but there are also a few source code changes that
have crept in this time, usually in order to atomically move over a
driver from using hardcoded data to DT probing.
A number of platforms change their DT files to use the C preprocessor,
which is causing a bit of churn, but that is hopefully only this once"
* tag 'dt-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (372 commits)
ARM: at91: dt: rm9200ek: add spi support
ARM: at91: dt: rm9200: add spi support
ARM: at91/DT: at91sam9n12: add SPI DMA client infos
ARM: at91/DT: sama5d3: add SPI DMA client infos
ARM: at91/DT: fix SPI compatibility string
ARM: Kirkwood: Fix the internal register ranges translation
ARM: dts: bcm281xx: change comment to C89 style
ARM: mmc: bcm281xx SDHCI driver (dt mods)
ARM: nomadik: add the new clocks to the device tree
clk: nomadik: implement the Nomadik clocks properly
ARM: dts: omap5-uevm: Provide USB Host PHY clock frequency
ARM: dts: omap4-panda: Fix DVI EDID reads
ARM: dts: omap4-panda: Add USB Host support
arm: mvebu: enable mini-PCIe connectors on Armada 370 RD
ARM: shmobile: irqpin: add a DT property to enable masking on parent
ARM: dts: AM43x EPOS EVM support
ARM: dts: OMAP5: Add bandgap DT entry
ARM: dts: AM33XX: Add pinmux configuration for CPSW to am335x EVM
ARM: dts: AM33XX: Add pinmux configuration for CPSW to EVMsk
ARM: dts: AM33XX: Add pinmux configuration for CPSW to beaglebone
...
Diffstat (limited to 'drivers')
| -rw-r--r-- | drivers/bus/Kconfig | 9 | ||||
| -rw-r--r-- | drivers/bus/Makefile | 1 | ||||
| -rw-r--r-- | drivers/bus/imx-weim.c | 138 | ||||
| -rw-r--r-- | drivers/clk/clk-nomadik.c | 576 | ||||
| -rw-r--r-- | drivers/clk/samsung/clk-exynos4.c | 9 | ||||
| -rw-r--r-- | drivers/clocksource/nomadik-mtu.c | 60 | ||||
| -rw-r--r-- | drivers/crypto/ux500/cryp/cryp_core.c | 6 | ||||
| -rw-r--r-- | drivers/crypto/ux500/hash/hash_core.c | 6 | ||||
| -rw-r--r-- | drivers/irqchip/irq-renesas-intc-irqpin.c | 9 | ||||
| -rw-r--r-- | drivers/pinctrl/pinctrl-nomadik.c | 6 | ||||
| -rw-r--r-- | drivers/regulator/ab8500.c | 8 |
11 files changed, 777 insertions, 51 deletions
diff --git a/drivers/bus/Kconfig b/drivers/bus/Kconfig index 5286e2d333b0..1f70e84b442c 100644 --- a/drivers/bus/Kconfig +++ b/drivers/bus/Kconfig | |||
| @@ -4,6 +4,15 @@ | |||
| 4 | 4 | ||
| 5 | menu "Bus devices" | 5 | menu "Bus devices" |
| 6 | 6 | ||
| 7 | config IMX_WEIM | ||
| 8 | bool "Freescale EIM DRIVER" | ||
| 9 | depends on ARCH_MXC | ||
| 10 | help | ||
| 11 | Driver for i.MX6 WEIM controller. | ||
| 12 | The WEIM(Wireless External Interface Module) works like a bus. | ||
| 13 | You can attach many different devices on it, such as NOR, onenand. | ||
| 14 | But now, we only support the Parallel NOR. | ||
| 15 | |||
| 7 | config MVEBU_MBUS | 16 | config MVEBU_MBUS |
| 8 | bool | 17 | bool |
| 9 | depends on PLAT_ORION | 18 | depends on PLAT_ORION |
diff --git a/drivers/bus/Makefile b/drivers/bus/Makefile index 670cea443802..8947bdd0de8b 100644 --- a/drivers/bus/Makefile +++ b/drivers/bus/Makefile | |||
| @@ -2,6 +2,7 @@ | |||
| 2 | # Makefile for the bus drivers. | 2 | # Makefile for the bus drivers. |
| 3 | # | 3 | # |
| 4 | 4 | ||
| 5 | obj-$(CONFIG_IMX_WEIM) += imx-weim.o | ||
| 5 | obj-$(CONFIG_MVEBU_MBUS) += mvebu-mbus.o | 6 | obj-$(CONFIG_MVEBU_MBUS) += mvebu-mbus.o |
| 6 | obj-$(CONFIG_OMAP_OCP2SCP) += omap-ocp2scp.o | 7 | obj-$(CONFIG_OMAP_OCP2SCP) += omap-ocp2scp.o |
| 7 | 8 | ||
diff --git a/drivers/bus/imx-weim.c b/drivers/bus/imx-weim.c new file mode 100644 index 000000000000..349f14e886b7 --- /dev/null +++ b/drivers/bus/imx-weim.c | |||
| @@ -0,0 +1,138 @@ | |||
| 1 | /* | ||
| 2 | * EIM driver for Freescale's i.MX chips | ||
| 3 | * | ||
| 4 | * Copyright (C) 2013 Freescale Semiconductor, Inc. | ||
| 5 | * | ||
| 6 | * This file is licensed under the terms of the GNU General Public | ||
| 7 | * License version 2. This program is licensed "as is" without any | ||
| 8 | * warranty of any kind, whether express or implied. | ||
| 9 | */ | ||
| 10 | #include <linux/module.h> | ||
| 11 | #include <linux/clk.h> | ||
| 12 | #include <linux/io.h> | ||
| 13 | #include <linux/of_device.h> | ||
| 14 | |||
| 15 | struct imx_weim { | ||
| 16 | void __iomem *base; | ||
| 17 | struct clk *clk; | ||
| 18 | }; | ||
| 19 | |||
| 20 | static const struct of_device_id weim_id_table[] = { | ||
| 21 | { .compatible = "fsl,imx6q-weim", }, | ||
| 22 | {} | ||
| 23 | }; | ||
| 24 | MODULE_DEVICE_TABLE(of, weim_id_table); | ||
| 25 | |||
| 26 | #define CS_TIMING_LEN 6 | ||
| 27 | #define CS_REG_RANGE 0x18 | ||
| 28 | |||
| 29 | /* Parse and set the timing for this device. */ | ||
| 30 | static int | ||
| 31 | weim_timing_setup(struct platform_device *pdev, struct device_node *np) | ||
| 32 | { | ||
| 33 | struct imx_weim *weim = platform_get_drvdata(pdev); | ||
| 34 | u32 value[CS_TIMING_LEN]; | ||
| 35 | u32 cs_idx; | ||
| 36 | int ret; | ||
| 37 | int i; | ||
| 38 | |||
| 39 | /* get the CS index from this child node's "reg" property. */ | ||
| 40 | ret = of_property_read_u32(np, "reg", &cs_idx); | ||
| 41 | if (ret) | ||
| 42 | return ret; | ||
| 43 | |||
| 44 | /* The weim has four chip selects. */ | ||
| 45 | if (cs_idx > 3) | ||
| 46 | return -EINVAL; | ||
| 47 | |||
| 48 | ret = of_property_read_u32_array(np, "fsl,weim-cs-timing", | ||
| 49 | value, CS_TIMING_LEN); | ||
| 50 | if (ret) | ||
| 51 | return ret; | ||
| 52 | |||
| 53 | /* set the timing for WEIM */ | ||
| 54 | for (i = 0; i < CS_TIMING_LEN; i++) | ||
| 55 | writel(value[i], weim->base + cs_idx * CS_REG_RANGE + i * 4); | ||
| 56 | return 0; | ||
| 57 | } | ||
| 58 | |||
| 59 | static int weim_parse_dt(struct platform_device *pdev) | ||
| 60 | { | ||
| 61 | struct device_node *child; | ||
| 62 | int ret; | ||
| 63 | |||
| 64 | for_each_child_of_node(pdev->dev.of_node, child) { | ||
| 65 | if (!child->name) | ||
| 66 | continue; | ||
| 67 | |||
| 68 | ret = weim_timing_setup(pdev, child); | ||
| 69 | if (ret) { | ||
| 70 | dev_err(&pdev->dev, "%s set timing failed.\n", | ||
| 71 | child->full_name); | ||
| 72 | return ret; | ||
| 73 | } | ||
| 74 | } | ||
| 75 | |||
| 76 | ret = of_platform_populate(pdev->dev.of_node, NULL, NULL, &pdev->dev); | ||
| 77 | if (ret) | ||
| 78 | dev_err(&pdev->dev, "%s fail to create devices.\n", | ||
| 79 | pdev->dev.of_node->full_name); | ||
| 80 | return ret; | ||
| 81 | } | ||
| 82 | |||
| 83 | static int weim_probe(struct platform_device *pdev) | ||
| 84 | { | ||
| 85 | struct imx_weim *weim; | ||
| 86 | struct resource *res; | ||
| 87 | int ret = -EINVAL; | ||
| 88 | |||
| 89 | weim = devm_kzalloc(&pdev->dev, sizeof(*weim), GFP_KERNEL); | ||
| 90 | if (!weim) { | ||
| 91 | ret = -ENOMEM; | ||
| 92 | goto weim_err; | ||
| 93 | } | ||
| 94 | platform_set_drvdata(pdev, weim); | ||
| 95 | |||
| 96 | /* get the resource */ | ||
| 97 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | ||
| 98 | weim->base = devm_ioremap_resource(&pdev->dev, res); | ||
| 99 | if (IS_ERR(weim->base)) { | ||
| 100 | ret = PTR_ERR(weim->base); | ||
| 101 | goto weim_err; | ||
| 102 | } | ||
| 103 | |||
| 104 | /* get the clock */ | ||
| 105 | weim->clk = devm_clk_get(&pdev->dev, NULL); | ||
| 106 | if (IS_ERR(weim->clk)) | ||
| 107 | goto weim_err; | ||
| 108 | |||
| 109 | ret = clk_prepare_enable(weim->clk); | ||
| 110 | if (ret) | ||
| 111 | goto weim_err; | ||
| 112 | |||
| 113 | /* parse the device node */ | ||
| 114 | ret = weim_parse_dt(pdev); | ||
| 115 | if (ret) { | ||
| 116 | clk_disable_unprepare(weim->clk); | ||
| 117 | goto weim_err; | ||
| 118 | } | ||
| 119 | |||
| 120 | dev_info(&pdev->dev, "WEIM driver registered.\n"); | ||
| 121 | return 0; | ||
| 122 | |||
| 123 | weim_err: | ||
| 124 | return ret; | ||
| 125 | } | ||
| 126 | |||
| 127 | static struct platform_driver weim_driver = { | ||
| 128 | .driver = { | ||
| 129 | .name = "imx-weim", | ||
| 130 | .of_match_table = weim_id_table, | ||
| 131 | }, | ||
| 132 | .probe = weim_probe, | ||
| 133 | }; | ||
| 134 | |||
| 135 | module_platform_driver(weim_driver); | ||
| 136 | MODULE_AUTHOR("Freescale Semiconductor Inc."); | ||
| 137 | MODULE_DESCRIPTION("i.MX EIM Controller Driver"); | ||
| 138 | MODULE_LICENSE("GPL"); | ||
diff --git a/drivers/clk/clk-nomadik.c b/drivers/clk/clk-nomadik.c index 6b4c70f7d23d..6d819a37f647 100644 --- a/drivers/clk/clk-nomadik.c +++ b/drivers/clk/clk-nomadik.c | |||
| @@ -1,48 +1,566 @@ | |||
| 1 | /* | ||
| 2 | * Nomadik clock implementation | ||
| 3 | * Copyright (C) 2013 ST-Ericsson AB | ||
| 4 | * License terms: GNU General Public License (GPL) version 2 | ||
| 5 | * Author: Linus Walleij <linus.walleij@linaro.org> | ||
| 6 | */ | ||
| 7 | |||
| 8 | #define pr_fmt(fmt) "Nomadik SRC clocks: " fmt | ||
| 9 | |||
| 10 | #include <linux/bitops.h> | ||
| 1 | #include <linux/clk.h> | 11 | #include <linux/clk.h> |
| 2 | #include <linux/clkdev.h> | 12 | #include <linux/clkdev.h> |
| 3 | #include <linux/err.h> | 13 | #include <linux/err.h> |
| 4 | #include <linux/io.h> | 14 | #include <linux/io.h> |
| 5 | #include <linux/clk-provider.h> | 15 | #include <linux/clk-provider.h> |
| 16 | #include <linux/of.h> | ||
| 17 | #include <linux/of_address.h> | ||
| 18 | #include <linux/debugfs.h> | ||
| 19 | #include <linux/seq_file.h> | ||
| 20 | #include <linux/spinlock.h> | ||
| 21 | #include <linux/reboot.h> | ||
| 6 | 22 | ||
| 7 | /* | 23 | /* |
| 8 | * The Nomadik clock tree is described in the STN8815A12 DB V4.2 | 24 | * The Nomadik clock tree is described in the STN8815A12 DB V4.2 |
| 9 | * reference manual for the chip, page 94 ff. | 25 | * reference manual for the chip, page 94 ff. |
| 26 | * Clock IDs are in the STn8815 Reference Manual table 3, page 27. | ||
| 10 | */ | 27 | */ |
| 11 | 28 | ||
| 12 | void __init nomadik_clk_init(void) | 29 | #define SRC_CR 0x00U |
| 30 | #define SRC_XTALCR 0x0CU | ||
| 31 | #define SRC_XTALCR_XTALTIMEN BIT(20) | ||
| 32 | #define SRC_XTALCR_SXTALDIS BIT(19) | ||
| 33 | #define SRC_XTALCR_MXTALSTAT BIT(2) | ||
| 34 | #define SRC_XTALCR_MXTALEN BIT(1) | ||
| 35 | #define SRC_XTALCR_MXTALOVER BIT(0) | ||
| 36 | #define SRC_PLLCR 0x10U | ||
| 37 | #define SRC_PLLCR_PLLTIMEN BIT(29) | ||
| 38 | #define SRC_PLLCR_PLL2EN BIT(28) | ||
| 39 | #define SRC_PLLCR_PLL1STAT BIT(2) | ||
| 40 | #define SRC_PLLCR_PLL1EN BIT(1) | ||
| 41 | #define SRC_PLLCR_PLL1OVER BIT(0) | ||
| 42 | #define SRC_PLLFR 0x14U | ||
| 43 | #define SRC_PCKEN0 0x24U | ||
| 44 | #define SRC_PCKDIS0 0x28U | ||
| 45 | #define SRC_PCKENSR0 0x2CU | ||
| 46 | #define SRC_PCKSR0 0x30U | ||
| 47 | #define SRC_PCKEN1 0x34U | ||
| 48 | #define SRC_PCKDIS1 0x38U | ||
| 49 | #define SRC_PCKENSR1 0x3CU | ||
| 50 | #define SRC_PCKSR1 0x40U | ||
| 51 | |||
| 52 | /* Lock protecting the SRC_CR register */ | ||
| 53 | static DEFINE_SPINLOCK(src_lock); | ||
| 54 | /* Base address of the SRC */ | ||
| 55 | static void __iomem *src_base; | ||
| 56 | |||
| 57 | /** | ||
| 58 | * struct clk_pll1 - Nomadik PLL1 clock | ||
| 59 | * @hw: corresponding clock hardware entry | ||
| 60 | * @id: PLL instance: 1 or 2 | ||
| 61 | */ | ||
| 62 | struct clk_pll { | ||
| 63 | struct clk_hw hw; | ||
| 64 | int id; | ||
| 65 | }; | ||
| 66 | |||
| 67 | /** | ||
| 68 | * struct clk_src - Nomadik src clock | ||
| 69 | * @hw: corresponding clock hardware entry | ||
| 70 | * @id: the clock ID | ||
| 71 | * @group1: true if the clock is in group1, else it is in group0 | ||
| 72 | * @clkbit: bit 0...31 corresponding to the clock in each clock register | ||
| 73 | */ | ||
| 74 | struct clk_src { | ||
| 75 | struct clk_hw hw; | ||
| 76 | int id; | ||
| 77 | bool group1; | ||
| 78 | u32 clkbit; | ||
| 79 | }; | ||
| 80 | |||
| 81 | #define to_pll(_hw) container_of(_hw, struct clk_pll, hw) | ||
| 82 | #define to_src(_hw) container_of(_hw, struct clk_src, hw) | ||
| 83 | |||
| 84 | static int pll_clk_enable(struct clk_hw *hw) | ||
| 85 | { | ||
| 86 | struct clk_pll *pll = to_pll(hw); | ||
| 87 | u32 val; | ||
| 88 | |||
| 89 | spin_lock(&src_lock); | ||
| 90 | val = readl(src_base + SRC_PLLCR); | ||
| 91 | if (pll->id == 1) { | ||
| 92 | if (val & SRC_PLLCR_PLL1OVER) { | ||
| 93 | val |= SRC_PLLCR_PLL1EN; | ||
| 94 | writel(val, src_base + SRC_PLLCR); | ||
| 95 | } | ||
| 96 | } else if (pll->id == 2) { | ||
| 97 | val |= SRC_PLLCR_PLL2EN; | ||
| 98 | writel(val, src_base + SRC_PLLCR); | ||
| 99 | } | ||
| 100 | spin_unlock(&src_lock); | ||
| 101 | return 0; | ||
| 102 | } | ||
| 103 | |||
| 104 | static void pll_clk_disable(struct clk_hw *hw) | ||
| 105 | { | ||
| 106 | struct clk_pll *pll = to_pll(hw); | ||
| 107 | u32 val; | ||
| 108 | |||
| 109 | spin_lock(&src_lock); | ||
| 110 | val = readl(src_base + SRC_PLLCR); | ||
| 111 | if (pll->id == 1) { | ||
| 112 | if (val & SRC_PLLCR_PLL1OVER) { | ||
| 113 | val &= ~SRC_PLLCR_PLL1EN; | ||
| 114 | writel(val, src_base + SRC_PLLCR); | ||
| 115 | } | ||
| 116 | } else if (pll->id == 2) { | ||
| 117 | val &= ~SRC_PLLCR_PLL2EN; | ||
| 118 | writel(val, src_base + SRC_PLLCR); | ||
| 119 | } | ||
| 120 | spin_unlock(&src_lock); | ||
| 121 | } | ||
| 122 | |||
| 123 | static int pll_clk_is_enabled(struct clk_hw *hw) | ||
| 124 | { | ||
| 125 | struct clk_pll *pll = to_pll(hw); | ||
| 126 | u32 val; | ||
| 127 | |||
| 128 | val = readl(src_base + SRC_PLLCR); | ||
| 129 | if (pll->id == 1) { | ||
| 130 | if (val & SRC_PLLCR_PLL1OVER) | ||
| 131 | return !!(val & SRC_PLLCR_PLL1EN); | ||
| 132 | } else if (pll->id == 2) { | ||
| 133 | return !!(val & SRC_PLLCR_PLL2EN); | ||
| 134 | } | ||
| 135 | return 1; | ||
| 136 | } | ||
| 137 | |||
| 138 | static unsigned long pll_clk_recalc_rate(struct clk_hw *hw, | ||
| 139 | unsigned long parent_rate) | ||
| 140 | { | ||
| 141 | struct clk_pll *pll = to_pll(hw); | ||
| 142 | u32 val; | ||
| 143 | |||
| 144 | val = readl(src_base + SRC_PLLFR); | ||
| 145 | |||
| 146 | if (pll->id == 1) { | ||
| 147 | u8 mul; | ||
| 148 | u8 div; | ||
| 149 | |||
| 150 | mul = (val >> 8) & 0x3FU; | ||
| 151 | mul += 2; | ||
| 152 | div = val & 0x07U; | ||
| 153 | return (parent_rate * mul) >> div; | ||
| 154 | } | ||
| 155 | |||
| 156 | if (pll->id == 2) { | ||
| 157 | u8 mul; | ||
| 158 | |||
| 159 | mul = (val >> 24) & 0x3FU; | ||
| 160 | mul += 2; | ||
| 161 | return (parent_rate * mul); | ||
| 162 | } | ||
| 163 | |||
| 164 | /* Unknown PLL */ | ||
| 165 | return 0; | ||
| 166 | } | ||
| 167 | |||
| 168 | |||
| 169 | static const struct clk_ops pll_clk_ops = { | ||
| 170 | .enable = pll_clk_enable, | ||
| 171 | .disable = pll_clk_disable, | ||
| 172 | .is_enabled = pll_clk_is_enabled, | ||
| 173 | .recalc_rate = pll_clk_recalc_rate, | ||
| 174 | }; | ||
| 175 | |||
| 176 | static struct clk * __init | ||
| 177 | pll_clk_register(struct device *dev, const char *name, | ||
| 178 | const char *parent_name, u32 id) | ||
| 13 | { | 179 | { |
| 14 | struct clk *clk; | 180 | struct clk *clk; |
| 181 | struct clk_pll *pll; | ||
| 182 | struct clk_init_data init; | ||
| 15 | 183 | ||
| 16 | clk = clk_register_fixed_rate(NULL, "apb_pclk", NULL, CLK_IS_ROOT, 0); | 184 | if (id != 1 && id != 2) { |
| 17 | clk_register_clkdev(clk, "apb_pclk", NULL); | 185 | pr_err("%s: the Nomadik has only PLL 1 & 2\n", __func__); |
| 18 | clk_register_clkdev(clk, NULL, "gpio.0"); | 186 | return ERR_PTR(-EINVAL); |
| 19 | clk_register_clkdev(clk, NULL, "gpio.1"); | 187 | } |
| 20 | clk_register_clkdev(clk, NULL, "gpio.2"); | ||
| 21 | clk_register_clkdev(clk, NULL, "gpio.3"); | ||
| 22 | clk_register_clkdev(clk, NULL, "rng"); | ||
| 23 | clk_register_clkdev(clk, NULL, "fsmc-nand"); | ||
| 24 | 188 | ||
| 25 | /* | 189 | pll = kzalloc(sizeof(*pll), GFP_KERNEL); |
| 26 | * The 2.4 MHz TIMCLK reference clock is active at boot time, this is | 190 | if (!pll) { |
| 27 | * actually the MXTALCLK @19.2 MHz divided by 8. This clock is used | 191 | pr_err("%s: could not allocate PLL clk\n", __func__); |
| 28 | * by the timers and watchdog. See page 105 ff. | 192 | return ERR_PTR(-ENOMEM); |
| 29 | */ | 193 | } |
| 30 | clk = clk_register_fixed_rate(NULL, "TIMCLK", NULL, CLK_IS_ROOT, | 194 | |
| 31 | 2400000); | 195 | init.name = name; |
| 32 | clk_register_clkdev(clk, NULL, "mtu0"); | 196 | init.ops = &pll_clk_ops; |
| 33 | clk_register_clkdev(clk, NULL, "mtu1"); | 197 | init.parent_names = (parent_name ? &parent_name : NULL); |
| 198 | init.num_parents = (parent_name ? 1 : 0); | ||
| 199 | pll->hw.init = &init; | ||
| 200 | pll->id = id; | ||
| 201 | |||
| 202 | pr_debug("register PLL1 clock \"%s\"\n", name); | ||
| 203 | |||
| 204 | clk = clk_register(dev, &pll->hw); | ||
| 205 | if (IS_ERR(clk)) | ||
| 206 | kfree(pll); | ||
| 207 | |||
| 208 | return clk; | ||
| 209 | } | ||
| 210 | |||
| 211 | /* | ||
| 212 | * The Nomadik SRC clocks are gated, but not in the sense that | ||
| 213 | * you read-modify-write a register. Instead there are separate | ||
| 214 | * clock enable and clock disable registers. Writing a '1' bit in | ||
| 215 | * the enable register for a certain clock ungates that clock without | ||
| 216 | * affecting the other clocks. The disable register works the opposite | ||
| 217 | * way. | ||
| 218 | */ | ||
| 219 | |||
| 220 | static int src_clk_enable(struct clk_hw *hw) | ||
| 221 | { | ||
| 222 | struct clk_src *sclk = to_src(hw); | ||
| 223 | u32 enreg = sclk->group1 ? SRC_PCKEN1 : SRC_PCKEN0; | ||
| 224 | u32 sreg = sclk->group1 ? SRC_PCKSR1 : SRC_PCKSR0; | ||
| 225 | |||
| 226 | writel(sclk->clkbit, src_base + enreg); | ||
| 227 | /* spin until enabled */ | ||
| 228 | while (!(readl(src_base + sreg) & sclk->clkbit)) | ||
| 229 | cpu_relax(); | ||
| 230 | return 0; | ||
| 231 | } | ||
| 232 | |||
| 233 | static void src_clk_disable(struct clk_hw *hw) | ||
| 234 | { | ||
| 235 | struct clk_src *sclk = to_src(hw); | ||
| 236 | u32 disreg = sclk->group1 ? SRC_PCKDIS1 : SRC_PCKDIS0; | ||
| 237 | u32 sreg = sclk->group1 ? SRC_PCKSR1 : SRC_PCKSR0; | ||
| 238 | |||
| 239 | writel(sclk->clkbit, src_base + disreg); | ||
| 240 | /* spin until disabled */ | ||
| 241 | while (readl(src_base + sreg) & sclk->clkbit) | ||
| 242 | cpu_relax(); | ||
| 243 | } | ||
| 244 | |||
| 245 | static int src_clk_is_enabled(struct clk_hw *hw) | ||
| 246 | { | ||
| 247 | struct clk_src *sclk = to_src(hw); | ||
| 248 | u32 sreg = sclk->group1 ? SRC_PCKSR1 : SRC_PCKSR0; | ||
| 249 | u32 val = readl(src_base + sreg); | ||
| 34 | 250 | ||
| 251 | return !!(val & sclk->clkbit); | ||
| 252 | } | ||
| 253 | |||
| 254 | static unsigned long | ||
| 255 | src_clk_recalc_rate(struct clk_hw *hw, | ||
| 256 | unsigned long parent_rate) | ||
| 257 | { | ||
| 258 | return parent_rate; | ||
| 259 | } | ||
| 260 | |||
| 261 | static const struct clk_ops src_clk_ops = { | ||
| 262 | .enable = src_clk_enable, | ||
| 263 | .disable = src_clk_disable, | ||
| 264 | .is_enabled = src_clk_is_enabled, | ||
| 265 | .recalc_rate = src_clk_recalc_rate, | ||
| 266 | }; | ||
| 267 | |||
| 268 | static struct clk * __init | ||
| 269 | src_clk_register(struct device *dev, const char *name, | ||
| 270 | const char *parent_name, u8 id) | ||
| 271 | { | ||
| 272 | struct clk *clk; | ||
| 273 | struct clk_src *sclk; | ||
| 274 | struct clk_init_data init; | ||
| 275 | |||
| 276 | sclk = kzalloc(sizeof(*sclk), GFP_KERNEL); | ||
| 277 | if (!sclk) { | ||
| 278 | pr_err("could not allocate SRC clock %s\n", | ||
| 279 | name); | ||
| 280 | return ERR_PTR(-ENOMEM); | ||
| 281 | } | ||
| 282 | init.name = name; | ||
| 283 | init.ops = &src_clk_ops; | ||
| 284 | /* Do not force-disable the static SDRAM controller */ | ||
| 285 | if (id == 2) | ||
| 286 | init.flags = CLK_IGNORE_UNUSED; | ||
| 287 | else | ||
| 288 | init.flags = 0; | ||
| 289 | init.parent_names = (parent_name ? &parent_name : NULL); | ||
| 290 | init.num_parents = (parent_name ? 1 : 0); | ||
| 291 | sclk->hw.init = &init; | ||
| 292 | sclk->id = id; | ||
| 293 | sclk->group1 = (id > 31); | ||
| 294 | sclk->clkbit = BIT(id & 0x1f); | ||
| 295 | |||
| 296 | pr_debug("register clock \"%s\" ID: %d group: %d bits: %08x\n", | ||
| 297 | name, id, sclk->group1, sclk->clkbit); | ||
| 298 | |||
| 299 | clk = clk_register(dev, &sclk->hw); | ||
| 300 | if (IS_ERR(clk)) | ||
| 301 | kfree(sclk); | ||
| 302 | |||
| 303 | return clk; | ||
| 304 | } | ||
| 305 | |||
| 306 | #ifdef CONFIG_DEBUG_FS | ||
| 307 | |||
| 308 | static u32 src_pcksr0_boot; | ||
| 309 | static u32 src_pcksr1_boot; | ||
| 310 | |||
| 311 | static const char * const src_clk_names[] = { | ||
| 312 | "HCLKDMA0 ", | ||
| 313 | "HCLKSMC ", | ||
| 314 | "HCLKSDRAM ", | ||
| 315 | "HCLKDMA1 ", | ||
| 316 | "HCLKCLCD ", | ||
| 317 | "PCLKIRDA ", | ||
| 318 | "PCLKSSP ", | ||
| 319 | "PCLKUART0 ", | ||
| 320 | "PCLKSDI ", | ||
| 321 | "PCLKI2C0 ", | ||
| 322 | "PCLKI2C1 ", | ||
| 323 | "PCLKUART1 ", | ||
| 324 | "PCLMSP0 ", | ||
| 325 | "HCLKUSB ", | ||
| 326 | "HCLKDIF ", | ||
| 327 | "HCLKSAA ", | ||
| 328 | "HCLKSVA ", | ||
| 329 | "PCLKHSI ", | ||
| 330 | "PCLKXTI ", | ||
| 331 | "PCLKUART2 ", | ||
| 332 | "PCLKMSP1 ", | ||
| 333 | "PCLKMSP2 ", | ||
| 334 | "PCLKOWM ", | ||
| 335 | "HCLKHPI ", | ||
| 336 | "PCLKSKE ", | ||
| 337 | "PCLKHSEM ", | ||
| 338 | "HCLK3D ", | ||
| 339 | "HCLKHASH ", | ||
| 340 | "HCLKCRYP ", | ||
| 341 | "PCLKMSHC ", | ||
| 342 | "HCLKUSBM ", | ||
| 343 | "HCLKRNG ", | ||
| 344 | "RESERVED ", | ||
| 345 | "RESERVED ", | ||
| 346 | "RESERVED ", | ||
| 347 | "RESERVED ", | ||
| 348 | "CLDCLK ", | ||
| 349 | "IRDACLK ", | ||
| 350 | "SSPICLK ", | ||
| 351 | "UART0CLK ", | ||
| 352 | "SDICLK ", | ||
| 353 | "I2C0CLK ", | ||
| 354 | "I2C1CLK ", | ||
| 355 | "UART1CLK ", | ||
| 356 | "MSPCLK0 ", | ||
| 357 | "USBCLK ", | ||
| 358 | "DIFCLK ", | ||
| 359 | "IPI2CCLK ", | ||
| 360 | "IPBMCCLK ", | ||
| 361 | "HSICLKRX ", | ||
| 362 | "HSICLKTX ", | ||
| 363 | "UART2CLK ", | ||
| 364 | "MSPCLK1 ", | ||
| 365 | "MSPCLK2 ", | ||
| 366 | "OWMCLK ", | ||
| 367 | "RESERVED ", | ||
| 368 | "SKECLK ", | ||
| 369 | "RESERVED ", | ||
| 370 | "3DCLK ", | ||
| 371 | "PCLKMSP3 ", | ||
| 372 | "MSPCLK3 ", | ||
| 373 | "MSHCCLK ", | ||
| 374 | "USBMCLK ", | ||
| 375 | "RNGCCLK ", | ||
| 376 | }; | ||
| 377 | |||
| 378 | static int nomadik_src_clk_show(struct seq_file *s, void *what) | ||
| 379 | { | ||
| 380 | int i; | ||
| 381 | u32 src_pcksr0 = readl(src_base + SRC_PCKSR0); | ||
| 382 | u32 src_pcksr1 = readl(src_base + SRC_PCKSR1); | ||
| 383 | u32 src_pckensr0 = readl(src_base + SRC_PCKENSR0); | ||
| 384 | u32 src_pckensr1 = readl(src_base + SRC_PCKENSR1); | ||
| 385 | |||
| 386 | seq_printf(s, "Clock: Boot: Now: Request: ASKED:\n"); | ||
| 387 | for (i = 0; i < ARRAY_SIZE(src_clk_names); i++) { | ||
| 388 | u32 pcksrb = (i < 0x20) ? src_pcksr0_boot : src_pcksr1_boot; | ||
| 389 | u32 pcksr = (i < 0x20) ? src_pcksr0 : src_pcksr1; | ||
| 390 | u32 pckreq = (i < 0x20) ? src_pckensr0 : src_pckensr1; | ||
| 391 | u32 mask = BIT(i & 0x1f); | ||
| 392 | |||
| 393 | seq_printf(s, "%s %s %s %s\n", | ||
| 394 | src_clk_names[i], | ||
| 395 | (pcksrb & mask) ? "on " : "off", | ||
| 396 | (pcksr & mask) ? "on " : "off", | ||
| 397 | (pckreq & mask) ? "on " : "off"); | ||
| 398 | } | ||
| 399 | return 0; | ||
| 400 | } | ||
| 401 | |||
| 402 | static int nomadik_src_clk_open(struct inode *inode, struct file *file) | ||
| 403 | { | ||
| 404 | return single_open(file, nomadik_src_clk_show, NULL); | ||
| 405 | } | ||
| 406 | |||
| 407 | static const struct file_operations nomadik_src_clk_debugfs_ops = { | ||
| 408 | .open = nomadik_src_clk_open, | ||
| 409 | .read = seq_read, | ||
| 410 | .llseek = seq_lseek, | ||
| 411 | .release = single_release, | ||
| 412 | }; | ||
| 413 | |||
| 414 | static int __init nomadik_src_clk_init_debugfs(void) | ||
| 415 | { | ||
| 416 | src_pcksr0_boot = readl(src_base + SRC_PCKSR0); | ||
| 417 | src_pcksr1_boot = readl(src_base + SRC_PCKSR1); | ||
| 418 | debugfs_create_file("nomadik-src-clk", S_IFREG | S_IRUGO, | ||
| 419 | NULL, NULL, &nomadik_src_clk_debugfs_ops); | ||
| 420 | return 0; | ||
| 421 | } | ||
| 422 | |||
| 423 | module_init(nomadik_src_clk_init_debugfs); | ||
| 424 | |||
| 425 | #endif | ||
| 426 | |||
| 427 | static void __init of_nomadik_pll_setup(struct device_node *np) | ||
| 428 | { | ||
| 429 | struct clk *clk = ERR_PTR(-EINVAL); | ||
| 430 | const char *clk_name = np->name; | ||
| 431 | const char *parent_name; | ||
| 432 | u32 pll_id; | ||
| 433 | |||
| 434 | if (of_property_read_u32(np, "pll-id", &pll_id)) { | ||
| 435 | pr_err("%s: PLL \"%s\" missing pll-id property\n", | ||
| 436 | __func__, clk_name); | ||
| 437 | return; | ||
| 438 | } | ||
| 439 | parent_name = of_clk_get_parent_name(np, 0); | ||
| 440 | clk = pll_clk_register(NULL, clk_name, parent_name, pll_id); | ||
| 441 | if (!IS_ERR(clk)) | ||
| 442 | of_clk_add_provider(np, of_clk_src_simple_get, clk); | ||
| 443 | } | ||
| 444 | |||
| 445 | static void __init of_nomadik_hclk_setup(struct device_node *np) | ||
| 446 | { | ||
| 447 | struct clk *clk = ERR_PTR(-EINVAL); | ||
| 448 | const char *clk_name = np->name; | ||
| 449 | const char *parent_name; | ||
| 450 | |||
| 451 | parent_name = of_clk_get_parent_name(np, 0); | ||
| 35 | /* | 452 | /* |
| 36 | * At boot time, PLL2 is set to generate a set of fixed clocks, | 453 | * The HCLK divides PLL1 with 1 (passthru), 2, 3 or 4. |
| 37 | * one of them is CLK48, the 48 MHz clock, routed to the UART, MMC/SD | ||
| 38 | * I2C, IrDA, USB and SSP blocks. | ||
| 39 | */ | 454 | */ |
| 40 | clk = clk_register_fixed_rate(NULL, "CLK48", NULL, CLK_IS_ROOT, | 455 | clk = clk_register_divider(NULL, clk_name, parent_name, |
| 41 | 48000000); | 456 | 0, src_base + SRC_CR, |
| 42 | clk_register_clkdev(clk, NULL, "uart0"); | 457 | 13, 2, |
| 43 | clk_register_clkdev(clk, NULL, "uart1"); | 458 | CLK_DIVIDER_ONE_BASED | CLK_DIVIDER_ALLOW_ZERO, |
| 44 | clk_register_clkdev(clk, NULL, "mmci"); | 459 | &src_lock); |
| 45 | clk_register_clkdev(clk, NULL, "ssp"); | 460 | if (!IS_ERR(clk)) |
| 46 | clk_register_clkdev(clk, NULL, "nmk-i2c.0"); | 461 | of_clk_add_provider(np, of_clk_src_simple_get, clk); |
| 47 | clk_register_clkdev(clk, NULL, "nmk-i2c.1"); | 462 | } |
| 463 | |||
| 464 | static void __init of_nomadik_src_clk_setup(struct device_node *np) | ||
| 465 | { | ||
| 466 | struct clk *clk = ERR_PTR(-EINVAL); | ||
| 467 | const char *clk_name = np->name; | ||
| 468 | const char *parent_name; | ||
| 469 | u32 clk_id; | ||
| 470 | |||
| 471 | if (of_property_read_u32(np, "clock-id", &clk_id)) { | ||
| 472 | pr_err("%s: SRC clock \"%s\" missing clock-id property\n", | ||
| 473 | __func__, clk_name); | ||
| 474 | return; | ||
| 475 | } | ||
| 476 | parent_name = of_clk_get_parent_name(np, 0); | ||
| 477 | clk = src_clk_register(NULL, clk_name, parent_name, clk_id); | ||
| 478 | if (!IS_ERR(clk)) | ||
| 479 | of_clk_add_provider(np, of_clk_src_simple_get, clk); | ||
| 480 | } | ||
| 481 | |||
| 482 | static const __initconst struct of_device_id nomadik_src_match[] = { | ||
| 483 | { .compatible = "stericsson,nomadik-src" }, | ||
| 484 | { /* sentinel */ } | ||
| 485 | }; | ||
| 486 | |||
| 487 | static const __initconst struct of_device_id nomadik_src_clk_match[] = { | ||
| 488 | { | ||
| 489 | .compatible = "fixed-clock", | ||
| 490 | .data = of_fixed_clk_setup, | ||
| 491 | }, | ||
| 492 | { | ||
| 493 | .compatible = "fixed-factor-clock", | ||
| 494 | .data = of_fixed_factor_clk_setup, | ||
| 495 | }, | ||
| 496 | { | ||
| 497 | .compatible = "st,nomadik-pll-clock", | ||
| 498 | .data = of_nomadik_pll_setup, | ||
| 499 | }, | ||
| 500 | { | ||
| 501 | .compatible = "st,nomadik-hclk-clock", | ||
| 502 | .data = of_nomadik_hclk_setup, | ||
| 503 | }, | ||
| 504 | { | ||
| 505 | .compatible = "st,nomadik-src-clock", | ||
| 506 | .data = of_nomadik_src_clk_setup, | ||
| 507 | }, | ||
| 508 | { /* sentinel */ } | ||
| 509 | }; | ||
| 510 | |||
| 511 | static int nomadik_clk_reboot_handler(struct notifier_block *this, | ||
| 512 | unsigned long code, | ||
| 513 | void *unused) | ||
| 514 | { | ||
| 515 | u32 val; | ||
| 516 | |||
| 517 | /* The main chrystal need to be enabled for reboot to work */ | ||
| 518 | val = readl(src_base + SRC_XTALCR); | ||
| 519 | val &= ~SRC_XTALCR_MXTALOVER; | ||
| 520 | val |= SRC_XTALCR_MXTALEN; | ||
| 521 | pr_crit("force-enabling MXTALO\n"); | ||
| 522 | writel(val, src_base + SRC_XTALCR); | ||
| 523 | return NOTIFY_OK; | ||
| 524 | } | ||
| 525 | |||
| 526 | static struct notifier_block nomadik_clk_reboot_notifier = { | ||
| 527 | .notifier_call = nomadik_clk_reboot_handler, | ||
| 528 | }; | ||
| 529 | |||
| 530 | void __init nomadik_clk_init(void) | ||
| 531 | { | ||
| 532 | struct device_node *np; | ||
| 533 | u32 val; | ||
| 534 | |||
| 535 | np = of_find_matching_node(NULL, nomadik_src_match); | ||
| 536 | if (!np) { | ||
| 537 | pr_crit("no matching node for SRC, aborting clock init\n"); | ||
| 538 | return; | ||
| 539 | } | ||
| 540 | src_base = of_iomap(np, 0); | ||
| 541 | if (!src_base) { | ||
| 542 | pr_err("%s: must have src parent node with REGS (%s)\n", | ||
| 543 | __func__, np->name); | ||
| 544 | return; | ||
| 545 | } | ||
| 546 | val = readl(src_base + SRC_XTALCR); | ||
| 547 | pr_info("SXTALO is %s\n", | ||
| 548 | (val & SRC_XTALCR_SXTALDIS) ? "disabled" : "enabled"); | ||
| 549 | pr_info("MXTAL is %s\n", | ||
| 550 | (val & SRC_XTALCR_MXTALSTAT) ? "enabled" : "disabled"); | ||
| 551 | if (of_property_read_bool(np, "disable-sxtalo")) { | ||
| 552 | /* The machine uses an external oscillator circuit */ | ||
| 553 | val |= SRC_XTALCR_SXTALDIS; | ||
| 554 | pr_info("disabling SXTALO\n"); | ||
| 555 | } | ||
| 556 | if (of_property_read_bool(np, "disable-mxtalo")) { | ||
| 557 | /* Disable this too: also run by external oscillator */ | ||
| 558 | val |= SRC_XTALCR_MXTALOVER; | ||
| 559 | val &= ~SRC_XTALCR_MXTALEN; | ||
| 560 | pr_info("disabling MXTALO\n"); | ||
| 561 | } | ||
| 562 | writel(val, src_base + SRC_XTALCR); | ||
| 563 | register_reboot_notifier(&nomadik_clk_reboot_notifier); | ||
| 564 | |||
| 565 | of_clk_init(nomadik_src_clk_match); | ||
| 48 | } | 566 | } |
diff --git a/drivers/clk/samsung/clk-exynos4.c b/drivers/clk/samsung/clk-exynos4.c index 3c1f88868f29..addc738a06fb 100644 --- a/drivers/clk/samsung/clk-exynos4.c +++ b/drivers/clk/samsung/clk-exynos4.c | |||
| @@ -151,7 +151,7 @@ enum exynos4_clks { | |||
| 151 | sclk_audio1, sclk_audio2, sclk_spdif, sclk_spi0, sclk_spi1, sclk_spi2, | 151 | sclk_audio1, sclk_audio2, sclk_spdif, sclk_spi0, sclk_spi1, sclk_spi2, |
| 152 | sclk_slimbus, sclk_fimd1, sclk_mipi1, sclk_pcm1, sclk_pcm2, sclk_i2s1, | 152 | sclk_slimbus, sclk_fimd1, sclk_mipi1, sclk_pcm1, sclk_pcm2, sclk_i2s1, |
| 153 | sclk_i2s2, sclk_mipihsi, sclk_mfc, sclk_pcm0, sclk_g3d, sclk_pwm_isp, | 153 | sclk_i2s2, sclk_mipihsi, sclk_mfc, sclk_pcm0, sclk_g3d, sclk_pwm_isp, |
| 154 | sclk_spi0_isp, sclk_spi1_isp, sclk_uart_isp, | 154 | sclk_spi0_isp, sclk_spi1_isp, sclk_uart_isp, sclk_fimg2d, |
| 155 | 155 | ||
| 156 | /* gate clocks */ | 156 | /* gate clocks */ |
| 157 | fimc0 = 256, fimc1, fimc2, fimc3, csis0, csis1, jpeg, smmu_fimc0, | 157 | fimc0 = 256, fimc1, fimc2, fimc3, csis0, csis1, jpeg, smmu_fimc0, |
| @@ -484,6 +484,9 @@ struct samsung_mux_clock exynos4x12_mux_clks[] __initdata = { | |||
| 484 | MUX(none, "mout_spi0_isp", group1_p4x12, E4X12_SRC_ISP, 4, 4), | 484 | MUX(none, "mout_spi0_isp", group1_p4x12, E4X12_SRC_ISP, 4, 4), |
| 485 | MUX(none, "mout_spi1_isp", group1_p4x12, E4X12_SRC_ISP, 8, 4), | 485 | MUX(none, "mout_spi1_isp", group1_p4x12, E4X12_SRC_ISP, 8, 4), |
| 486 | MUX(none, "mout_uart_isp", group1_p4x12, E4X12_SRC_ISP, 12, 4), | 486 | MUX(none, "mout_uart_isp", group1_p4x12, E4X12_SRC_ISP, 12, 4), |
| 487 | MUX(none, "mout_g2d0", sclk_ampll_p4210, SRC_DMC, 20, 1), | ||
| 488 | MUX(none, "mout_g2d1", sclk_evpll_p, SRC_DMC, 24, 1), | ||
| 489 | MUX(none, "mout_g2d", mout_g2d_p, SRC_DMC, 28, 1), | ||
| 487 | }; | 490 | }; |
| 488 | 491 | ||
| 489 | /* list of divider clocks supported in all exynos4 soc's */ | 492 | /* list of divider clocks supported in all exynos4 soc's */ |
| @@ -552,7 +555,7 @@ struct samsung_div_clock exynos4_div_clks[] __initdata = { | |||
| 552 | /* list of divider clocks supported in exynos4210 soc */ | 555 | /* list of divider clocks supported in exynos4210 soc */ |
| 553 | struct samsung_div_clock exynos4210_div_clks[] __initdata = { | 556 | struct samsung_div_clock exynos4210_div_clks[] __initdata = { |
| 554 | DIV(aclk200, "aclk200", "mout_aclk200", DIV_TOP, 0, 3), | 557 | DIV(aclk200, "aclk200", "mout_aclk200", DIV_TOP, 0, 3), |
| 555 | DIV(none, "div_g2d", "mout_g2d", DIV_IMAGE, 0, 4), | 558 | DIV(sclk_fimg2d, "sclk_fimg2d", "mout_g2d", DIV_IMAGE, 0, 4), |
| 556 | DIV(none, "div_fimd1", "mout_fimd1", E4210_DIV_LCD1, 0, 4), | 559 | DIV(none, "div_fimd1", "mout_fimd1", E4210_DIV_LCD1, 0, 4), |
| 557 | DIV(none, "div_mipi1", "mout_mipi1", E4210_DIV_LCD1, 16, 4), | 560 | DIV(none, "div_mipi1", "mout_mipi1", E4210_DIV_LCD1, 16, 4), |
| 558 | DIV(none, "div_sata", "mout_sata", DIV_FSYS0, 20, 4), | 561 | DIV(none, "div_sata", "mout_sata", DIV_FSYS0, 20, 4), |
| @@ -582,6 +585,7 @@ struct samsung_div_clock exynos4x12_div_clks[] __initdata = { | |||
| 582 | DIV(none, "div_mpwm", "div_isp1", E4X12_DIV_ISP1, 0, 3), | 585 | DIV(none, "div_mpwm", "div_isp1", E4X12_DIV_ISP1, 0, 3), |
| 583 | DIV(div_mcuisp0, "div_mcuisp0", "aclk400_mcuisp", E4X12_DIV_ISP1, 4, 3), | 586 | DIV(div_mcuisp0, "div_mcuisp0", "aclk400_mcuisp", E4X12_DIV_ISP1, 4, 3), |
| 584 | DIV(div_mcuisp1, "div_mcuisp1", "div_mcuisp0", E4X12_DIV_ISP1, 8, 3), | 587 | DIV(div_mcuisp1, "div_mcuisp1", "div_mcuisp0", E4X12_DIV_ISP1, 8, 3), |
| 588 | DIV(sclk_fimg2d, "sclk_fimg2d", "mout_g2d", DIV_DMC1, 0, 4), | ||
| 585 | }; | 589 | }; |
| 586 | 590 | ||
| 587 | /* list of gate clocks supported in all exynos4 soc's */ | 591 | /* list of gate clocks supported in all exynos4 soc's */ |
| @@ -909,6 +913,7 @@ struct samsung_gate_clock exynos4x12_gate_clks[] __initdata = { | |||
| 909 | CLK_IGNORE_UNUSED, 0), | 913 | CLK_IGNORE_UNUSED, 0), |
| 910 | GATE(spi1_isp, "spi1_isp", "aclk200", E4X12_GATE_ISP1, 13, | 914 | GATE(spi1_isp, "spi1_isp", "aclk200", E4X12_GATE_ISP1, 13, |
| 911 | CLK_IGNORE_UNUSED, 0), | 915 | CLK_IGNORE_UNUSED, 0), |
| 916 | GATE(g2d, "g2d", "aclk200", GATE_IP_DMC, 23, 0, 0), | ||
| 912 | }; | 917 | }; |
| 913 | 918 | ||
| 914 | /* | 919 | /* |
diff --git a/drivers/clocksource/nomadik-mtu.c b/drivers/clocksource/nomadik-mtu.c index e405531e1cc5..b9415b622f55 100644 --- a/drivers/clocksource/nomadik-mtu.c +++ b/drivers/clocksource/nomadik-mtu.c | |||
| @@ -13,6 +13,9 @@ | |||
| 13 | #include <linux/io.h> | 13 | #include <linux/io.h> |
| 14 | #include <linux/clockchips.h> | 14 | #include <linux/clockchips.h> |
| 15 | #include <linux/clocksource.h> | 15 | #include <linux/clocksource.h> |
| 16 | #include <linux/of_address.h> | ||
| 17 | #include <linux/of_irq.h> | ||
| 18 | #include <linux/of_platform.h> | ||
| 16 | #include <linux/clk.h> | 19 | #include <linux/clk.h> |
| 17 | #include <linux/jiffies.h> | 20 | #include <linux/jiffies.h> |
| 18 | #include <linux/delay.h> | 21 | #include <linux/delay.h> |
| @@ -188,22 +191,15 @@ static struct irqaction nmdk_timer_irq = { | |||
| 188 | .dev_id = &nmdk_clkevt, | 191 | .dev_id = &nmdk_clkevt, |
| 189 | }; | 192 | }; |
| 190 | 193 | ||
| 191 | void __init nmdk_timer_init(void __iomem *base, int irq) | 194 | static void __init __nmdk_timer_init(void __iomem *base, int irq, |
| 195 | struct clk *pclk, struct clk *clk) | ||
| 192 | { | 196 | { |
| 193 | unsigned long rate; | 197 | unsigned long rate; |
| 194 | struct clk *clk0, *pclk0; | ||
| 195 | 198 | ||
| 196 | mtu_base = base; | 199 | mtu_base = base; |
| 197 | 200 | ||
| 198 | pclk0 = clk_get_sys("mtu0", "apb_pclk"); | 201 | BUG_ON(clk_prepare_enable(pclk)); |
| 199 | BUG_ON(IS_ERR(pclk0)); | 202 | BUG_ON(clk_prepare_enable(clk)); |
| 200 | BUG_ON(clk_prepare(pclk0) < 0); | ||
| 201 | BUG_ON(clk_enable(pclk0) < 0); | ||
| 202 | |||
| 203 | clk0 = clk_get_sys("mtu0", NULL); | ||
| 204 | BUG_ON(IS_ERR(clk0)); | ||
| 205 | BUG_ON(clk_prepare(clk0) < 0); | ||
| 206 | BUG_ON(clk_enable(clk0) < 0); | ||
| 207 | 203 | ||
| 208 | /* | 204 | /* |
| 209 | * Tick rate is 2.4MHz for Nomadik and 2.4Mhz, 100MHz or 133 MHz | 205 | * Tick rate is 2.4MHz for Nomadik and 2.4Mhz, 100MHz or 133 MHz |
| @@ -213,7 +209,7 @@ void __init nmdk_timer_init(void __iomem *base, int irq) | |||
| 213 | * to wake-up at a max 127s a head in time. Dividing a 2.4 MHz timer | 209 | * to wake-up at a max 127s a head in time. Dividing a 2.4 MHz timer |
| 214 | * with 16 gives too low timer resolution. | 210 | * with 16 gives too low timer resolution. |
| 215 | */ | 211 | */ |
| 216 | rate = clk_get_rate(clk0); | 212 | rate = clk_get_rate(clk); |
| 217 | if (rate > 32000000) { | 213 | if (rate > 32000000) { |
| 218 | rate /= 16; | 214 | rate /= 16; |
| 219 | clk_prescale = MTU_CRn_PRESCALE_16; | 215 | clk_prescale = MTU_CRn_PRESCALE_16; |
| @@ -247,3 +243,43 @@ void __init nmdk_timer_init(void __iomem *base, int irq) | |||
| 247 | mtu_delay_timer.freq = rate; | 243 | mtu_delay_timer.freq = rate; |
| 248 | register_current_timer_delay(&mtu_delay_timer); | 244 | register_current_timer_delay(&mtu_delay_timer); |
| 249 | } | 245 | } |
| 246 | |||
| 247 | void __init nmdk_timer_init(void __iomem *base, int irq) | ||
| 248 | { | ||
| 249 | struct clk *clk0, *pclk0; | ||
| 250 | |||
| 251 | pclk0 = clk_get_sys("mtu0", "apb_pclk"); | ||
| 252 | BUG_ON(IS_ERR(pclk0)); | ||
| 253 | clk0 = clk_get_sys("mtu0", NULL); | ||
| 254 | BUG_ON(IS_ERR(clk0)); | ||
| 255 | |||
| 256 | __nmdk_timer_init(base, irq, pclk0, clk0); | ||
| 257 | } | ||
| 258 | |||
| 259 | static void __init nmdk_timer_of_init(struct device_node *node) | ||
| 260 | { | ||
| 261 | struct clk *pclk; | ||
| 262 | struct clk *clk; | ||
| 263 | void __iomem *base; | ||
| 264 | int irq; | ||
| 265 | |||
| 266 | base = of_iomap(node, 0); | ||
| 267 | if (!base) | ||
| 268 | panic("Can't remap registers"); | ||
| 269 | |||
| 270 | pclk = of_clk_get_by_name(node, "apb_pclk"); | ||
| 271 | if (IS_ERR(pclk)) | ||
| 272 | panic("could not get apb_pclk"); | ||
| 273 | |||
| 274 | clk = of_clk_get_by_name(node, "timclk"); | ||
| 275 | if (IS_ERR(clk)) | ||
| 276 | panic("could not get timclk"); | ||
| 277 | |||
| 278 | irq = irq_of_parse_and_map(node, 0); | ||
| 279 | if (irq <= 0) | ||
| 280 | panic("Can't parse IRQ"); | ||
| 281 | |||
| 282 | __nmdk_timer_init(base, irq, pclk, clk); | ||
| 283 | } | ||
| 284 | CLOCKSOURCE_OF_DECLARE(nomadik_mtu, "st,nomadik-mtu", | ||
| 285 | nmdk_timer_of_init); | ||
diff --git a/drivers/crypto/ux500/cryp/cryp_core.c b/drivers/crypto/ux500/cryp/cryp_core.c index 32f480622b97..8c2777cf02f6 100644 --- a/drivers/crypto/ux500/cryp/cryp_core.c +++ b/drivers/crypto/ux500/cryp/cryp_core.c | |||
| @@ -1743,6 +1743,11 @@ static int ux500_cryp_resume(struct device *dev) | |||
| 1743 | 1743 | ||
| 1744 | static SIMPLE_DEV_PM_OPS(ux500_cryp_pm, ux500_cryp_suspend, ux500_cryp_resume); | 1744 | static SIMPLE_DEV_PM_OPS(ux500_cryp_pm, ux500_cryp_suspend, ux500_cryp_resume); |
| 1745 | 1745 | ||
| 1746 | static const struct of_device_id ux500_cryp_match[] = { | ||
| 1747 | { .compatible = "stericsson,ux500-cryp" }, | ||
| 1748 | { }, | ||
| 1749 | }; | ||
| 1750 | |||
| 1746 | static struct platform_driver cryp_driver = { | 1751 | static struct platform_driver cryp_driver = { |
| 1747 | .probe = ux500_cryp_probe, | 1752 | .probe = ux500_cryp_probe, |
| 1748 | .remove = ux500_cryp_remove, | 1753 | .remove = ux500_cryp_remove, |
| @@ -1750,6 +1755,7 @@ static struct platform_driver cryp_driver = { | |||
| 1750 | .driver = { | 1755 | .driver = { |
| 1751 | .owner = THIS_MODULE, | 1756 | .owner = THIS_MODULE, |
| 1752 | .name = "cryp1", | 1757 | .name = "cryp1", |
| 1758 | .of_match_table = ux500_cryp_match, | ||
| 1753 | .pm = &ux500_cryp_pm, | 1759 | .pm = &ux500_cryp_pm, |
| 1754 | } | 1760 | } |
| 1755 | }; | 1761 | }; |
diff --git a/drivers/crypto/ux500/hash/hash_core.c b/drivers/crypto/ux500/hash/hash_core.c index cf5508967539..3b8f661d0edf 100644 --- a/drivers/crypto/ux500/hash/hash_core.c +++ b/drivers/crypto/ux500/hash/hash_core.c | |||
| @@ -1961,6 +1961,11 @@ static int ux500_hash_resume(struct device *dev) | |||
| 1961 | 1961 | ||
| 1962 | static SIMPLE_DEV_PM_OPS(ux500_hash_pm, ux500_hash_suspend, ux500_hash_resume); | 1962 | static SIMPLE_DEV_PM_OPS(ux500_hash_pm, ux500_hash_suspend, ux500_hash_resume); |
| 1963 | 1963 | ||
| 1964 | static const struct of_device_id ux500_hash_match[] = { | ||
| 1965 | { .compatible = "stericsson,ux500-hash" }, | ||
| 1966 | { }, | ||
| 1967 | }; | ||
| 1968 | |||
| 1964 | static struct platform_driver hash_driver = { | 1969 | static struct platform_driver hash_driver = { |
| 1965 | .probe = ux500_hash_probe, | 1970 | .probe = ux500_hash_probe, |
| 1966 | .remove = ux500_hash_remove, | 1971 | .remove = ux500_hash_remove, |
| @@ -1968,6 +1973,7 @@ static struct platform_driver hash_driver = { | |||
| 1968 | .driver = { | 1973 | .driver = { |
| 1969 | .owner = THIS_MODULE, | 1974 | .owner = THIS_MODULE, |
| 1970 | .name = "hash1", | 1975 | .name = "hash1", |
| 1976 | .of_match_table = ux500_hash_match, | ||
| 1971 | .pm = &ux500_hash_pm, | 1977 | .pm = &ux500_hash_pm, |
| 1972 | } | 1978 | } |
| 1973 | }; | 1979 | }; |
diff --git a/drivers/irqchip/irq-renesas-intc-irqpin.c b/drivers/irqchip/irq-renesas-intc-irqpin.c index 5a68e5accec1..82cec63a9011 100644 --- a/drivers/irqchip/irq-renesas-intc-irqpin.c +++ b/drivers/irqchip/irq-renesas-intc-irqpin.c | |||
| @@ -18,6 +18,7 @@ | |||
| 18 | */ | 18 | */ |
| 19 | 19 | ||
| 20 | #include <linux/init.h> | 20 | #include <linux/init.h> |
| 21 | #include <linux/of.h> | ||
| 21 | #include <linux/platform_device.h> | 22 | #include <linux/platform_device.h> |
| 22 | #include <linux/spinlock.h> | 23 | #include <linux/spinlock.h> |
| 23 | #include <linux/interrupt.h> | 24 | #include <linux/interrupt.h> |
| @@ -347,8 +348,14 @@ static int intc_irqpin_probe(struct platform_device *pdev) | |||
| 347 | } | 348 | } |
| 348 | 349 | ||
| 349 | /* deal with driver instance configuration */ | 350 | /* deal with driver instance configuration */ |
| 350 | if (pdata) | 351 | if (pdata) { |
| 351 | memcpy(&p->config, pdata, sizeof(*pdata)); | 352 | memcpy(&p->config, pdata, sizeof(*pdata)); |
| 353 | } else { | ||
| 354 | of_property_read_u32(pdev->dev.of_node, "sense-bitfield-width", | ||
| 355 | &p->config.sense_bitfield_width); | ||
| 356 | p->config.control_parent = of_property_read_bool(pdev->dev.of_node, | ||
| 357 | "control-parent"); | ||
| 358 | } | ||
| 352 | if (!p->config.sense_bitfield_width) | 359 | if (!p->config.sense_bitfield_width) |
| 353 | p->config.sense_bitfield_width = 4; /* default to 4 bits */ | 360 | p->config.sense_bitfield_width = 4; /* default to 4 bits */ |
| 354 | 361 | ||
diff --git a/drivers/pinctrl/pinctrl-nomadik.c b/drivers/pinctrl/pinctrl-nomadik.c index 34281754b629..8a4f9c5c0b8e 100644 --- a/drivers/pinctrl/pinctrl-nomadik.c +++ b/drivers/pinctrl/pinctrl-nomadik.c | |||
| @@ -2104,15 +2104,15 @@ static struct pinctrl_desc nmk_pinctrl_desc = { | |||
| 2104 | 2104 | ||
| 2105 | static const struct of_device_id nmk_pinctrl_match[] = { | 2105 | static const struct of_device_id nmk_pinctrl_match[] = { |
| 2106 | { | 2106 | { |
| 2107 | .compatible = "stericsson,nmk-pinctrl-stn8815", | 2107 | .compatible = "stericsson,stn8815-pinctrl", |
| 2108 | .data = (void *)PINCTRL_NMK_STN8815, | 2108 | .data = (void *)PINCTRL_NMK_STN8815, |
| 2109 | }, | 2109 | }, |
| 2110 | { | 2110 | { |
| 2111 | .compatible = "stericsson,nmk-pinctrl", | 2111 | .compatible = "stericsson,db8500-pinctrl", |
| 2112 | .data = (void *)PINCTRL_NMK_DB8500, | 2112 | .data = (void *)PINCTRL_NMK_DB8500, |
| 2113 | }, | 2113 | }, |
| 2114 | { | 2114 | { |
| 2115 | .compatible = "stericsson,nmk-pinctrl-db8540", | 2115 | .compatible = "stericsson,db8540-pinctrl", |
| 2116 | .data = (void *)PINCTRL_NMK_DB8540, | 2116 | .data = (void *)PINCTRL_NMK_DB8540, |
| 2117 | }, | 2117 | }, |
| 2118 | {}, | 2118 | {}, |
diff --git a/drivers/regulator/ab8500.c b/drivers/regulator/ab8500.c index f6656b8c28b6..a19045ee0ec4 100644 --- a/drivers/regulator/ab8500.c +++ b/drivers/regulator/ab8500.c | |||
| @@ -2901,7 +2901,7 @@ static struct of_regulator_match ab8500_regulator_match[] = { | |||
| 2901 | { .name = "ab8500_ldo_tvout", .driver_data = (void *) AB8500_LDO_TVOUT, }, | 2901 | { .name = "ab8500_ldo_tvout", .driver_data = (void *) AB8500_LDO_TVOUT, }, |
| 2902 | { .name = "ab8500_ldo_audio", .driver_data = (void *) AB8500_LDO_AUDIO, }, | 2902 | { .name = "ab8500_ldo_audio", .driver_data = (void *) AB8500_LDO_AUDIO, }, |
| 2903 | { .name = "ab8500_ldo_anamic1", .driver_data = (void *) AB8500_LDO_ANAMIC1, }, | 2903 | { .name = "ab8500_ldo_anamic1", .driver_data = (void *) AB8500_LDO_ANAMIC1, }, |
| 2904 | { .name = "ab8500_ldo_amamic2", .driver_data = (void *) AB8500_LDO_ANAMIC2, }, | 2904 | { .name = "ab8500_ldo_anamic2", .driver_data = (void *) AB8500_LDO_ANAMIC2, }, |
| 2905 | { .name = "ab8500_ldo_dmic", .driver_data = (void *) AB8500_LDO_DMIC, }, | 2905 | { .name = "ab8500_ldo_dmic", .driver_data = (void *) AB8500_LDO_DMIC, }, |
| 2906 | { .name = "ab8500_ldo_ana", .driver_data = (void *) AB8500_LDO_ANA, }, | 2906 | { .name = "ab8500_ldo_ana", .driver_data = (void *) AB8500_LDO_ANA, }, |
| 2907 | }; | 2907 | }; |
| @@ -2917,7 +2917,7 @@ static struct of_regulator_match ab8505_regulator_match[] = { | |||
| 2917 | { .name = "ab8500_ldo_adc", .driver_data = (void *) AB8505_LDO_ADC, }, | 2917 | { .name = "ab8500_ldo_adc", .driver_data = (void *) AB8505_LDO_ADC, }, |
| 2918 | { .name = "ab8500_ldo_audio", .driver_data = (void *) AB8505_LDO_AUDIO, }, | 2918 | { .name = "ab8500_ldo_audio", .driver_data = (void *) AB8505_LDO_AUDIO, }, |
| 2919 | { .name = "ab8500_ldo_anamic1", .driver_data = (void *) AB8505_LDO_ANAMIC1, }, | 2919 | { .name = "ab8500_ldo_anamic1", .driver_data = (void *) AB8505_LDO_ANAMIC1, }, |
| 2920 | { .name = "ab8500_ldo_amamic2", .driver_data = (void *) AB8505_LDO_ANAMIC2, }, | 2920 | { .name = "ab8500_ldo_anamic2", .driver_data = (void *) AB8505_LDO_ANAMIC2, }, |
| 2921 | { .name = "ab8500_ldo_aux8", .driver_data = (void *) AB8505_LDO_AUX8, }, | 2921 | { .name = "ab8500_ldo_aux8", .driver_data = (void *) AB8505_LDO_AUX8, }, |
| 2922 | { .name = "ab8500_ldo_ana", .driver_data = (void *) AB8505_LDO_ANA, }, | 2922 | { .name = "ab8500_ldo_ana", .driver_data = (void *) AB8505_LDO_ANA, }, |
| 2923 | }; | 2923 | }; |
| @@ -2933,7 +2933,7 @@ static struct of_regulator_match ab8540_regulator_match[] = { | |||
| 2933 | { .name = "ab8500_ldo_tvout", .driver_data = (void *) AB8540_LDO_TVOUT, }, | 2933 | { .name = "ab8500_ldo_tvout", .driver_data = (void *) AB8540_LDO_TVOUT, }, |
| 2934 | { .name = "ab8500_ldo_audio", .driver_data = (void *) AB8540_LDO_AUDIO, }, | 2934 | { .name = "ab8500_ldo_audio", .driver_data = (void *) AB8540_LDO_AUDIO, }, |
| 2935 | { .name = "ab8500_ldo_anamic1", .driver_data = (void *) AB8540_LDO_ANAMIC1, }, | 2935 | { .name = "ab8500_ldo_anamic1", .driver_data = (void *) AB8540_LDO_ANAMIC1, }, |
| 2936 | { .name = "ab8500_ldo_amamic2", .driver_data = (void *) AB8540_LDO_ANAMIC2, }, | 2936 | { .name = "ab8500_ldo_anamic2", .driver_data = (void *) AB8540_LDO_ANAMIC2, }, |
| 2937 | { .name = "ab8500_ldo_dmic", .driver_data = (void *) AB8540_LDO_DMIC, }, | 2937 | { .name = "ab8500_ldo_dmic", .driver_data = (void *) AB8540_LDO_DMIC, }, |
| 2938 | { .name = "ab8500_ldo_ana", .driver_data = (void *) AB8540_LDO_ANA, }, | 2938 | { .name = "ab8500_ldo_ana", .driver_data = (void *) AB8540_LDO_ANA, }, |
| 2939 | { .name = "ab8500_ldo_sdio", .driver_data = (void *) AB8540_LDO_SDIO, }, | 2939 | { .name = "ab8500_ldo_sdio", .driver_data = (void *) AB8540_LDO_SDIO, }, |
| @@ -2948,7 +2948,7 @@ static struct of_regulator_match ab9540_regulator_match[] = { | |||
| 2948 | { .name = "ab8500_ldo_tvout", .driver_data = (void *) AB9540_LDO_TVOUT, }, | 2948 | { .name = "ab8500_ldo_tvout", .driver_data = (void *) AB9540_LDO_TVOUT, }, |
| 2949 | { .name = "ab8500_ldo_audio", .driver_data = (void *) AB9540_LDO_AUDIO, }, | 2949 | { .name = "ab8500_ldo_audio", .driver_data = (void *) AB9540_LDO_AUDIO, }, |
| 2950 | { .name = "ab8500_ldo_anamic1", .driver_data = (void *) AB9540_LDO_ANAMIC1, }, | 2950 | { .name = "ab8500_ldo_anamic1", .driver_data = (void *) AB9540_LDO_ANAMIC1, }, |
| 2951 | { .name = "ab8500_ldo_amamic2", .driver_data = (void *) AB9540_LDO_ANAMIC2, }, | 2951 | { .name = "ab8500_ldo_anamic2", .driver_data = (void *) AB9540_LDO_ANAMIC2, }, |
| 2952 | { .name = "ab8500_ldo_dmic", .driver_data = (void *) AB9540_LDO_DMIC, }, | 2952 | { .name = "ab8500_ldo_dmic", .driver_data = (void *) AB9540_LDO_DMIC, }, |
| 2953 | { .name = "ab8500_ldo_ana", .driver_data = (void *) AB9540_LDO_ANA, }, | 2953 | { .name = "ab8500_ldo_ana", .driver_data = (void *) AB9540_LDO_ANA, }, |
| 2954 | }; | 2954 | }; |
