]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
Merge branches 'clk-qcom-sdm845-camcc' and 'clk-mtk-unused' into clk-next
authorStephen Boyd <sboyd@kernel.org>
Thu, 18 Oct 2018 22:39:01 +0000 (15:39 -0700)
committerStephen Boyd <sboyd@kernel.org>
Thu, 18 Oct 2018 22:39:01 +0000 (15:39 -0700)
 - Qualcomm SDM845 camera clock controller

* clk-qcom-sdm845-camcc:
  clk: qcom: Add camera clock controller driver for SDM845
  dt-bindings: clock: Introduce QCOM Camera clock bindings

* clk-mtk-unused:
  clk: mediatek: remove unused array audio_parents

126 files changed:
Documentation/devicetree/bindings/clock/renesas,cpg-mssr.txt
drivers/clk/axs10x/pll_clock.c
drivers/clk/bcm/clk-kona-setup.c
drivers/clk/clk-asm9260.c
drivers/clk/clk-cdce925.c
drivers/clk/clk-fixed-factor.c
drivers/clk/clk-gpio.c
drivers/clk/clk-hsdk-pll.c
drivers/clk/clk-max77686.c
drivers/clk/clk-nomadik.c
drivers/clk/clk-npcm7xx.c
drivers/clk/clk-palmas.c
drivers/clk/clk-qoriq.c
drivers/clk/clk-s2mps11.c
drivers/clk/clk-scmi.c
drivers/clk/clk-scpi.c
drivers/clk/clk-si5351.c
drivers/clk/clk-stm32f4.c
drivers/clk/clk-stm32h7.c
drivers/clk/clk-stm32mp1.c
drivers/clk/clk-tango4.c
drivers/clk/hisilicon/reset.c
drivers/clk/keystone/gate.c
drivers/clk/keystone/pll.c
drivers/clk/mediatek/clk-mt2701.c
drivers/clk/mvebu/ap806-system-controller.c
drivers/clk/mvebu/armada-370.c
drivers/clk/mvebu/armada-375.c
drivers/clk/mvebu/armada-37xx-tbg.c
drivers/clk/mvebu/armada-37xx-xtal.c
drivers/clk/mvebu/armada-38x.c
drivers/clk/mvebu/armada-39x.c
drivers/clk/mvebu/armada-xp.c
drivers/clk/mvebu/clk-corediv.c
drivers/clk/mvebu/clk-cpu.c
drivers/clk/mvebu/common.c
drivers/clk/mvebu/common.h
drivers/clk/mvebu/cp110-system-controller.c
drivers/clk/mvebu/dove.c
drivers/clk/mvebu/kirkwood.c
drivers/clk/mvebu/mv98dx3236.c
drivers/clk/mvebu/orion.c
drivers/clk/qcom/clk-branch.c
drivers/clk/qcom/clk-rcg.h
drivers/clk/qcom/clk-rcg2.c
drivers/clk/qcom/gcc-msm8996.c
drivers/clk/qcom/gcc-sdm845.c
drivers/clk/renesas/Kconfig
drivers/clk/renesas/Makefile
drivers/clk/renesas/clk-div6.c
drivers/clk/renesas/clk-emev2.c
drivers/clk/renesas/clk-mstp.c
drivers/clk/renesas/clk-r8a73a4.c
drivers/clk/renesas/clk-r8a7740.c
drivers/clk/renesas/clk-r8a7778.c
drivers/clk/renesas/clk-r8a7779.c
drivers/clk/renesas/clk-rcar-gen2.c
drivers/clk/renesas/clk-rz.c
drivers/clk/renesas/clk-sh73a0.c
drivers/clk/renesas/r7s9210-cpg-mssr.c [new file with mode: 0644]
drivers/clk/renesas/r8a7743-cpg-mssr.c
drivers/clk/renesas/r8a7745-cpg-mssr.c
drivers/clk/renesas/r8a774a1-cpg-mssr.c [new file with mode: 0644]
drivers/clk/renesas/r8a774c0-cpg-mssr.c [new file with mode: 0644]
drivers/clk/renesas/r8a7790-cpg-mssr.c
drivers/clk/renesas/r8a7791-cpg-mssr.c
drivers/clk/renesas/r8a7792-cpg-mssr.c
drivers/clk/renesas/r8a7794-cpg-mssr.c
drivers/clk/renesas/r8a7795-cpg-mssr.c
drivers/clk/renesas/r8a7796-cpg-mssr.c
drivers/clk/renesas/r8a77965-cpg-mssr.c
drivers/clk/renesas/r8a77970-cpg-mssr.c
drivers/clk/renesas/r8a77980-cpg-mssr.c
drivers/clk/renesas/r8a77990-cpg-mssr.c
drivers/clk/renesas/r8a77995-cpg-mssr.c
drivers/clk/renesas/r9a06g032-clocks.c
drivers/clk/renesas/rcar-gen2-cpg.c
drivers/clk/renesas/rcar-gen2-cpg.h
drivers/clk/renesas/rcar-gen3-cpg.c
drivers/clk/renesas/rcar-gen3-cpg.h
drivers/clk/renesas/rcar-usb2-clock-sel.c
drivers/clk/renesas/renesas-cpg-mssr.c
drivers/clk/renesas/renesas-cpg-mssr.h
drivers/clk/st/clkgen-fsyn.c
drivers/clk/sunxi/clk-mod0.c
drivers/clk/sunxi/clk-sun9i-core.c
drivers/clk/sunxi/clk-sunxi.c
drivers/clk/ti/apll.c
drivers/clk/ti/clk-dra7-atl.c
drivers/clk/ti/clk.c
drivers/clk/ti/clkctrl.c
drivers/clk/ti/composite.c
drivers/clk/ti/divider.c
drivers/clk/ti/dpll.c
drivers/clk/ti/fapll.c
drivers/clk/ti/fixed-factor.c
drivers/clk/ti/gate.c
drivers/clk/ti/interface.c
drivers/clk/ti/mux.c
drivers/clk/zynq/clkc.c
include/dt-bindings/clock/maxim,max77686.h
include/dt-bindings/clock/maxim,max77802.h
include/dt-bindings/clock/qcom,gcc-msm8996.h
include/dt-bindings/clock/qcom,gcc-sdm845.h
include/dt-bindings/clock/r7s72100-clock.h
include/dt-bindings/clock/r7s9210-cpg-mssr.h [new file with mode: 0644]
include/dt-bindings/clock/r8a7743-cpg-mssr.h
include/dt-bindings/clock/r8a7744-cpg-mssr.h [new file with mode: 0644]
include/dt-bindings/clock/r8a7745-cpg-mssr.h
include/dt-bindings/clock/r8a774a1-cpg-mssr.h [new file with mode: 0644]
include/dt-bindings/clock/r8a774c0-cpg-mssr.h [new file with mode: 0644]
include/dt-bindings/clock/r8a7790-cpg-mssr.h
include/dt-bindings/clock/r8a7791-cpg-mssr.h
include/dt-bindings/clock/r8a7792-cpg-mssr.h
include/dt-bindings/clock/r8a7793-clock.h
include/dt-bindings/clock/r8a7793-cpg-mssr.h
include/dt-bindings/clock/r8a7794-clock.h
include/dt-bindings/clock/r8a7794-cpg-mssr.h
include/dt-bindings/clock/r8a7795-cpg-mssr.h
include/dt-bindings/clock/r8a7796-cpg-mssr.h
include/dt-bindings/clock/r8a77970-cpg-mssr.h
include/dt-bindings/clock/r8a77995-cpg-mssr.h
include/dt-bindings/clock/renesas-cpg-mssr.h
include/dt-bindings/clock/samsung,s2mps11.h
include/dt-bindings/clock/samsung,s3c64xx-clock.h
include/linux/clk/renesas.h

index db542abadb75bf0ca395ac0910506bce458fecee..916a601b76a7704931df7797e48f52276e4fd674 100644 (file)
@@ -13,9 +13,13 @@ They provide the following functionalities:
 
 Required Properties:
   - compatible: Must be one of:
+      - "renesas,r7s9210-cpg-mssr" for the r7s9210 SoC (RZ/A2)
       - "renesas,r8a7743-cpg-mssr" for the r8a7743 SoC (RZ/G1M)
+      - "renesas,r8a7744-cpg-mssr" for the r8a7744 SoC (RZ/G1N)
       - "renesas,r8a7745-cpg-mssr" for the r8a7745 SoC (RZ/G1E)
       - "renesas,r8a77470-cpg-mssr" for the r8a77470 SoC (RZ/G1C)
+      - "renesas,r8a774a1-cpg-mssr" for the r8a774a1 SoC (RZ/G2M)
+      - "renesas,r8a774c0-cpg-mssr" for the r8a774c0 SoC (RZ/G2E)
       - "renesas,r8a7790-cpg-mssr" for the r8a7790 SoC (R-Car H2)
       - "renesas,r8a7791-cpg-mssr" for the r8a7791 SoC (R-Car M2-W)
       - "renesas,r8a7792-cpg-mssr" for the r8a7792 SoC (R-Car V2H)
@@ -35,12 +39,13 @@ Required Properties:
   - clocks: References to external parent clocks, one entry for each entry in
     clock-names
   - clock-names: List of external parent clock names. Valid names are:
-      - "extal" (r8a7743, r8a7745, r8a77470, r8a7790, r8a7791, r8a7792,
-                r8a7793, r8a7794, r8a7795, r8a7796, r8a77965, r8a77970,
-                r8a77980, r8a77990, r8a77995)
-      - "extalr" (r8a7795, r8a7796, r8a77965, r8a77970, r8a77980)
-      - "usb_extal" (r8a7743, r8a7745, r8a77470, r8a7790, r8a7791, r8a7793,
-                    r8a7794)
+      - "extal" (r7s9210, r8a7743, r8a7744, r8a7745, r8a77470, r8a774a1,
+                r8a774c0, r8a7790, r8a7791, r8a7792, r8a7793, r8a7794,
+                r8a7795, r8a7796, r8a77965, r8a77970, r8a77980, r8a77990,
+                r8a77995)
+      - "extalr" (r8a774a1, r8a7795, r8a7796, r8a77965, r8a77970, r8a77980)
+      - "usb_extal" (r8a7743, r8a7744, r8a7745, r8a77470, r8a7790, r8a7791,
+                    r8a7793, r8a7794)
 
   - #clock-cells: Must be 2
       - For CPG core clocks, the two clock specifier cells must be "CPG_CORE"
index 25d8c240ddfb0f5d2fc61847f11b35badc69d441..c68dada973168474ff063b2eba98a11bfec5556e 100644 (file)
@@ -301,13 +301,13 @@ static void __init of_axs10x_pll_clk_setup(struct device_node *node)
 
        ret = clk_hw_register(NULL, &pll_clk->hw);
        if (ret) {
-               pr_err("failed to register %s clock\n", node->name);
+               pr_err("failed to register %pOFn clock\n", node);
                goto err_unmap_lock;
        }
 
        ret = of_clk_add_hw_provider(node, of_clk_hw_simple_get, &pll_clk->hw);
        if (ret) {
-               pr_err("failed to add hw provider for %s clock\n", node->name);
+               pr_err("failed to add hw provider for %pOFn clock\n", node);
                goto err_unregister_clk;
        }
 
index 281f4322355c135eded2fc5533a54498a0f0f49f..e65eeef9cbaf16ad3ba4238f0f17a12e70eb6915 100644 (file)
@@ -808,29 +808,29 @@ void __init kona_dt_ccu_setup(struct ccu_data *ccu,
 
        ret = of_address_to_resource(node, 0, &res);
        if (ret) {
-               pr_err("%s: no valid CCU registers found for %s\n", __func__,
-                       node->name);
+               pr_err("%s: no valid CCU registers found for %pOFn\n", __func__,
+                       node);
                goto out_err;
        }
 
        range = resource_size(&res);
        if (range > (resource_size_t)U32_MAX) {
-               pr_err("%s: address range too large for %s\n", __func__,
-                       node->name);
+               pr_err("%s: address range too large for %pOFn\n", __func__,
+                       node);
                goto out_err;
        }
 
        ccu->range = (u32)range;
 
        if (!ccu_data_valid(ccu)) {
-               pr_err("%s: ccu data not valid for %s\n", __func__, node->name);
+               pr_err("%s: ccu data not valid for %pOFn\n", __func__, node);
                goto out_err;
        }
 
        ccu->base = ioremap(res.start, ccu->range);
        if (!ccu->base) {
-               pr_err("%s: unable to map CCU registers for %s\n", __func__,
-                       node->name);
+               pr_err("%s: unable to map CCU registers for %pOFn\n", __func__,
+                       node);
                goto out_err;
        }
        ccu->node = of_node_get(node);
@@ -848,16 +848,16 @@ void __init kona_dt_ccu_setup(struct ccu_data *ccu,
 
        ret = of_clk_add_hw_provider(node, of_clk_kona_onecell_get, ccu);
        if (ret) {
-               pr_err("%s: error adding ccu %s as provider (%d)\n", __func__,
-                               node->name, ret);
+               pr_err("%s: error adding ccu %pOFn as provider (%d)\n", __func__,
+                               node, ret);
                goto out_err;
        }
 
        if (!kona_ccu_init(ccu))
-               pr_err("Broadcom %s initialization had errors\n", node->name);
+               pr_err("Broadcom %pOFn initialization had errors\n", node);
 
        return;
 out_err:
        kona_ccu_teardown(ccu);
-       pr_err("Broadcom %s setup aborted\n", node->name);
+       pr_err("Broadcom %pOFn setup aborted\n", node);
 }
index 44b5441571210468e99cce9d9269dfc57c4bca46..d571a00b5282d2b18774efc21c3d6aea0c660e09 100644 (file)
@@ -281,7 +281,7 @@ static void __init asm9260_acc_init(struct device_node *np)
 
        base = of_io_request_and_map(np, 0, np->name);
        if (IS_ERR(base))
-               panic("%s: unable to map resource", np->name);
+               panic("%pOFn: unable to map resource", np);
 
        /* register pll */
        rate = (ioread32(base + HW_SYSPLLCTRL) & 0xffff) * 1000000;
@@ -292,7 +292,7 @@ static void __init asm9260_acc_init(struct device_node *np)
                        ref_clk, 0, rate, accuracy);
 
        if (IS_ERR(hw))
-               panic("%s: can't register REFCLK. Check DT!", np->name);
+               panic("%pOFn: can't register REFCLK. Check DT!", np);
 
        for (n = 0; n < ARRAY_SIZE(asm9260_mux_clks); n++) {
                const struct asm9260_mux_clock *mc = &asm9260_mux_clks[n];
index 0a7e7d5a750605c5be12d953ac912f3fb9105962..23c9326ea48c5ef0bc3b5ef00bf9fbbd67e166c8 100644 (file)
@@ -669,8 +669,8 @@ static int cdce925_probe(struct i2c_client *client,
 
        /* Register PLL clocks */
        for (i = 0; i < data->chip_info->num_plls; ++i) {
-               pll_clk_name[i] = kasprintf(GFP_KERNEL, "%s.pll%d",
-                       client->dev.of_node->name, i);
+               pll_clk_name[i] = kasprintf(GFP_KERNEL, "%pOFn.pll%d",
+                       client->dev.of_node, i);
                init.name = pll_clk_name[i];
                data->pll[i].chip = data;
                data->pll[i].hw.init = &init;
@@ -703,6 +703,7 @@ static int cdce925_probe(struct i2c_client *client,
                                0x12 + (i*CDCE925_OFFSET_PLL),
                                0x07, value & 0x07);
                }
+               of_node_put(np_output);
        }
 
        /* Register output clock Y1 */
@@ -710,7 +711,7 @@ static int cdce925_probe(struct i2c_client *client,
        init.flags = 0;
        init.num_parents = 1;
        init.parent_names = &parent_name; /* Mux Y1 to input */
-       init.name = kasprintf(GFP_KERNEL, "%s.Y1", client->dev.of_node->name);
+       init.name = kasprintf(GFP_KERNEL, "%pOFn.Y1", client->dev.of_node);
        data->clk[0].chip = data;
        data->clk[0].hw.init = &init;
        data->clk[0].index = 0;
@@ -727,8 +728,8 @@ static int cdce925_probe(struct i2c_client *client,
        init.flags = CLK_SET_RATE_PARENT;
        init.num_parents = 1;
        for (i = 1; i < data->chip_info->num_outputs; ++i) {
-               init.name = kasprintf(GFP_KERNEL, "%s.Y%d",
-                       client->dev.of_node->name, i+1);
+               init.name = kasprintf(GFP_KERNEL, "%pOFn.Y%d",
+                       client->dev.of_node, i+1);
                data->clk[i].chip = data;
                data->clk[i].hw.init = &init;
                data->clk[i].index = i;
index 20724abd38bd132205713cce2e7960324652d12b..ef0ca9414f371bc3275b7afce529029e10b49f68 100644 (file)
@@ -158,14 +158,14 @@ static struct clk *_of_fixed_factor_clk_setup(struct device_node *node)
        int ret;
 
        if (of_property_read_u32(node, "clock-div", &div)) {
-               pr_err("%s Fixed factor clock <%s> must have a clock-div property\n",
-                       __func__, node->name);
+               pr_err("%s Fixed factor clock <%pOFn> must have a clock-div property\n",
+                       __func__, node);
                return ERR_PTR(-EIO);
        }
 
        if (of_property_read_u32(node, "clock-mult", &mult)) {
-               pr_err("%s Fixed factor clock <%s> must have a clock-mult property\n",
-                       __func__, node->name);
+               pr_err("%s Fixed factor clock <%pOFn> must have a clock-mult property\n",
+                       __func__, node);
                return ERR_PTR(-EIO);
        }
 
index 40af4fbab4d23f24acda1ab07fe1df887131c243..6a43ce420492f143be8eee203633d2faa2b7942e 100644 (file)
@@ -233,11 +233,11 @@ static int gpio_clk_driver_probe(struct platform_device *pdev)
        if (IS_ERR(gpiod)) {
                ret = PTR_ERR(gpiod);
                if (ret == -EPROBE_DEFER)
-                       pr_debug("%s: %s: GPIOs not yet available, retry later\n",
-                                       node->name, __func__);
+                       pr_debug("%pOFn: %s: GPIOs not yet available, retry later\n",
+                                       node, __func__);
                else
-                       pr_err("%s: %s: Can't get '%s' named GPIO property\n",
-                                       node->name, __func__,
+                       pr_err("%pOFn: %s: Can't get '%s' named GPIO property\n",
+                                       node, __func__,
                                        gpio_name);
                return ret;
        }
index c4ee280f454d9213b2bd1a82ac576e7fd790fb42..a47c2b600f20c188fde5c037321afe960dbcd7d9 100644 (file)
@@ -390,13 +390,13 @@ static void __init of_hsdk_pll_clk_setup(struct device_node *node)
 
        ret = clk_hw_register(NULL, &pll_clk->hw);
        if (ret) {
-               pr_err("failed to register %s clock\n", node->name);
+               pr_err("failed to register %pOFn clock\n", node);
                goto err_unmap_spec_regs;
        }
 
        ret = of_clk_add_hw_provider(node, of_clk_hw_simple_get, &pll_clk->hw);
        if (ret) {
-               pr_err("failed to add hw provider for %s clock\n", node->name);
+               pr_err("failed to add hw provider for %pOFn clock\n", node);
                goto err_unmap_spec_regs;
        }
 
index eb953d3b0b69bef048312fe9b6ec3c2678d815bb..02551fe4b87c5461c69d88a66b5b2f5b8fefbd6d 100644 (file)
@@ -1,24 +1,9 @@
-/*
- * clk-max77686.c - Clock driver for Maxim 77686/MAX77802
- *
- * Copyright (C) 2012 Samsung Electornics
- * Jonghwa Lee <jonghwa3.lee@samsung.com>
- *
- * This program is free software; you can redistribute  it and/or modify it
- * under  the terms of  the GNU General  Public License as published by the
- * Free Software Foundation;  either version 2 of the  License, or (at your
- * option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- *
- */
+// SPDX-License-Identifier: GPL-2.0+
+//
+// clk-max77686.c - Clock driver for Maxim 77686/MAX77802
+//
+// Copyright (C) 2012 Samsung Electornics
+// Jonghwa Lee <jonghwa3.lee@samsung.com>
 
 #include <linux/kernel.h>
 #include <linux/slab.h>
index 13ad6d1e509082f12b0466acb127c3cffc858cba..84a24875c6298a3e6ee1ba9688bcef826056e3ca 100644 (file)
@@ -97,8 +97,8 @@ static void __init nomadik_src_init(void)
        }
        src_base = of_iomap(np, 0);
        if (!src_base) {
-               pr_err("%s: must have src parent node with REGS (%s)\n",
-                      __func__, np->name);
+               pr_err("%s: must have src parent node with REGS (%pOFn)\n",
+                      __func__, np);
                return;
        }
 
index 740af90a950820055d9934f66e080c338f0cf143..afb0eb1069530798ad9c00c46094d108cb833b4b 100644 (file)
@@ -549,7 +549,7 @@ static void __init npcm7xx_clk_init(struct device_node *clk_np)
 
        ret = of_address_to_resource(clk_np, 0, &res);
        if (ret) {
-               pr_err("%s: failed to get resource, ret %d\n", clk_np->name,
+               pr_err("%pOFn: failed to get resource, ret %d\n", clk_np,
                        ret);
                return;
        }
index 7f51c01085abee76a30828f08b52bac935f172d5..e9612e7068e9e80175e81645d8641b898c68d358 100644 (file)
@@ -195,8 +195,8 @@ static void palmas_clks_get_clk_data(struct platform_device *pdev,
                prop = PALMAS_EXT_CONTROL_NSLEEP;
                break;
        default:
-               dev_warn(&pdev->dev, "%s: Invalid ext control option: %u\n",
-                        node->name, prop);
+               dev_warn(&pdev->dev, "%pOFn: Invalid ext control option: %u\n",
+                        node, prop);
                prop = 0;
                break;
        }
index 3a1812f65e5d823242d4428672736ce04f865a33..4c30b6e799ed1ea1e22dcc8f920ec54309a024f6 100644 (file)
@@ -945,8 +945,8 @@ static void __init core_mux_init(struct device_node *np)
 
        rc = of_clk_add_provider(np, of_clk_src_simple_get, clk);
        if (rc) {
-               pr_err("%s: Couldn't register clk provider for node %s: %d\n",
-                      __func__, np->name, rc);
+               pr_err("%s: Couldn't register clk provider for node %pOFn: %d\n",
+                      __func__, np, rc);
                return;
        }
 }
@@ -1199,8 +1199,8 @@ static void __init legacy_pll_init(struct device_node *np, int idx)
 
        rc = of_clk_add_provider(np, of_clk_src_onecell_get, onecell_data);
        if (rc) {
-               pr_err("%s: Couldn't register clk provider for node %s: %d\n",
-                      __func__, np->name, rc);
+               pr_err("%s: Couldn't register clk provider for node %pOFn: %d\n",
+                      __func__, np, rc);
                goto err_cell;
        }
 
@@ -1360,7 +1360,7 @@ static void __init clockgen_init(struct device_node *np)
                is_old_ls1021a = true;
        }
        if (!clockgen.regs) {
-               pr_err("%s(): %s: of_iomap() failed\n", __func__, np->name);
+               pr_err("%s(): %pOFn: of_iomap() failed\n", __func__, np);
                return;
        }
 
@@ -1406,8 +1406,8 @@ static void __init clockgen_init(struct device_node *np)
 
        ret = of_clk_add_provider(np, clockgen_clk_get, &clockgen);
        if (ret) {
-               pr_err("%s: Couldn't register clk provider for node %s: %d\n",
-                      __func__, np->name, ret);
+               pr_err("%s: Couldn't register clk provider for node %pOFn: %d\n",
+                      __func__, np, ret);
        }
 
        return;
index d44e0eea31ec6de81e471469eee884f37a559fca..56221647207d78a2518cff96ef31aa4386d46ba3 100644 (file)
@@ -1,19 +1,8 @@
-/*
- * clk-s2mps11.c - Clock driver for S2MPS11.
- *
- * Copyright (C) 2013,2014 Samsung Electornics
- *
- * This program is free software; you can redistribute  it and/or modify it
- * under  the terms of  the GNU General  Public License as published by the
- * Free Software Foundation;  either version 2 of the  License, or (at your
- * option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- */
+// SPDX-License-Identifier: GPL-2.0+
+//
+// clk-s2mps11.c - Clock driver for S2MPS11.
+//
+// Copyright (C) 2013,2014 Samsung Electornics
 
 #include <linux/module.h>
 #include <linux/err.h>
 #include <linux/mfd/samsung/s5m8767.h>
 #include <linux/mfd/samsung/core.h>
 
-enum {
-       S2MPS11_CLK_AP = 0,
-       S2MPS11_CLK_CP,
-       S2MPS11_CLK_BT,
-       S2MPS11_CLKS_NUM,
-};
+#include <dt-bindings/clock/samsung,s2mps11.h>
 
 struct s2mps11_clk {
        struct sec_pmic_dev *iodev;
index a985bf5e1ac61e6df1a56e153ed75640e0161072..a2287c770d5c07408365b89a49450c554f48d55a 100644 (file)
@@ -132,7 +132,7 @@ static int scmi_clocks_probe(struct scmi_device *sdev)
 
        count = handle->clk_ops->count_get(handle);
        if (count < 0) {
-               dev_err(dev, "%s: invalid clock output count\n", np->name);
+               dev_err(dev, "%pOFn: invalid clock output count\n", np);
                return -EINVAL;
        }
 
index 25854722810ed7791afd9830de51794e20ad676f..d3ccc1cfccd5e10619acb4056d40c5b1fe963b56 100644 (file)
@@ -207,7 +207,7 @@ static int scpi_clk_add(struct device *dev, struct device_node *np,
 
        count = of_property_count_strings(np, "clock-output-names");
        if (count < 0) {
-               dev_err(dev, "%s: invalid clock output count\n", np->name);
+               dev_err(dev, "%pOFn: invalid clock output count\n", np);
                return -EINVAL;
        }
 
@@ -232,13 +232,13 @@ static int scpi_clk_add(struct device *dev, struct device_node *np,
 
                if (of_property_read_string_index(np, "clock-output-names",
                                                  idx, &name)) {
-                       dev_err(dev, "invalid clock name @ %s\n", np->name);
+                       dev_err(dev, "invalid clock name @ %pOFn\n", np);
                        return -EINVAL;
                }
 
                if (of_property_read_u32_index(np, "clock-indices",
                                               idx, &val)) {
-                       dev_err(dev, "invalid clock index @ %s\n", np->name);
+                       dev_err(dev, "invalid clock index @ %pOFn\n", np);
                        return -EINVAL;
                }
 
index 50e7c341e97e91c6faaaef55bbdd27645248679c..8bdf91b560125afb47b0afc20b72c3373aa917d0 100644 (file)
@@ -1215,8 +1215,8 @@ static int si5351_dt_parse(struct i2c_client *client,
        /* per clkout properties */
        for_each_child_of_node(np, child) {
                if (of_property_read_u32(child, "reg", &num)) {
-                       dev_err(&client->dev, "missing reg property of %s\n",
-                               child->name);
+                       dev_err(&client->dev, "missing reg property of %pOFn\n",
+                               child);
                        goto put_child;
                }
 
index 294850bdc195d7923f684dd5d5f17eb7f883ed68..cdaa567c8042eea0e5ee29ec7775bdc97e295a3d 100644 (file)
@@ -1433,7 +1433,7 @@ static void __init stm32f4_rcc_init(struct device_node *np)
 
        base = of_iomap(np, 0);
        if (!base) {
-               pr_err("%s: unable to map resource\n", np->name);
+               pr_err("%pOFn: unable to map resource\n", np);
                return;
        }
 
index d3271eca3779026d3a0316c381de13ca2d10411e..0ea7261d15e07ca0b7d859b29412f62a323d3e4f 100644 (file)
@@ -1216,7 +1216,7 @@ static void __init stm32h7_rcc_init(struct device_node *np)
        /* get RCC base @ from DT */
        base = of_iomap(np, 0);
        if (!base) {
-               pr_err("%s: unable to map resource", np->name);
+               pr_err("%pOFn: unable to map resource", np);
                goto err_free_clks;
        }
 
index a907555b2a3d8f5c7882e5be1e080eed5fda1767..4f48342bc2802bd7a9c9402594e035a1c97ad91a 100644 (file)
@@ -2088,7 +2088,7 @@ static void stm32mp1_rcc_init(struct device_node *np)
 
        base = of_iomap(np, 0);
        if (!base) {
-               pr_err("%s: unable to map resource", np->name);
+               pr_err("%pOFn: unable to map resource", np);
                of_node_put(np);
                return;
        }
index 34b22b7930fbc0483611c8e752fb93db30e64b8d..fe12a43f7a4008011aa9c8af774150abbeb19354 100644 (file)
@@ -54,13 +54,13 @@ static void __init tango4_clkgen_setup(struct device_node *np)
        const char *parent = of_clk_get_parent_name(np, 0);
 
        if (!base)
-               panic("%s: invalid address\n", np->name);
+               panic("%pOFn: invalid address\n", np);
 
        if (readl(base + CPUCLK_DIV) & DIV_BYPASS)
-               panic("%s: unsupported cpuclk setup\n", np->name);
+               panic("%pOFn: unsupported cpuclk setup\n", np);
 
        if (readl(base + SYSCLK_DIV) & DIV_BYPASS)
-               panic("%s: unsupported sysclk setup\n", np->name);
+               panic("%pOFn: unsupported sysclk setup\n", np);
 
        writel(0x100, base + CPUCLK_DIV); /* disable frequency ramping */
 
@@ -77,9 +77,9 @@ static void __init tango4_clkgen_setup(struct device_node *np)
        pp[3] = clk_register_fixed_factor(NULL, "sdio_clk", "cd6", 0, 1, 2);
 
        if (IS_ERR(pp[0]) || IS_ERR(pp[1]) || IS_ERR(pp[2]) || IS_ERR(pp[3]))
-               panic("%s: clk registration failed\n", np->name);
+               panic("%pOFn: clk registration failed\n", np);
 
        if (of_clk_add_provider(np, of_clk_src_onecell_get, &clk_data))
-               panic("%s: clk provider registration failed\n", np->name);
+               panic("%pOFn: clk provider registration failed\n", np);
 }
 CLK_OF_DECLARE(tango4_clkgen, "sigma,tango4-clkgen", tango4_clkgen_setup);
index 2a5015c736ce6d604d371c0bcd2a894d1ae4015f..43e82fa644226894bb520f4134740f98577ac297 100644 (file)
@@ -109,9 +109,8 @@ struct hisi_reset_controller *hisi_reset_init(struct platform_device *pdev)
                return NULL;
 
        res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       rstc->membase = devm_ioremap(&pdev->dev,
-                               res->start, resource_size(res));
-       if (!rstc->membase)
+       rstc->membase = devm_ioremap_resource(&pdev->dev, res);
+       if (IS_ERR(rstc->membase))
                return NULL;
 
        spin_lock_init(&rstc->lock);
index aed5af23895be786db801a2d11360fa3e4a63f2b..def15db4eef0601811314e2e2437da41184fb1c7 100644 (file)
@@ -245,7 +245,7 @@ static void __init of_psc_clk_init(struct device_node *node, spinlock_t *lock)
                return;
        }
 
-       pr_err("%s: error registering clk %s\n", __func__, node->name);
+       pr_err("%s: error registering clk %pOFn\n", __func__, node);
 
 unmap_domain:
        iounmap(data->domain_base);
index e7e840fb74eaf7cf58da79d31fbf8d2dd9daeea2..2b871fc91d560d5f361329f010bdf5963c78ec59 100644 (file)
@@ -219,7 +219,7 @@ static void __init _of_pll_clk_init(struct device_node *node, bool pllctrl)
        }
 
 out:
-       pr_err("%s: error initializing pll %s\n", __func__, node->name);
+       pr_err("%s: error initializing pll %pOFn\n", __func__, node);
        kfree(pll_data);
 }
 
index 4dda8988b2f091a665860ae5b2f5dc4cc0492a23..ab6ab07f53e64b79cc7133929ebd3efb9bb1f71f 100644 (file)
@@ -249,11 +249,6 @@ static const char * const msdc30_parents[] = {
        "univpll2_d4"
 };
 
-static const char * const audio_parents[] = {
-       "clk26m",
-       "syspll1_d16"
-};
-
 static const char * const aud_intbus_parents[] = {
        "clk26m",
        "syspll1_d4",
index fa2fbd2cef4a343b50ccec04224c7dfc07dd6c52..9fbec3eb725f17300322db492cfb203448ab09fd 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
  * Marvell Armada AP806 System Controller
  *
@@ -5,9 +6,6 @@
  *
  * Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
  *
- * This file is licensed under the terms of the GNU General Public
- * License version 2.  This program is licensed "as is" without any
- * warranty of any kind, whether express or implied.
  */
 
 #define pr_fmt(fmt) "ap806-system-controller: " fmt
index 2c7c1085f88300ca84ac529831876af25376a047..7dedfaa6e152033bd3f5e1e60dec8c28c86edfe9 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
  * Marvell Armada 370 SoC clocks
  *
@@ -7,9 +8,6 @@
  * Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
  * Andrew Lunn <andrew@lunn.ch>
  *
- * This file is licensed under the terms of the GNU General Public
- * License version 2.  This program is licensed "as is" without any
- * warranty of any kind, whether express or implied.
  */
 
 #include <linux/kernel.h>
index c7af2242b796866a9367b02c0a74827499901a1f..a7157c69023861c644173291cdd0ec89f8e0b99f 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
  * Marvell Armada 375 SoC clocks
  *
@@ -7,9 +8,6 @@
  * Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
  * Andrew Lunn <andrew@lunn.ch>
  *
- * This file is licensed under the terms of the GNU General Public
- * License version 2.  This program is licensed "as is" without any
- * warranty of any kind, whether express or implied.
  */
 
 #include <linux/kernel.h>
index 7ff041f73b5530b1bff020d9ad21c32b3f808050..ee272d4d8c24ffd6637944dafeaa8f875b53a269 100644 (file)
@@ -1,13 +1,10 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * Marvell Armada 37xx SoC Time Base Generator clocks
  *
  * Copyright (C) 2016 Marvell
  *
  * Gregory CLEMENT <gregory.clement@free-electrons.com>
- *
- * This file is licensed under the terms of the GNU General Public
- * License version 2 or later. This program is licensed "as is"
- * without any warranty of any kind, whether express or implied.
  */
 
 #include <linux/clk-provider.h>
@@ -99,12 +96,13 @@ static int armada_3700_tbg_clock_probe(struct platform_device *pdev)
        hw_tbg_data->num = NUM_TBG;
        platform_set_drvdata(pdev, hw_tbg_data);
 
-       parent = devm_clk_get(dev, NULL);
+       parent = clk_get(dev, NULL);
        if (IS_ERR(parent)) {
                dev_err(dev, "Could get the clock parent\n");
                return -EINVAL;
        }
        parent_name = __clk_get_name(parent);
+       clk_put(parent);
 
        res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
        reg = devm_ioremap_resource(dev, res);
index 612d65ede10a0d2e0efc2e07954855972e35572a..e9e306d4e9af9d440f9f0e94f1f2977e23ce68cd 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
  * Marvell Armada 37xx SoC xtal clocks
  *
@@ -5,9 +6,6 @@
  *
  * Gregory CLEMENT <gregory.clement@free-electrons.com>
  *
- * This file is licensed under the terms of the GNU General Public
- * License version 2.  This program is licensed "as is" without any
- * warranty of any kind, whether express or implied.
  */
 
 #include <linux/clk-provider.h>
index 9ff4ea63932d507c9a5b7289e34eddf125193652..ef2ab81f087dfd348ec3629ff985c3ad88642c5f 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
  * Marvell Armada 380/385 SoC clocks
  *
@@ -7,9 +8,6 @@
  * Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
  * Andrew Lunn <andrew@lunn.ch>
  *
- * This file is licensed under the terms of the GNU General Public
- * License version 2.  This program is licensed "as is" without any
- * warranty of any kind, whether express or implied.
  */
 
 #include <linux/kernel.h>
index 4fdfd32247a9cba1fbf3d855919fccacb02b0334..674ccfd6236e895cea2092d67f6f18cf3bee63f6 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
  * Marvell Armada 39x SoC clocks
  *
@@ -8,9 +9,6 @@
  * Andrew Lunn <andrew@lunn.ch>
  * Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
  *
- * This file is licensed under the terms of the GNU General Public
- * License version 2.  This program is licensed "as is" without any
- * warranty of any kind, whether express or implied.
  */
 
 #include <linux/kernel.h>
index 0ec44ae9a2a2676ea383925d3841cffa0dd93a67..e8f03293ec833a97886269f21c648dff00f9d6fb 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
  * Marvell Armada XP SoC clocks
  *
@@ -7,9 +8,6 @@
  * Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
  * Andrew Lunn <andrew@lunn.ch>
  *
- * This file is licensed under the terms of the GNU General Public
- * License version 2.  This program is licensed "as is" without any
- * warranty of any kind, whether express or implied.
  */
 
 #include <linux/kernel.h>
index 68f05c53d40e1a67c77ea1a49d1f6d4fe53cbe01..1fc84b0e72eec18ef5cddd7c3ba6d9ff4ea5e70c 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
  * MVEBU Core divider clock
  *
@@ -5,9 +6,6 @@
  *
  * Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
  *
- * This file is licensed under the terms of the GNU General Public
- * License version 2.  This program is licensed "as is" without any
- * warranty of any kind, whether express or implied.
  */
 
 #include <linux/kernel.h>
index 072aa38374ce9a2db26103b4ed83cfa8bcb70434..d1a71576736426eca55b4ca4fc291b017aa47231 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
  * Marvell MVEBU CPU clock handling.
  *
@@ -5,9 +6,6 @@
  *
  * Gregory CLEMENT <gregory.clement@free-electrons.com>
  *
- * This file is licensed under the terms of the GNU General Public
- * License version 2.  This program is licensed "as is" without any
- * warranty of any kind, whether express or implied.
  */
 #include <linux/kernel.h>
 #include <linux/slab.h>
index 472c88b90256945e1d70b7c5574a6b38a237c432..6ab3c2e627c715fa99a219b19c178e264bd1f8e7 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
  * Marvell EBU SoC common clock handling
  *
@@ -7,9 +8,6 @@
  * Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
  * Andrew Lunn <andrew@lunn.ch>
  *
- * This file is licensed under the terms of the GNU General Public
- * License version 2.  This program is licensed "as is" without any
- * warranty of any kind, whether express or implied.
  */
 
 #include <linux/kernel.h>
index f0de6c8a494a3ca65e18d340c3918e0b4396a43c..d1ab79b43105c007db9ff1aedf78cd312b9552dd 100644 (file)
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
 /*
  * Marvell EBU SoC common clock handling
  *
@@ -7,9 +8,6 @@
  * Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
  * Andrew Lunn <andrew@lunn.ch>
  *
- * This file is licensed under the terms of the GNU General Public
- * License version 2. This program is licensed "as is" without any
- * warranty of any kind, whether express or implied.
  */
 
 #ifndef __CLK_MVEBU_COMMON_H_
index 75bf7b8f282fc4e4cc0e342e16d5594b7cba1274..9781b1bf599884d6ae37b06dea03453dc8caac35 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
  * Marvell Armada CP110 System Controller
  *
@@ -5,9 +6,6 @@
  *
  * Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
  *
- * This file is licensed under the terms of the GNU General Public
- * License version 2.  This program is licensed "as is" without any
- * warranty of any kind, whether express or implied.
  */
 
 /*
index 59fad9546c847946d71bd8348dcff615f936e0e4..e0dd99f36bf43dcdd8788e4e97c474a944daaa0b 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
  * Marvell Dove SoC clocks
  *
@@ -7,9 +8,6 @@
  * Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
  * Andrew Lunn <andrew@lunn.ch>
  *
- * This file is licensed under the terms of the GNU General Public
- * License version 2.  This program is licensed "as is" without any
- * warranty of any kind, whether express or implied.
  */
 
 #include <linux/kernel.h>
index a2a8d614039da91a1b3f99272aa98e5952b79037..6f784167bda4a84c902b4f835070aa55cdd88b17 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
  * Marvell Kirkwood SoC clocks
  *
@@ -7,9 +8,6 @@
  * Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
  * Andrew Lunn <andrew@lunn.ch>
  *
- * This file is licensed under the terms of the GNU General Public
- * License version 2.  This program is licensed "as is" without any
- * warranty of any kind, whether express or implied.
  */
 
 #include <linux/kernel.h>
index 6e203af73cac1dff2fd409c7700a02376186085a..0a74cf7a7725a01bcd647752c7d14656bc1c79ad 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
  * Marvell MV98DX3236 SoC clocks
  *
@@ -7,9 +8,6 @@
  * Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
  * Andrew Lunn <andrew@lunn.ch>
  *
- * This file is licensed under the terms of the GNU General Public
- * License version 2.  This program is licensed "as is" without any
- * warranty of any kind, whether express or implied.
  */
 
 #include <linux/kernel.h>
index a6e5bee233855fcdc230480027ab071bec2f1275..f681a65be20a8651d4e94703d62e1134f6788be5 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
  * Marvell Orion SoC clocks
  *
@@ -5,9 +6,6 @@
  *
  * Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
  *
- * This file is licensed under the terms of the GNU General Public
- * License version 2.  This program is licensed "as is" without any
- * warranty of any kind, whether express or implied.
  */
 
 #include <linux/kernel.h>
index bc2205c450b641c35194fc8d1b4b12b19ee072fc..99446bf630aaad4282669c25c73cf85fcd4f549a 100644 (file)
@@ -18,7 +18,7 @@ static bool clk_branch_in_hwcg_mode(const struct clk_branch *br)
        u32 val;
 
        if (!br->hwcg_reg)
-               return 0;
+               return false;
 
        regmap_read(br->clkr.regmap, br->hwcg_reg, &val);
 
index dbd5a9e8355416a9edabeb09d474f7e9005a85c4..e5eca8a1abe484a6c5abb30f72e51164b762eaae 100644 (file)
@@ -163,4 +163,15 @@ extern const struct clk_ops clk_pixel_ops;
 extern const struct clk_ops clk_gfx3d_ops;
 extern const struct clk_ops clk_rcg2_shared_ops;
 
+struct clk_rcg_dfs_data {
+       struct clk_rcg2 *rcg;
+       struct clk_init_data *init;
+};
+
+#define DEFINE_RCG_DFS(r) \
+       { .rcg = &r##_src, .init = &r##_init }
+
+extern int qcom_cc_register_rcg_dfs(struct regmap *regmap,
+                                   const struct clk_rcg_dfs_data *rcgs,
+                                   size_t len);
 #endif
index 52208d4165f432ac7398e423139af52f84722844..6e3bd195d012fc17565a17d03b3d7770252d7075 100644 (file)
@@ -12,6 +12,7 @@
 #include <linux/delay.h>
 #include <linux/regmap.h>
 #include <linux/math64.h>
+#include <linux/slab.h>
 
 #include <asm/div64.h>
 
 #define N_REG                  0xc
 #define D_REG                  0x10
 
+/* Dynamic Frequency Scaling */
+#define MAX_PERF_LEVEL         8
+#define SE_CMD_DFSR_OFFSET     0x14
+#define SE_CMD_DFS_EN          BIT(0)
+#define SE_PERF_DFSR(level)    (0x1c + 0x4 * (level))
+#define SE_PERF_M_DFSR(level)  (0x5c + 0x4 * (level))
+#define SE_PERF_N_DFSR(level)  (0x9c + 0x4 * (level))
+
 enum freq_policy {
        FLOOR,
        CEIL,
@@ -929,3 +938,189 @@ const struct clk_ops clk_rcg2_shared_ops = {
        .set_rate_and_parent = clk_rcg2_shared_set_rate_and_parent,
 };
 EXPORT_SYMBOL_GPL(clk_rcg2_shared_ops);
+
+/* Common APIs to be used for DFS based RCGR */
+static void clk_rcg2_dfs_populate_freq(struct clk_hw *hw, unsigned int l,
+                                      struct freq_tbl *f)
+{
+       struct clk_rcg2 *rcg = to_clk_rcg2(hw);
+       struct clk_hw *p;
+       unsigned long prate = 0;
+       u32 val, mask, cfg, mode;
+       int i, num_parents;
+
+       regmap_read(rcg->clkr.regmap, rcg->cmd_rcgr + SE_PERF_DFSR(l), &cfg);
+
+       mask = BIT(rcg->hid_width) - 1;
+       f->pre_div = 1;
+       if (cfg & mask)
+               f->pre_div = cfg & mask;
+
+       cfg &= CFG_SRC_SEL_MASK;
+       cfg >>= CFG_SRC_SEL_SHIFT;
+
+       num_parents = clk_hw_get_num_parents(hw);
+       for (i = 0; i < num_parents; i++) {
+               if (cfg == rcg->parent_map[i].cfg) {
+                       f->src = rcg->parent_map[i].src;
+                       p = clk_hw_get_parent_by_index(&rcg->clkr.hw, i);
+                       prate = clk_hw_get_rate(p);
+               }
+       }
+
+       mode = cfg & CFG_MODE_MASK;
+       mode >>= CFG_MODE_SHIFT;
+       if (mode) {
+               mask = BIT(rcg->mnd_width) - 1;
+               regmap_read(rcg->clkr.regmap, rcg->cmd_rcgr + SE_PERF_M_DFSR(l),
+                           &val);
+               val &= mask;
+               f->m = val;
+
+               regmap_read(rcg->clkr.regmap, rcg->cmd_rcgr + SE_PERF_N_DFSR(l),
+                           &val);
+               val = ~val;
+               val &= mask;
+               val += f->m;
+               f->n = val;
+       }
+
+       f->freq = calc_rate(prate, f->m, f->n, mode, f->pre_div);
+}
+
+static int clk_rcg2_dfs_populate_freq_table(struct clk_rcg2 *rcg)
+{
+       struct freq_tbl *freq_tbl;
+       int i;
+
+       /* Allocate space for 1 extra since table is NULL terminated */
+       freq_tbl = kcalloc(MAX_PERF_LEVEL + 1, sizeof(*freq_tbl), GFP_KERNEL);
+       if (!freq_tbl)
+               return -ENOMEM;
+       rcg->freq_tbl = freq_tbl;
+
+       for (i = 0; i < MAX_PERF_LEVEL; i++)
+               clk_rcg2_dfs_populate_freq(&rcg->clkr.hw, i, freq_tbl + i);
+
+       return 0;
+}
+
+static int clk_rcg2_dfs_determine_rate(struct clk_hw *hw,
+                                  struct clk_rate_request *req)
+{
+       struct clk_rcg2 *rcg = to_clk_rcg2(hw);
+       int ret;
+
+       if (!rcg->freq_tbl) {
+               ret = clk_rcg2_dfs_populate_freq_table(rcg);
+               if (ret) {
+                       pr_err("Failed to update DFS tables for %s\n",
+                                       clk_hw_get_name(hw));
+                       return ret;
+               }
+       }
+
+       return clk_rcg2_determine_rate(hw, req);
+}
+
+static unsigned long
+clk_rcg2_dfs_recalc_rate(struct clk_hw *hw, unsigned long parent_rate)
+{
+       struct clk_rcg2 *rcg = to_clk_rcg2(hw);
+       u32 level, mask, cfg, m = 0, n = 0, mode, pre_div;
+
+       regmap_read(rcg->clkr.regmap,
+                   rcg->cmd_rcgr + SE_CMD_DFSR_OFFSET, &level);
+       level &= GENMASK(4, 1);
+       level >>= 1;
+
+       if (rcg->freq_tbl)
+               return rcg->freq_tbl[level].freq;
+
+       /*
+        * Assume that parent_rate is actually the parent because
+        * we can't do any better at figuring it out when the table
+        * hasn't been populated yet. We only populate the table
+        * in determine_rate because we can't guarantee the parents
+        * will be registered with the framework until then.
+        */
+       regmap_read(rcg->clkr.regmap, rcg->cmd_rcgr + SE_PERF_DFSR(level),
+                   &cfg);
+
+       mask = BIT(rcg->hid_width) - 1;
+       pre_div = 1;
+       if (cfg & mask)
+               pre_div = cfg & mask;
+
+       mode = cfg & CFG_MODE_MASK;
+       mode >>= CFG_MODE_SHIFT;
+       if (mode) {
+               mask = BIT(rcg->mnd_width) - 1;
+               regmap_read(rcg->clkr.regmap,
+                           rcg->cmd_rcgr + SE_PERF_M_DFSR(level), &m);
+               m &= mask;
+
+               regmap_read(rcg->clkr.regmap,
+                           rcg->cmd_rcgr + SE_PERF_N_DFSR(level), &n);
+               n = ~n;
+               n &= mask;
+               n += m;
+       }
+
+       return calc_rate(parent_rate, m, n, mode, pre_div);
+}
+
+static const struct clk_ops clk_rcg2_dfs_ops = {
+       .is_enabled = clk_rcg2_is_enabled,
+       .get_parent = clk_rcg2_get_parent,
+       .determine_rate = clk_rcg2_dfs_determine_rate,
+       .recalc_rate = clk_rcg2_dfs_recalc_rate,
+};
+
+static int clk_rcg2_enable_dfs(const struct clk_rcg_dfs_data *data,
+                              struct regmap *regmap)
+{
+       struct clk_rcg2 *rcg = data->rcg;
+       struct clk_init_data *init = data->init;
+       u32 val;
+       int ret;
+
+       ret = regmap_read(regmap, rcg->cmd_rcgr + SE_CMD_DFSR_OFFSET, &val);
+       if (ret)
+               return -EINVAL;
+
+       if (!(val & SE_CMD_DFS_EN))
+               return 0;
+
+       /*
+        * Rate changes with consumer writing a register in
+        * their own I/O region
+        */
+       init->flags |= CLK_GET_RATE_NOCACHE;
+       init->ops = &clk_rcg2_dfs_ops;
+
+       rcg->freq_tbl = NULL;
+
+       pr_debug("DFS registered for clk %s\n", init->name);
+
+       return 0;
+}
+
+int qcom_cc_register_rcg_dfs(struct regmap *regmap,
+                            const struct clk_rcg_dfs_data *rcgs, size_t len)
+{
+       int i, ret;
+
+       for (i = 0; i < len; i++) {
+               ret = clk_rcg2_enable_dfs(&rcgs[i], regmap);
+               if (ret) {
+                       const char *name = rcgs[i].init->name;
+
+                       pr_err("DFS register failed for clk %s\n", name);
+                       return ret;
+               }
+       }
+
+       return 0;
+}
+EXPORT_SYMBOL_GPL(qcom_cc_register_rcg_dfs);
index 9a3290fdd01b18eb0b8eb6a7ab90a16550fd9c3c..9d136172c27ca460172bd913af850ee4a3e32d55 100644 (file)
@@ -260,6 +260,36 @@ static struct clk_alpha_pll_postdiv gpll0 = {
        },
 };
 
+static struct clk_branch gcc_mmss_gpll0_div_clk = {
+       .halt_check = BRANCH_HALT_DELAY,
+       .clkr = {
+               .enable_reg = 0x5200c,
+               .enable_mask = BIT(0),
+               .hw.init = &(struct clk_init_data){
+                       .name = "gcc_mmss_gpll0_div_clk",
+                       .parent_names = (const char *[]){ "gpll0" },
+                       .num_parents = 1,
+                       .flags = CLK_SET_RATE_PARENT,
+                       .ops = &clk_branch2_ops,
+               },
+       },
+};
+
+static struct clk_branch gcc_mss_gpll0_div_clk = {
+       .halt_check = BRANCH_HALT_DELAY,
+       .clkr = {
+               .enable_reg = 0x5200c,
+               .enable_mask = BIT(2),
+               .hw.init = &(struct clk_init_data){
+                       .name = "gcc_mss_gpll0_div_clk",
+                       .parent_names = (const char *[]){ "gpll0" },
+                       .num_parents = 1,
+                       .flags = CLK_SET_RATE_PARENT,
+                       .ops = &clk_branch2_ops
+               },
+       },
+};
+
 static struct clk_alpha_pll gpll4_early = {
        .offset = 0x77000,
        .regs = clk_alpha_pll_regs[CLK_ALPHA_PLL_TYPE_DEFAULT],
@@ -2951,6 +2981,20 @@ static struct clk_branch gcc_smmu_aggre0_ahb_clk = {
        },
 };
 
+static struct clk_branch gcc_aggre1_pnoc_ahb_clk = {
+       .halt_reg = 0x82014,
+       .clkr = {
+               .enable_reg = 0x82014,
+               .enable_mask = BIT(0),
+               .hw.init = &(struct clk_init_data){
+                       .name = "gcc_aggre1_pnoc_ahb_clk",
+                       .parent_names = (const char *[]){ "periph_noc_clk_src" },
+                       .num_parents = 1,
+                       .ops = &clk_branch2_ops,
+               },
+       },
+};
+
 static struct clk_branch gcc_aggre2_ufs_axi_clk = {
        .halt_reg = 0x83014,
        .clkr = {
@@ -2981,6 +3025,34 @@ static struct clk_branch gcc_aggre2_usb3_axi_clk = {
        },
 };
 
+static struct clk_branch gcc_dcc_ahb_clk = {
+       .halt_reg = 0x84004,
+       .clkr = {
+               .enable_reg = 0x84004,
+               .enable_mask = BIT(0),
+               .hw.init = &(struct clk_init_data){
+                       .name = "gcc_dcc_ahb_clk",
+                       .parent_names = (const char *[]){ "config_noc_clk_src" },
+                       .num_parents = 1,
+                       .ops = &clk_branch2_ops,
+               },
+       },
+};
+
+static struct clk_branch gcc_aggre0_noc_mpu_cfg_ahb_clk = {
+       .halt_reg = 0x85000,
+       .clkr = {
+               .enable_reg = 0x85000,
+               .enable_mask = BIT(0),
+               .hw.init = &(struct clk_init_data){
+                       .name = "gcc_aggre0_noc_mpu_cfg_ahb_clk",
+                       .parent_names = (const char *[]){ "config_noc_clk_src" },
+                       .num_parents = 1,
+                       .ops = &clk_branch2_ops,
+               },
+       },
+};
+
 static struct clk_branch gcc_qspi_ahb_clk = {
        .halt_reg = 0x8b004,
        .clkr = {
@@ -3039,6 +3111,20 @@ static struct clk_branch gcc_hdmi_clkref_clk = {
        },
 };
 
+static struct clk_branch gcc_edp_clkref_clk = {
+       .halt_reg = 0x88004,
+       .clkr = {
+               .enable_reg = 0x88004,
+               .enable_mask = BIT(0),
+               .hw.init = &(struct clk_init_data){
+                       .name = "gcc_edp_clkref_clk",
+                       .parent_names = (const char *[]){ "xo" },
+                       .num_parents = 1,
+                       .ops = &clk_branch2_ops,
+               },
+       },
+};
+
 static struct clk_branch gcc_ufs_clkref_clk = {
        .halt_reg = 0x88008,
        .clkr = {
@@ -3095,6 +3181,62 @@ static struct clk_branch gcc_rx1_usb2_clkref_clk = {
        },
 };
 
+static struct clk_branch gcc_mss_cfg_ahb_clk = {
+       .halt_reg = 0x8a000,
+       .clkr = {
+               .enable_reg = 0x8a000,
+               .enable_mask = BIT(0),
+               .hw.init = &(struct clk_init_data){
+                       .name = "gcc_mss_cfg_ahb_clk",
+                       .parent_names = (const char *[]){ "config_noc_clk_src" },
+                       .num_parents = 1,
+                       .ops = &clk_branch2_ops,
+               },
+       },
+};
+
+static struct clk_branch gcc_mss_mnoc_bimc_axi_clk = {
+       .halt_reg = 0x8a004,
+       .clkr = {
+               .enable_reg = 0x8a004,
+               .enable_mask = BIT(0),
+               .hw.init = &(struct clk_init_data){
+                       .name = "gcc_mss_mnoc_bimc_axi_clk",
+                       .parent_names = (const char *[]){ "system_noc_clk_src" },
+                       .num_parents = 1,
+                       .ops = &clk_branch2_ops,
+               },
+       },
+};
+
+static struct clk_branch gcc_mss_snoc_axi_clk = {
+       .halt_reg = 0x8a024,
+       .clkr = {
+               .enable_reg = 0x8a024,
+               .enable_mask = BIT(0),
+               .hw.init = &(struct clk_init_data){
+                       .name = "gcc_mss_snoc_axi_clk",
+                       .parent_names = (const char *[]){ "system_noc_clk_src" },
+                       .num_parents = 1,
+                       .ops = &clk_branch2_ops,
+               },
+       },
+};
+
+static struct clk_branch gcc_mss_q6_bimc_axi_clk = {
+       .halt_reg = 0x8a028,
+       .clkr = {
+               .enable_reg = 0x8a028,
+               .enable_mask = BIT(0),
+               .hw.init = &(struct clk_init_data){
+                       .name = "gcc_mss_q6_bimc_axi_clk",
+                       .parent_names = (const char *[]){ "system_noc_clk_src" },
+                       .num_parents = 1,
+                       .ops = &clk_branch2_ops,
+               },
+       },
+};
+
 static struct clk_hw *gcc_msm8996_hws[] = {
        &xo.hw,
        &gpll0_early_div.hw,
@@ -3355,6 +3497,7 @@ static struct clk_regmap *gcc_msm8996_clocks[] = {
        [GCC_AGGRE0_CNOC_AHB_CLK] = &gcc_aggre0_cnoc_ahb_clk.clkr,
        [GCC_SMMU_AGGRE0_AXI_CLK] = &gcc_smmu_aggre0_axi_clk.clkr,
        [GCC_SMMU_AGGRE0_AHB_CLK] = &gcc_smmu_aggre0_ahb_clk.clkr,
+       [GCC_AGGRE1_PNOC_AHB_CLK] = &gcc_aggre1_pnoc_ahb_clk.clkr,
        [GCC_AGGRE2_UFS_AXI_CLK] = &gcc_aggre2_ufs_axi_clk.clkr,
        [GCC_AGGRE2_USB3_AXI_CLK] = &gcc_aggre2_usb3_axi_clk.clkr,
        [GCC_QSPI_AHB_CLK] = &gcc_qspi_ahb_clk.clkr,
@@ -3365,6 +3508,15 @@ static struct clk_regmap *gcc_msm8996_clocks[] = {
        [GCC_PCIE_CLKREF_CLK] = &gcc_pcie_clkref_clk.clkr,
        [GCC_RX2_USB2_CLKREF_CLK] = &gcc_rx2_usb2_clkref_clk.clkr,
        [GCC_RX1_USB2_CLKREF_CLK] = &gcc_rx1_usb2_clkref_clk.clkr,
+       [GCC_EDP_CLKREF_CLK] = &gcc_edp_clkref_clk.clkr,
+       [GCC_MSS_CFG_AHB_CLK] = &gcc_mss_cfg_ahb_clk.clkr,
+       [GCC_MSS_Q6_BIMC_AXI_CLK] = &gcc_mss_q6_bimc_axi_clk.clkr,
+       [GCC_MSS_SNOC_AXI_CLK] = &gcc_mss_snoc_axi_clk.clkr,
+       [GCC_MSS_MNOC_BIMC_AXI_CLK] = &gcc_mss_mnoc_bimc_axi_clk.clkr,
+       [GCC_DCC_AHB_CLK] = &gcc_dcc_ahb_clk.clkr,
+       [GCC_AGGRE0_NOC_MPU_CFG_AHB_CLK] = &gcc_aggre0_noc_mpu_cfg_ahb_clk.clkr,
+       [GCC_MMSS_GPLL0_DIV_CLK] = &gcc_mmss_gpll0_div_clk.clkr,
+       [GCC_MSS_GPLL0_DIV_CLK] = &gcc_mss_gpll0_div_clk.clkr,
 };
 
 static struct gdsc *gcc_msm8996_gdscs[] = {
index fa1a196350f1542ab5acf95528b7b329ecaddb98..08d593ed2ed6337af4cd722efff6b3523e0cd614 100644 (file)
@@ -356,6 +356,28 @@ static struct clk_rcg2 gcc_pcie_phy_refgen_clk_src = {
        },
 };
 
+static const struct freq_tbl ftbl_gcc_qspi_core_clk_src[] = {
+       F(19200000, P_BI_TCXO, 1, 0, 0),
+       F(100000000, P_GPLL0_OUT_MAIN, 6, 0, 0),
+       F(150000000, P_GPLL0_OUT_MAIN, 4, 0, 0),
+       F(300000000, P_GPLL0_OUT_MAIN, 2, 0, 0),
+       { }
+};
+
+static struct clk_rcg2 gcc_qspi_core_clk_src = {
+       .cmd_rcgr = 0x4b008,
+       .mnd_width = 0,
+       .hid_width = 5,
+       .parent_map = gcc_parent_map_0,
+       .freq_tbl = ftbl_gcc_qspi_core_clk_src,
+       .clkr.hw.init = &(struct clk_init_data){
+               .name = "gcc_qspi_core_clk_src",
+               .parent_names = gcc_parent_names_0,
+               .num_parents = 4,
+               .ops = &clk_rcg2_floor_ops,
+       },
+};
+
 static const struct freq_tbl ftbl_gcc_pdm2_clk_src[] = {
        F(9600000, P_BI_TCXO, 2, 0, 0),
        F(19200000, P_BI_TCXO, 1, 0, 0),
@@ -396,18 +418,27 @@ static const struct freq_tbl ftbl_gcc_qupv3_wrap0_s0_clk_src[] = {
        { }
 };
 
+static struct clk_init_data gcc_qupv3_wrap0_s0_clk_init = {
+       .name = "gcc_qupv3_wrap0_s0_clk_src",
+       .parent_names = gcc_parent_names_0,
+       .num_parents = 4,
+       .ops = &clk_rcg2_shared_ops,
+};
+
 static struct clk_rcg2 gcc_qupv3_wrap0_s0_clk_src = {
        .cmd_rcgr = 0x17034,
        .mnd_width = 16,
        .hid_width = 5,
        .parent_map = gcc_parent_map_0,
        .freq_tbl = ftbl_gcc_qupv3_wrap0_s0_clk_src,
-       .clkr.hw.init = &(struct clk_init_data){
-               .name = "gcc_qupv3_wrap0_s0_clk_src",
-               .parent_names = gcc_parent_names_0,
-               .num_parents = 4,
-               .ops = &clk_rcg2_shared_ops,
-       },
+       .clkr.hw.init = &gcc_qupv3_wrap0_s0_clk_init,
+};
+
+static struct clk_init_data gcc_qupv3_wrap0_s1_clk_init = {
+       .name = "gcc_qupv3_wrap0_s1_clk_src",
+       .parent_names = gcc_parent_names_0,
+       .num_parents = 4,
+       .ops = &clk_rcg2_shared_ops,
 };
 
 static struct clk_rcg2 gcc_qupv3_wrap0_s1_clk_src = {
@@ -416,12 +447,14 @@ static struct clk_rcg2 gcc_qupv3_wrap0_s1_clk_src = {
        .hid_width = 5,
        .parent_map = gcc_parent_map_0,
        .freq_tbl = ftbl_gcc_qupv3_wrap0_s0_clk_src,
-       .clkr.hw.init = &(struct clk_init_data){
-               .name = "gcc_qupv3_wrap0_s1_clk_src",
-               .parent_names = gcc_parent_names_0,
-               .num_parents = 4,
-               .ops = &clk_rcg2_shared_ops,
-       },
+       .clkr.hw.init = &gcc_qupv3_wrap0_s1_clk_init,
+};
+
+static struct clk_init_data gcc_qupv3_wrap0_s2_clk_init = {
+       .name = "gcc_qupv3_wrap0_s2_clk_src",
+       .parent_names = gcc_parent_names_0,
+       .num_parents = 4,
+       .ops = &clk_rcg2_shared_ops,
 };
 
 static struct clk_rcg2 gcc_qupv3_wrap0_s2_clk_src = {
@@ -430,12 +463,14 @@ static struct clk_rcg2 gcc_qupv3_wrap0_s2_clk_src = {
        .hid_width = 5,
        .parent_map = gcc_parent_map_0,
        .freq_tbl = ftbl_gcc_qupv3_wrap0_s0_clk_src,
-       .clkr.hw.init = &(struct clk_init_data){
-               .name = "gcc_qupv3_wrap0_s2_clk_src",
-               .parent_names = gcc_parent_names_0,
-               .num_parents = 4,
-               .ops = &clk_rcg2_shared_ops,
-       },
+       .clkr.hw.init = &gcc_qupv3_wrap0_s2_clk_init,
+};
+
+static struct clk_init_data gcc_qupv3_wrap0_s3_clk_init = {
+       .name = "gcc_qupv3_wrap0_s3_clk_src",
+       .parent_names = gcc_parent_names_0,
+       .num_parents = 4,
+       .ops = &clk_rcg2_shared_ops,
 };
 
 static struct clk_rcg2 gcc_qupv3_wrap0_s3_clk_src = {
@@ -444,12 +479,14 @@ static struct clk_rcg2 gcc_qupv3_wrap0_s3_clk_src = {
        .hid_width = 5,
        .parent_map = gcc_parent_map_0,
        .freq_tbl = ftbl_gcc_qupv3_wrap0_s0_clk_src,
-       .clkr.hw.init = &(struct clk_init_data){
-               .name = "gcc_qupv3_wrap0_s3_clk_src",
-               .parent_names = gcc_parent_names_0,
-               .num_parents = 4,
-               .ops = &clk_rcg2_shared_ops,
-       },
+       .clkr.hw.init = &gcc_qupv3_wrap0_s3_clk_init,
+};
+
+static struct clk_init_data gcc_qupv3_wrap0_s4_clk_init = {
+       .name = "gcc_qupv3_wrap0_s4_clk_src",
+       .parent_names = gcc_parent_names_0,
+       .num_parents = 4,
+       .ops = &clk_rcg2_shared_ops,
 };
 
 static struct clk_rcg2 gcc_qupv3_wrap0_s4_clk_src = {
@@ -458,12 +495,14 @@ static struct clk_rcg2 gcc_qupv3_wrap0_s4_clk_src = {
        .hid_width = 5,
        .parent_map = gcc_parent_map_0,
        .freq_tbl = ftbl_gcc_qupv3_wrap0_s0_clk_src,
-       .clkr.hw.init = &(struct clk_init_data){
-               .name = "gcc_qupv3_wrap0_s4_clk_src",
-               .parent_names = gcc_parent_names_0,
-               .num_parents = 4,
-               .ops = &clk_rcg2_shared_ops,
-       },
+       .clkr.hw.init = &gcc_qupv3_wrap0_s4_clk_init,
+};
+
+static struct clk_init_data gcc_qupv3_wrap0_s5_clk_init = {
+       .name = "gcc_qupv3_wrap0_s5_clk_src",
+       .parent_names = gcc_parent_names_0,
+       .num_parents = 4,
+       .ops = &clk_rcg2_shared_ops,
 };
 
 static struct clk_rcg2 gcc_qupv3_wrap0_s5_clk_src = {
@@ -472,12 +511,14 @@ static struct clk_rcg2 gcc_qupv3_wrap0_s5_clk_src = {
        .hid_width = 5,
        .parent_map = gcc_parent_map_0,
        .freq_tbl = ftbl_gcc_qupv3_wrap0_s0_clk_src,
-       .clkr.hw.init = &(struct clk_init_data){
-               .name = "gcc_qupv3_wrap0_s5_clk_src",
-               .parent_names = gcc_parent_names_0,
-               .num_parents = 4,
-               .ops = &clk_rcg2_shared_ops,
-       },
+       .clkr.hw.init = &gcc_qupv3_wrap0_s5_clk_init,
+};
+
+static struct clk_init_data gcc_qupv3_wrap0_s6_clk_init = {
+       .name = "gcc_qupv3_wrap0_s6_clk_src",
+       .parent_names = gcc_parent_names_0,
+       .num_parents = 4,
+       .ops = &clk_rcg2_shared_ops,
 };
 
 static struct clk_rcg2 gcc_qupv3_wrap0_s6_clk_src = {
@@ -486,12 +527,14 @@ static struct clk_rcg2 gcc_qupv3_wrap0_s6_clk_src = {
        .hid_width = 5,
        .parent_map = gcc_parent_map_0,
        .freq_tbl = ftbl_gcc_qupv3_wrap0_s0_clk_src,
-       .clkr.hw.init = &(struct clk_init_data){
-               .name = "gcc_qupv3_wrap0_s6_clk_src",
-               .parent_names = gcc_parent_names_0,
-               .num_parents = 4,
-               .ops = &clk_rcg2_shared_ops,
-       },
+       .clkr.hw.init = &gcc_qupv3_wrap0_s6_clk_init,
+};
+
+static struct clk_init_data gcc_qupv3_wrap0_s7_clk_init = {
+       .name = "gcc_qupv3_wrap0_s7_clk_src",
+       .parent_names = gcc_parent_names_0,
+       .num_parents = 4,
+       .ops = &clk_rcg2_shared_ops,
 };
 
 static struct clk_rcg2 gcc_qupv3_wrap0_s7_clk_src = {
@@ -500,12 +543,14 @@ static struct clk_rcg2 gcc_qupv3_wrap0_s7_clk_src = {
        .hid_width = 5,
        .parent_map = gcc_parent_map_0,
        .freq_tbl = ftbl_gcc_qupv3_wrap0_s0_clk_src,
-       .clkr.hw.init = &(struct clk_init_data){
-               .name = "gcc_qupv3_wrap0_s7_clk_src",
-               .parent_names = gcc_parent_names_0,
-               .num_parents = 4,
-               .ops = &clk_rcg2_shared_ops,
-       },
+       .clkr.hw.init = &gcc_qupv3_wrap0_s7_clk_init,
+};
+
+static struct clk_init_data gcc_qupv3_wrap1_s0_clk_init = {
+       .name = "gcc_qupv3_wrap1_s0_clk_src",
+       .parent_names = gcc_parent_names_0,
+       .num_parents = 4,
+       .ops = &clk_rcg2_shared_ops,
 };
 
 static struct clk_rcg2 gcc_qupv3_wrap1_s0_clk_src = {
@@ -514,12 +559,14 @@ static struct clk_rcg2 gcc_qupv3_wrap1_s0_clk_src = {
        .hid_width = 5,
        .parent_map = gcc_parent_map_0,
        .freq_tbl = ftbl_gcc_qupv3_wrap0_s0_clk_src,
-       .clkr.hw.init = &(struct clk_init_data){
-               .name = "gcc_qupv3_wrap1_s0_clk_src",
-               .parent_names = gcc_parent_names_0,
-               .num_parents = 4,
-               .ops = &clk_rcg2_shared_ops,
-       },
+       .clkr.hw.init = &gcc_qupv3_wrap1_s0_clk_init,
+};
+
+static struct clk_init_data gcc_qupv3_wrap1_s1_clk_init = {
+       .name = "gcc_qupv3_wrap1_s1_clk_src",
+       .parent_names = gcc_parent_names_0,
+       .num_parents = 4,
+       .ops = &clk_rcg2_shared_ops,
 };
 
 static struct clk_rcg2 gcc_qupv3_wrap1_s1_clk_src = {
@@ -528,12 +575,14 @@ static struct clk_rcg2 gcc_qupv3_wrap1_s1_clk_src = {
        .hid_width = 5,
        .parent_map = gcc_parent_map_0,
        .freq_tbl = ftbl_gcc_qupv3_wrap0_s0_clk_src,
-       .clkr.hw.init = &(struct clk_init_data){
-               .name = "gcc_qupv3_wrap1_s1_clk_src",
-               .parent_names = gcc_parent_names_0,
-               .num_parents = 4,
-               .ops = &clk_rcg2_shared_ops,
-       },
+       .clkr.hw.init = &gcc_qupv3_wrap1_s1_clk_init,
+};
+
+static struct clk_init_data gcc_qupv3_wrap1_s2_clk_init = {
+       .name = "gcc_qupv3_wrap1_s2_clk_src",
+       .parent_names = gcc_parent_names_0,
+       .num_parents = 4,
+       .ops = &clk_rcg2_shared_ops,
 };
 
 static struct clk_rcg2 gcc_qupv3_wrap1_s2_clk_src = {
@@ -542,12 +591,14 @@ static struct clk_rcg2 gcc_qupv3_wrap1_s2_clk_src = {
        .hid_width = 5,
        .parent_map = gcc_parent_map_0,
        .freq_tbl = ftbl_gcc_qupv3_wrap0_s0_clk_src,
-       .clkr.hw.init = &(struct clk_init_data){
-               .name = "gcc_qupv3_wrap1_s2_clk_src",
-               .parent_names = gcc_parent_names_0,
-               .num_parents = 4,
-               .ops = &clk_rcg2_shared_ops,
-       },
+       .clkr.hw.init = &gcc_qupv3_wrap1_s2_clk_init,
+};
+
+static struct clk_init_data gcc_qupv3_wrap1_s3_clk_init = {
+       .name = "gcc_qupv3_wrap1_s3_clk_src",
+       .parent_names = gcc_parent_names_0,
+       .num_parents = 4,
+       .ops = &clk_rcg2_shared_ops,
 };
 
 static struct clk_rcg2 gcc_qupv3_wrap1_s3_clk_src = {
@@ -556,12 +607,14 @@ static struct clk_rcg2 gcc_qupv3_wrap1_s3_clk_src = {
        .hid_width = 5,
        .parent_map = gcc_parent_map_0,
        .freq_tbl = ftbl_gcc_qupv3_wrap0_s0_clk_src,
-       .clkr.hw.init = &(struct clk_init_data){
-               .name = "gcc_qupv3_wrap1_s3_clk_src",
-               .parent_names = gcc_parent_names_0,
-               .num_parents = 4,
-               .ops = &clk_rcg2_shared_ops,
-       },
+       .clkr.hw.init = &gcc_qupv3_wrap1_s3_clk_init,
+};
+
+static struct clk_init_data gcc_qupv3_wrap1_s4_clk_init = {
+       .name = "gcc_qupv3_wrap1_s4_clk_src",
+       .parent_names = gcc_parent_names_0,
+       .num_parents = 4,
+       .ops = &clk_rcg2_shared_ops,
 };
 
 static struct clk_rcg2 gcc_qupv3_wrap1_s4_clk_src = {
@@ -570,12 +623,14 @@ static struct clk_rcg2 gcc_qupv3_wrap1_s4_clk_src = {
        .hid_width = 5,
        .parent_map = gcc_parent_map_0,
        .freq_tbl = ftbl_gcc_qupv3_wrap0_s0_clk_src,
-       .clkr.hw.init = &(struct clk_init_data){
-               .name = "gcc_qupv3_wrap1_s4_clk_src",
-               .parent_names = gcc_parent_names_0,
-               .num_parents = 4,
-               .ops = &clk_rcg2_shared_ops,
-       },
+       .clkr.hw.init = &gcc_qupv3_wrap1_s4_clk_init,
+};
+
+static struct clk_init_data gcc_qupv3_wrap1_s5_clk_init = {
+       .name = "gcc_qupv3_wrap1_s5_clk_src",
+       .parent_names = gcc_parent_names_0,
+       .num_parents = 4,
+       .ops = &clk_rcg2_shared_ops,
 };
 
 static struct clk_rcg2 gcc_qupv3_wrap1_s5_clk_src = {
@@ -584,12 +639,14 @@ static struct clk_rcg2 gcc_qupv3_wrap1_s5_clk_src = {
        .hid_width = 5,
        .parent_map = gcc_parent_map_0,
        .freq_tbl = ftbl_gcc_qupv3_wrap0_s0_clk_src,
-       .clkr.hw.init = &(struct clk_init_data){
-               .name = "gcc_qupv3_wrap1_s5_clk_src",
-               .parent_names = gcc_parent_names_0,
-               .num_parents = 4,
-               .ops = &clk_rcg2_shared_ops,
-       },
+       .clkr.hw.init = &gcc_qupv3_wrap1_s5_clk_init,
+};
+
+static struct clk_init_data gcc_qupv3_wrap1_s6_clk_init = {
+       .name = "gcc_qupv3_wrap1_s6_clk_src",
+       .parent_names = gcc_parent_names_0,
+       .num_parents = 4,
+       .ops = &clk_rcg2_shared_ops,
 };
 
 static struct clk_rcg2 gcc_qupv3_wrap1_s6_clk_src = {
@@ -598,12 +655,14 @@ static struct clk_rcg2 gcc_qupv3_wrap1_s6_clk_src = {
        .hid_width = 5,
        .parent_map = gcc_parent_map_0,
        .freq_tbl = ftbl_gcc_qupv3_wrap0_s0_clk_src,
-       .clkr.hw.init = &(struct clk_init_data){
-               .name = "gcc_qupv3_wrap1_s6_clk_src",
-               .parent_names = gcc_parent_names_0,
-               .num_parents = 4,
-               .ops = &clk_rcg2_shared_ops,
-       },
+       .clkr.hw.init = &gcc_qupv3_wrap1_s6_clk_init,
+};
+
+static struct clk_init_data gcc_qupv3_wrap1_s7_clk_init = {
+       .name = "gcc_qupv3_wrap1_s7_clk_src",
+       .parent_names = gcc_parent_names_0,
+       .num_parents = 4,
+       .ops = &clk_rcg2_shared_ops,
 };
 
 static struct clk_rcg2 gcc_qupv3_wrap1_s7_clk_src = {
@@ -612,12 +671,7 @@ static struct clk_rcg2 gcc_qupv3_wrap1_s7_clk_src = {
        .hid_width = 5,
        .parent_map = gcc_parent_map_0,
        .freq_tbl = ftbl_gcc_qupv3_wrap0_s0_clk_src,
-       .clkr.hw.init = &(struct clk_init_data){
-               .name = "gcc_qupv3_wrap1_s7_clk_src",
-               .parent_names = gcc_parent_names_0,
-               .num_parents = 4,
-               .ops = &clk_rcg2_shared_ops,
-       },
+       .clkr.hw.init = &gcc_qupv3_wrap1_s7_clk_init,
 };
 
 static const struct freq_tbl ftbl_gcc_sdcc2_apps_clk_src[] = {
@@ -1933,6 +1987,37 @@ static struct clk_branch gcc_qmip_video_ahb_clk = {
        },
 };
 
+static struct clk_branch gcc_qspi_cnoc_periph_ahb_clk = {
+       .halt_reg = 0x4b000,
+       .halt_check = BRANCH_HALT,
+       .clkr = {
+               .enable_reg = 0x4b000,
+               .enable_mask = BIT(0),
+               .hw.init = &(struct clk_init_data){
+                       .name = "gcc_qspi_cnoc_periph_ahb_clk",
+                       .ops = &clk_branch2_ops,
+               },
+       },
+};
+
+static struct clk_branch gcc_qspi_core_clk = {
+       .halt_reg = 0x4b004,
+       .halt_check = BRANCH_HALT,
+       .clkr = {
+               .enable_reg = 0x4b004,
+               .enable_mask = BIT(0),
+               .hw.init = &(struct clk_init_data){
+                       .name = "gcc_qspi_core_clk",
+                       .parent_names = (const char *[]){
+                               "gcc_qspi_core_clk_src",
+                       },
+                       .num_parents = 1,
+                       .flags = CLK_SET_RATE_PARENT,
+                       .ops = &clk_branch2_ops,
+               },
+       },
+};
+
 static struct clk_branch gcc_qupv3_wrap0_s0_clk = {
        .halt_reg = 0x17030,
        .halt_check = BRANCH_HALT_VOTED,
@@ -3381,6 +3466,9 @@ static struct clk_regmap *gcc_sdm845_clocks[] = {
        [GPLL4] = &gpll4.clkr,
        [GCC_CPUSS_DVM_BUS_CLK] = &gcc_cpuss_dvm_bus_clk.clkr,
        [GCC_CPUSS_GNOC_CLK] = &gcc_cpuss_gnoc_clk.clkr,
+       [GCC_QSPI_CORE_CLK_SRC] = &gcc_qspi_core_clk_src.clkr,
+       [GCC_QSPI_CORE_CLK] = &gcc_qspi_core_clk.clkr,
+       [GCC_QSPI_CNOC_PERIPH_AHB_CLK] = &gcc_qspi_cnoc_periph_ahb_clk.clkr,
 };
 
 static const struct qcom_reset_map gcc_sdm845_resets[] = {
@@ -3458,9 +3546,29 @@ static const struct of_device_id gcc_sdm845_match_table[] = {
 };
 MODULE_DEVICE_TABLE(of, gcc_sdm845_match_table);
 
+static const struct clk_rcg_dfs_data gcc_dfs_clocks[] = {
+       DEFINE_RCG_DFS(gcc_qupv3_wrap0_s0_clk),
+       DEFINE_RCG_DFS(gcc_qupv3_wrap0_s1_clk),
+       DEFINE_RCG_DFS(gcc_qupv3_wrap0_s2_clk),
+       DEFINE_RCG_DFS(gcc_qupv3_wrap0_s3_clk),
+       DEFINE_RCG_DFS(gcc_qupv3_wrap0_s4_clk),
+       DEFINE_RCG_DFS(gcc_qupv3_wrap0_s5_clk),
+       DEFINE_RCG_DFS(gcc_qupv3_wrap0_s6_clk),
+       DEFINE_RCG_DFS(gcc_qupv3_wrap0_s7_clk),
+       DEFINE_RCG_DFS(gcc_qupv3_wrap1_s0_clk),
+       DEFINE_RCG_DFS(gcc_qupv3_wrap1_s1_clk),
+       DEFINE_RCG_DFS(gcc_qupv3_wrap1_s2_clk),
+       DEFINE_RCG_DFS(gcc_qupv3_wrap1_s3_clk),
+       DEFINE_RCG_DFS(gcc_qupv3_wrap1_s4_clk),
+       DEFINE_RCG_DFS(gcc_qupv3_wrap1_s5_clk),
+       DEFINE_RCG_DFS(gcc_qupv3_wrap1_s6_clk),
+       DEFINE_RCG_DFS(gcc_qupv3_wrap1_s7_clk),
+};
+
 static int gcc_sdm845_probe(struct platform_device *pdev)
 {
        struct regmap *regmap;
+       int ret;
 
        regmap = qcom_cc_map(pdev, &gcc_sdm845_desc);
        if (IS_ERR(regmap))
@@ -3470,6 +3578,11 @@ static int gcc_sdm845_probe(struct platform_device *pdev)
        regmap_update_bits(regmap, 0x09ffc, 0x3, 0x3);
        regmap_update_bits(regmap, 0x71028, 0x3, 0x3);
 
+       ret = qcom_cc_register_rcg_dfs(regmap, gcc_dfs_clocks,
+                                       ARRAY_SIZE(gcc_dfs_clocks));
+       if (ret)
+               return ret;
+
        return qcom_cc_really_probe(pdev, &gcc_sdm845_desc, regmap);
 }
 
index 9022bbe1297e7f3c2c351ff55e854227f3d4049b..b879e3e3a6b426aed8e9d3729d0c9cee48bcde15 100644 (file)
@@ -1,13 +1,18 @@
+# SPDX-License-Identifier: GPL-2.0
+
 config CLK_RENESAS
        bool "Renesas SoC clock support" if COMPILE_TEST && !ARCH_RENESAS
        default y if ARCH_RENESAS
        select CLK_EMEV2 if ARCH_EMEV2
        select CLK_RZA1 if ARCH_R7S72100
+       select CLK_R7S9210 if ARCH_R7S9210
        select CLK_R8A73A4 if ARCH_R8A73A4
        select CLK_R8A7740 if ARCH_R8A7740
-       select CLK_R8A7743 if ARCH_R8A7743
+       select CLK_R8A7743 if ARCH_R8A7743 || ARCH_R8A7744
        select CLK_R8A7745 if ARCH_R8A7745
        select CLK_R8A77470 if ARCH_R8A77470
+       select CLK_R8A774A1 if ARCH_R8A774A1
+       select CLK_R8A774C0 if ARCH_R8A774C0
        select CLK_R8A7778 if ARCH_R8A7778
        select CLK_R8A7779 if ARCH_R8A7779
        select CLK_R8A7790 if ARCH_R8A7790
@@ -45,6 +50,10 @@ config CLK_RZA1
        bool "RZ/A1H clock support" if COMPILE_TEST
        select CLK_RENESAS_CPG_MSTP
 
+config CLK_R7S9210
+       bool "RZ/A2 clock support" if COMPILE_TEST
+       select CLK_RENESAS_CPG_MSSR
+
 config CLK_R8A73A4
        bool "R-Mobile APE6 clock support" if COMPILE_TEST
        select CLK_RENESAS_CPG_MSTP
@@ -67,6 +76,14 @@ config CLK_R8A77470
        bool "RZ/G1C clock support" if COMPILE_TEST
        select CLK_RCAR_GEN2_CPG
 
+config CLK_R8A774A1
+       bool "RZ/G2M clock support" if COMPILE_TEST
+       select CLK_RCAR_GEN3_CPG
+
+config CLK_R8A774C0
+       bool "RZ/G2E clock support" if COMPILE_TEST
+       select CLK_RCAR_GEN3_CPG
+
 config CLK_R8A7778
        bool "R-Car M1A clock support" if COMPILE_TEST
        select CLK_RENESAS_CPG_MSTP
index e4aa3d6143d2436a86f2daf997da8b0eb3a45f2f..c793e3cc9452af5fdbd7335302787633e7ab175c 100644 (file)
@@ -2,11 +2,14 @@
 # SoC
 obj-$(CONFIG_CLK_EMEV2)                        += clk-emev2.o
 obj-$(CONFIG_CLK_RZA1)                 += clk-rz.o
+obj-$(CONFIG_CLK_R7S9210)              += r7s9210-cpg-mssr.o
 obj-$(CONFIG_CLK_R8A73A4)              += clk-r8a73a4.o
 obj-$(CONFIG_CLK_R8A7740)              += clk-r8a7740.o
 obj-$(CONFIG_CLK_R8A7743)              += r8a7743-cpg-mssr.o
 obj-$(CONFIG_CLK_R8A7745)              += r8a7745-cpg-mssr.o
 obj-$(CONFIG_CLK_R8A77470)             += r8a77470-cpg-mssr.o
+obj-$(CONFIG_CLK_R8A774A1)             += r8a774a1-cpg-mssr.o
+obj-$(CONFIG_CLK_R8A774C0)             += r8a774c0-cpg-mssr.o
 obj-$(CONFIG_CLK_R8A7778)              += clk-r8a7778.o
 obj-$(CONFIG_CLK_R8A7779)              += clk-r8a7779.o
 obj-$(CONFIG_CLK_R8A7790)              += r8a7790-cpg-mssr.o
index 9febbf42c3df6979a8c667c8d08a1e7846acba8d..57c9341643065a9234fcf80514b6eb3a79e639e9 100644 (file)
@@ -1,13 +1,10 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
  * r8a7790 Common Clock Framework support
  *
  * Copyright (C) 2013  Renesas Solutions Corp.
  *
  * Contact: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2 of the License.
  */
 
 #include <linux/clk-provider.h>
@@ -312,8 +309,8 @@ static void __init cpg_div6_clock_init(struct device_node *np)
 
        num_parents = of_clk_get_parent_count(np);
        if (num_parents < 1) {
-               pr_err("%s: no parent found for %s DIV6 clock\n",
-                      __func__, np->name);
+               pr_err("%s: no parent found for %pOFn DIV6 clock\n",
+                      __func__, np);
                return;
        }
 
@@ -324,8 +321,8 @@ static void __init cpg_div6_clock_init(struct device_node *np)
 
        reg = of_iomap(np, 0);
        if (reg == NULL) {
-               pr_err("%s: failed to map %s DIV6 clock register\n",
-                      __func__, np->name);
+               pr_err("%s: failed to map %pOFn DIV6 clock register\n",
+                      __func__, np);
                goto error;
        }
 
@@ -337,8 +334,8 @@ static void __init cpg_div6_clock_init(struct device_node *np)
 
        clk = cpg_div6_register(clk_name, num_parents, parent_names, reg, NULL);
        if (IS_ERR(clk)) {
-               pr_err("%s: failed to register %s DIV6 clock (%ld)\n",
-                      __func__, np->name, PTR_ERR(clk));
+               pr_err("%s: failed to register %pOFn DIV6 clock (%ld)\n",
+                      __func__, np, PTR_ERR(clk));
                goto error;
        }
 
index a91825471c79acd28f68ea5f0f2c998d54a571d9..7807b30a5bbb590139a5c4d785e10699325253bc 100644 (file)
@@ -1,21 +1,9 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
  * EMMA Mobile EV2 common clock framework support
  *
  * Copyright (C) 2013 Takashi Yoshii <takashi.yoshii.ze@renesas.com>
  * Copyright (C) 2012 Magnus Damm
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2 of the License.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 #include <linux/clk-provider.h>
 #include <linux/clkdev.h>
@@ -86,8 +74,8 @@ static void __init emev2_smu_clkdiv_init(struct device_node *np)
        clk = clk_register_divider(NULL, np->name, parent_name, 0,
                                   smu_base + reg[0], reg[1], 8, 0, &lock);
        of_clk_add_provider(np, of_clk_src_simple_get, clk);
-       clk_register_clkdev(clk, np->name, NULL);
-       pr_debug("## %s %s %p\n", __func__, np->name, clk);
+       clk_register_clkdev(clk, np->full_name, NULL);
+       pr_debug("## %s %pOFn %p\n", __func__, np, clk);
 }
 CLK_OF_DECLARE(emev2_smu_clkdiv, "renesas,emev2-smu-clkdiv",
                emev2_smu_clkdiv_init);
@@ -104,7 +92,7 @@ static void __init emev2_smu_gclk_init(struct device_node *np)
        clk = clk_register_gate(NULL, np->name, parent_name, 0,
                                smu_base + reg[0], reg[1], 0, &lock);
        of_clk_add_provider(np, of_clk_src_simple_get, clk);
-       clk_register_clkdev(clk, np->name, NULL);
-       pr_debug("## %s %s %p\n", __func__, np->name, clk);
+       clk_register_clkdev(clk, np->full_name, NULL);
+       pr_debug("## %s %pOFn %p\n", __func__, np, clk);
 }
 CLK_OF_DECLARE(emev2_smu_gclk, "renesas,emev2-smu-gclk", emev2_smu_gclk_init);
index e82adcb16a52a3b790c34fc2a49079615a7bf907..1c1768c2cc8251cd2715839f464773ce5b2eb0b5 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
  * R-Car MSTP clocks
  *
@@ -5,10 +6,6 @@
  * Copyright (C) 2015 Glider bvba
  *
  * Contact: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2 of the License.
  */
 
 #include <linux/clk.h>
@@ -239,8 +236,8 @@ static void __init cpg_mstp_clocks_init(struct device_node *np)
                        break;
 
                if (clkidx >= MSTP_MAX_CLOCKS) {
-                       pr_err("%s: invalid clock %s %s index %u\n",
-                              __func__, np->name, name, clkidx);
+                       pr_err("%s: invalid clock %pOFn %s index %u\n",
+                              __func__, np, name, clkidx);
                        continue;
                }
 
@@ -259,8 +256,8 @@ static void __init cpg_mstp_clocks_init(struct device_node *np)
                         */
                        clk_register_clkdev(clks[clkidx], name, NULL);
                } else {
-                       pr_err("%s: failed to register %s %s clock (%ld)\n",
-                              __func__, np->name, name, PTR_ERR(clks[clkidx]));
+                       pr_err("%s: failed to register %pOFn %s clock (%ld)\n",
+                              __func__, np, name, PTR_ERR(clks[clkidx]));
                }
        }
 
index 7b903ce4c9015ad76a476c7f45707bd5960d390b..2719c248c67beb5fe1317c1c3bdd41ee5e2067f4 100644 (file)
@@ -1,11 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
  * r8a73a4 Core CPG Clocks
  *
  * Copyright (C) 2014  Ulrich Hecht
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2 of the License.
  */
 
 #include <linux/clk-provider.h>
@@ -228,8 +225,8 @@ static void __init r8a73a4_cpg_clocks_init(struct device_node *np)
 
                clk = r8a73a4_cpg_register_clock(np, cpg, name);
                if (IS_ERR(clk))
-                       pr_err("%s: failed to register %s %s clock (%ld)\n",
-                              __func__, np->name, name, PTR_ERR(clk));
+                       pr_err("%s: failed to register %pOFn %s clock (%ld)\n",
+                              __func__, np, name, PTR_ERR(clk));
                else
                        cpg->data.clks[i] = clk;
        }
index a7a30d2eca418f6e15febe5cf47aac91d426ec32..5967656c13cca91fd1b2822cd06ae27c407b906e 100644 (file)
@@ -1,11 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
  * r8a7740 Core CPG Clocks
  *
  * Copyright (C) 2014  Ulrich Hecht
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2 of the License.
  */
 
 #include <linux/clk-provider.h>
@@ -187,8 +184,8 @@ static void __init r8a7740_cpg_clocks_init(struct device_node *np)
 
                clk = r8a7740_cpg_register_clock(np, cpg, name);
                if (IS_ERR(clk))
-                       pr_err("%s: failed to register %s %s clock (%ld)\n",
-                              __func__, np->name, name, PTR_ERR(clk));
+                       pr_err("%s: failed to register %pOFn %s clock (%ld)\n",
+                              __func__, np, name, PTR_ERR(clk));
                else
                        cpg->data.clks[i] = clk;
        }
index 886a8380e91247a199f2852177b9fda5cff8f0ad..3ccc53685bdd22f57d95a2ed60daa64a3ff9f1ff 100644 (file)
@@ -1,11 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
  * r8a7778 Core CPG Clocks
  *
  * Copyright (C) 2014  Ulrich Hecht
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2 of the License.
  */
 
 #include <linux/clk-provider.h>
@@ -130,8 +127,8 @@ static void __init r8a7778_cpg_clocks_init(struct device_node *np)
 
                clk = r8a7778_cpg_register_clock(np, cpg, name);
                if (IS_ERR(clk))
-                       pr_err("%s: failed to register %s %s clock (%ld)\n",
-                              __func__, np->name, name, PTR_ERR(clk));
+                       pr_err("%s: failed to register %pOFn %s clock (%ld)\n",
+                              __func__, np, name, PTR_ERR(clk));
                else
                        cpg->data.clks[i] = clk;
        }
index 5adcca4656c33303e9630f6a3624b09b50242ddb..9f3b5522eef59a1269c679bd07735bbef511b6b1 100644 (file)
@@ -1,13 +1,10 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
  * r8a7779 Core CPG Clocks
  *
  * Copyright (C) 2013, 2014 Horms Solutions Ltd.
  *
  * Contact: Simon Horman <horms@verge.net.au>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2 of the License.
  */
 
 #include <linux/clk-provider.h>
@@ -164,8 +161,8 @@ static void __init r8a7779_cpg_clocks_init(struct device_node *np)
                clk = r8a7779_cpg_register_clock(np, cpg, config,
                                                 plla_mult, name);
                if (IS_ERR(clk))
-                       pr_err("%s: failed to register %s %s clock (%ld)\n",
-                              __func__, np->name, name, PTR_ERR(clk));
+                       pr_err("%s: failed to register %pOFn %s clock (%ld)\n",
+                              __func__, np, name, PTR_ERR(clk));
                else
                        cpg->data.clks[i] = clk;
        }
index bccd62f2cb092fac27416764d4eba89d98e305ba..2913b414815748632686b6a1e980e84d5ce48c0d 100644 (file)
@@ -1,13 +1,10 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
  * rcar_gen2 Core CPG Clocks
  *
  * Copyright (C) 2013  Ideas On Board SPRL
  *
  * Contact: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2 of the License.
  */
 
 #include <linux/clk-provider.h>
@@ -445,8 +442,8 @@ static void __init rcar_gen2_cpg_clocks_init(struct device_node *np)
 
                clk = rcar_gen2_cpg_register_clock(np, cpg, config, name);
                if (IS_ERR(clk))
-                       pr_err("%s: failed to register %s %s clock (%ld)\n",
-                              __func__, np->name, name, PTR_ERR(clk));
+                       pr_err("%s: failed to register %pOFn %s clock (%ld)\n",
+                              __func__, np, name, PTR_ERR(clk));
                else
                        cpg->data.clks[i] = clk;
        }
index ac2f86d626b694be3824c7465c7e7aae3897a9af..3cda53a97f4e6b4a0d5b90bd2d70c279e8aa83e1 100644 (file)
@@ -1,12 +1,9 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
  * RZ/A1 Core CPG Clocks
  *
  * Copyright (C) 2013 Ideas On Board SPRL
  * Copyright (C) 2014 Wolfram Sang, Sang Engineering <wsa@sang-engineering.com>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2 of the License.
  */
 
 #include <linux/clk-provider.h>
@@ -113,8 +110,8 @@ static void __init rz_cpg_clocks_init(struct device_node *np)
 
                clk = rz_cpg_register_clock(np, cpg, name);
                if (IS_ERR(clk))
-                       pr_err("%s: failed to register %s %s clock (%ld)\n",
-                              __func__, np->name, name, PTR_ERR(clk));
+                       pr_err("%s: failed to register %pOFn %s clock (%ld)\n",
+                              __func__, np, name, PTR_ERR(clk));
                else
                        cpg->data.clks[i] = clk;
        }
index bab33610eb6caedfd5bd41e60874fea0cb00a906..dc8ffc7c727a73a226912e826382e466e8049b0e 100644 (file)
@@ -1,11 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
  * sh73a0 Core CPG Clocks
  *
  * Copyright (C) 2014  Ulrich Hecht
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2 of the License.
  */
 
 #include <linux/clk-provider.h>
@@ -206,8 +203,8 @@ static void __init sh73a0_cpg_clocks_init(struct device_node *np)
 
                clk = sh73a0_cpg_register_clock(np, cpg, name);
                if (IS_ERR(clk))
-                       pr_err("%s: failed to register %s %s clock (%ld)\n",
-                              __func__, np->name, name, PTR_ERR(clk));
+                       pr_err("%s: failed to register %pOFn %s clock (%ld)\n",
+                              __func__, np, name, PTR_ERR(clk));
                else
                        cpg->data.clks[i] = clk;
        }
diff --git a/drivers/clk/renesas/r7s9210-cpg-mssr.c b/drivers/clk/renesas/r7s9210-cpg-mssr.c
new file mode 100644 (file)
index 0000000..5135f13
--- /dev/null
@@ -0,0 +1,217 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * R7S9210 Clock Pulse Generator / Module Standby
+ *
+ * Based on r8a7795-cpg-mssr.c
+ *
+ * Copyright (C) 2018 Chris Brandt
+ * Copyright (C) 2018 Renesas Electronics Corp.
+ *
+ */
+
+#include <linux/clk.h>
+#include <linux/clk-provider.h>
+#include <dt-bindings/clock/r7s9210-cpg-mssr.h>
+#include "renesas-cpg-mssr.h"
+
+#define CPG_FRQCR      0x00
+
+static u8 cpg_mode;
+
+/* Internal Clock ratio table */
+static const struct {
+       unsigned int i;
+       unsigned int g;
+       unsigned int b;
+       unsigned int p1;
+       /* p0 is always 32 */;
+} ratio_tab[5] = {     /* I,  G,  B, P1 */
+                       {  2,  4,  8, 16},      /* FRQCR = 0x012 */
+                       {  4,  4,  8, 16},      /* FRQCR = 0x112 */
+                       {  8,  4,  8, 16},      /* FRQCR = 0x212 */
+                       { 16,  8, 16, 16},      /* FRQCR = 0x322 */
+                       { 16, 16, 32, 32},      /* FRQCR = 0x333 */
+                       };
+
+enum rz_clk_types {
+       CLK_TYPE_RZA_MAIN = CLK_TYPE_CUSTOM,
+       CLK_TYPE_RZA_PLL,
+};
+
+enum clk_ids {
+       /* Core Clock Outputs exported to DT */
+       LAST_DT_CORE_CLK = R7S9210_CLK_P0,
+
+       /* External Input Clocks */
+       CLK_EXTAL,
+
+       /* Internal Core Clocks */
+       CLK_MAIN,
+       CLK_PLL,
+
+       /* Module Clocks */
+       MOD_CLK_BASE
+};
+
+static struct cpg_core_clk r7s9210_early_core_clks[] = {
+       /* External Clock Inputs */
+       DEF_INPUT("extal",     CLK_EXTAL),
+
+       /* Internal Core Clocks */
+       DEF_BASE(".main",       CLK_MAIN, CLK_TYPE_RZA_MAIN, CLK_EXTAL),
+       DEF_BASE(".pll",       CLK_PLL, CLK_TYPE_RZA_PLL, CLK_MAIN),
+
+       /* Core Clock Outputs */
+       DEF_FIXED("p1c",    R7S9210_CLK_P1C,   CLK_PLL,         16, 1),
+};
+
+static const struct mssr_mod_clk r7s9210_early_mod_clks[] __initconst = {
+       DEF_MOD_STB("ostm2",     34,    R7S9210_CLK_P1C),
+       DEF_MOD_STB("ostm1",     35,    R7S9210_CLK_P1C),
+       DEF_MOD_STB("ostm0",     36,    R7S9210_CLK_P1C),
+};
+
+static struct cpg_core_clk r7s9210_core_clks[] = {
+       /* Core Clock Outputs */
+       DEF_FIXED("i",      R7S9210_CLK_I,     CLK_PLL,          2, 1),
+       DEF_FIXED("g",      R7S9210_CLK_G,     CLK_PLL,          4, 1),
+       DEF_FIXED("b",      R7S9210_CLK_B,     CLK_PLL,          8, 1),
+       DEF_FIXED("p1",     R7S9210_CLK_P1,    CLK_PLL,         16, 1),
+       DEF_FIXED("p0",     R7S9210_CLK_P0,    CLK_PLL,         32, 1),
+};
+
+static const struct mssr_mod_clk r7s9210_mod_clks[] __initconst = {
+       DEF_MOD_STB("scif4",     43,    R7S9210_CLK_P1C),
+       DEF_MOD_STB("scif3",     44,    R7S9210_CLK_P1C),
+       DEF_MOD_STB("scif2",     45,    R7S9210_CLK_P1C),
+       DEF_MOD_STB("scif1",     46,    R7S9210_CLK_P1C),
+       DEF_MOD_STB("scif0",     47,    R7S9210_CLK_P1C),
+
+       DEF_MOD_STB("ether1",    64,    R7S9210_CLK_B),
+       DEF_MOD_STB("ether0",    65,    R7S9210_CLK_B),
+
+       DEF_MOD_STB("i2c3",      84,    R7S9210_CLK_P1),
+       DEF_MOD_STB("i2c2",      85,    R7S9210_CLK_P1),
+       DEF_MOD_STB("i2c1",      86,    R7S9210_CLK_P1),
+       DEF_MOD_STB("i2c0",      87,    R7S9210_CLK_P1),
+
+       DEF_MOD_STB("spi2",      95,    R7S9210_CLK_P1),
+       DEF_MOD_STB("spi1",      96,    R7S9210_CLK_P1),
+       DEF_MOD_STB("spi0",      97,    R7S9210_CLK_P1),
+};
+
+/* The clock dividers in the table vary based on DT and register settings */
+static void __init r7s9210_update_clk_table(struct clk *extal_clk,
+                                           void __iomem *base)
+{
+       int i;
+       u16 frqcr;
+       u8 index;
+
+       /* If EXTAL is above 12MHz, then we know it is Mode 1 */
+       if (clk_get_rate(extal_clk) > 12000000)
+               cpg_mode = 1;
+
+       frqcr = clk_readl(base + CPG_FRQCR) & 0xFFF;
+       if (frqcr == 0x012)
+               index = 0;
+       else if (frqcr == 0x112)
+               index = 1;
+       else if (frqcr == 0x212)
+               index = 2;
+       else if (frqcr == 0x322)
+               index = 3;
+       else if (frqcr == 0x333)
+               index = 4;
+       else
+               BUG_ON(1);      /* Illegal FRQCR value */
+
+       for (i = 0; i < ARRAY_SIZE(r7s9210_core_clks); i++) {
+               switch (r7s9210_core_clks[i].id) {
+               case R7S9210_CLK_I:
+                       r7s9210_core_clks[i].div = ratio_tab[index].i;
+                       break;
+               case R7S9210_CLK_G:
+                       r7s9210_core_clks[i].div = ratio_tab[index].g;
+                       break;
+               case R7S9210_CLK_B:
+                       r7s9210_core_clks[i].div = ratio_tab[index].b;
+                       break;
+               case R7S9210_CLK_P1:
+               case R7S9210_CLK_P1C:
+                       r7s9210_core_clks[i].div = ratio_tab[index].p1;
+                       break;
+               case R7S9210_CLK_P0:
+                       r7s9210_core_clks[i].div = 32;
+                       break;
+               }
+       }
+}
+
+struct clk * __init rza2_cpg_clk_register(struct device *dev,
+       const struct cpg_core_clk *core, const struct cpg_mssr_info *info,
+       struct clk **clks, void __iomem *base,
+       struct raw_notifier_head *notifiers)
+{
+       struct clk *parent;
+       unsigned int mult = 1;
+       unsigned int div = 1;
+
+       parent = clks[core->parent];
+       if (IS_ERR(parent))
+               return ERR_CAST(parent);
+
+       switch (core->id) {
+       case CLK_MAIN:
+               break;
+
+       case CLK_PLL:
+               if (cpg_mode)
+                       mult = 44;      /* Divider 1 is 1/2 */
+               else
+                       mult = 88;      /* Divider 1 is 1 */
+               break;
+
+       default:
+               return ERR_PTR(-EINVAL);
+       }
+
+       if (core->id == CLK_MAIN)
+               r7s9210_update_clk_table(parent, base);
+
+       return clk_register_fixed_factor(NULL, core->name,
+                                        __clk_get_name(parent), 0, mult, div);
+}
+
+const struct cpg_mssr_info r7s9210_cpg_mssr_info __initconst = {
+       /* Early Clocks */
+       .early_core_clks = r7s9210_early_core_clks,
+       .num_early_core_clks = ARRAY_SIZE(r7s9210_early_core_clks),
+       .early_mod_clks = r7s9210_early_mod_clks,
+       .num_early_mod_clks = ARRAY_SIZE(r7s9210_early_mod_clks),
+
+       /* Core Clocks */
+       .core_clks = r7s9210_core_clks,
+       .num_core_clks = ARRAY_SIZE(r7s9210_core_clks),
+       .last_dt_core_clk = LAST_DT_CORE_CLK,
+       .num_total_core_clks = MOD_CLK_BASE,
+
+       /* Module Clocks */
+       .mod_clks = r7s9210_mod_clks,
+       .num_mod_clks = ARRAY_SIZE(r7s9210_mod_clks),
+       .num_hw_mod_clks = 11 * 32, /* includes STBCR0 which doesn't exist */
+
+       /* Callbacks */
+       .cpg_clk_register = rza2_cpg_clk_register,
+
+       /* RZ/A2 has Standby Control Registers */
+       .stbyctrl = true,
+};
+
+static void __init r7s9210_cpg_mssr_early_init(struct device_node *np)
+{
+       cpg_mssr_early_init(np, &r7s9210_cpg_mssr_info);
+}
+
+CLK_OF_DECLARE_DRIVER(cpg_mstp_clks, "renesas,r7s9210-cpg-mssr",
+                     r7s9210_cpg_mssr_early_init);
index 011c170ec3f95d65f7a83384b42431bcbfc86e55..c01d9af2525a181a3614a40b2444138126310fa5 100644 (file)
@@ -1,16 +1,14 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
  * r8a7743 Clock Pulse Generator / Module Standby and Software Reset
  *
  * Copyright (C) 2016 Cogent Embedded Inc.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 as published
- * by the Free Software Foundation; of the License.
  */
 
 #include <linux/device.h>
 #include <linux/init.h>
 #include <linux/kernel.h>
+#include <linux/of.h>
 #include <linux/soc/renesas/rcar-rst.h>
 
 #include <dt-bindings/clock/r8a7743-cpg-mssr.h>
@@ -37,7 +35,7 @@ enum clk_ids {
        MOD_CLK_BASE
 };
 
-static const struct cpg_core_clk r8a7743_core_clks[] __initconst = {
+static struct cpg_core_clk r8a7743_core_clks[] __initdata = {
        /* External Clock Inputs */
        DEF_INPUT("extal",      CLK_EXTAL),
        DEF_INPUT("usb_extal",  CLK_USB_EXTAL),
@@ -238,6 +236,8 @@ static const struct rcar_gen2_cpg_pll_config cpg_pll_configs[8] __initconst = {
 static int __init r8a7743_cpg_mssr_init(struct device *dev)
 {
        const struct rcar_gen2_cpg_pll_config *cpg_pll_config;
+       struct device_node *np = dev->of_node;
+       unsigned int i;
        u32 cpg_mode;
        int error;
 
@@ -247,6 +247,14 @@ static int __init r8a7743_cpg_mssr_init(struct device *dev)
 
        cpg_pll_config = &cpg_pll_configs[CPG_PLL_CONFIG_INDEX(cpg_mode)];
 
+       if (of_device_is_compatible(np, "renesas,r8a7744-cpg-mssr")) {
+               /* RZ/G1N uses a 1/5 divider for ZG */
+               for (i = 0; i < ARRAY_SIZE(r8a7743_core_clks); i++)
+                       if (r8a7743_core_clks[i].id == R8A7743_CLK_ZG) {
+                               r8a7743_core_clks[i].div = 5;
+                               break;
+                       }
+       }
        return rcar_gen2_cpg_init(cpg_pll_config, 2, cpg_mode);
 }
 
index 4b0a9243b7481176ca2c8701451f03421bd3de59..493874e5ebeeb6bb50aef7cb780289d406ea5c8f 100644 (file)
@@ -1,11 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
  * r8a7745 Clock Pulse Generator / Module Standby and Software Reset
  *
  * Copyright (C) 2016 Cogent Embedded Inc.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 as published
- * by the Free Software Foundation; of the License.
  */
 
 #include <linux/device.h>
diff --git a/drivers/clk/renesas/r8a774a1-cpg-mssr.c b/drivers/clk/renesas/r8a774a1-cpg-mssr.c
new file mode 100644 (file)
index 0000000..b0da342
--- /dev/null
@@ -0,0 +1,323 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * r8a774a1 Clock Pulse Generator / Module Standby and Software Reset
+ *
+ * Copyright (C) 2018 Renesas Electronics Corp.
+ *
+ * Based on r8a7796-cpg-mssr.c
+ *
+ * Copyright (C) 2016 Glider bvba
+ */
+
+#include <linux/device.h>
+#include <linux/init.h>
+#include <linux/kernel.h>
+#include <linux/soc/renesas/rcar-rst.h>
+
+#include <dt-bindings/clock/r8a774a1-cpg-mssr.h>
+
+#include "renesas-cpg-mssr.h"
+#include "rcar-gen3-cpg.h"
+
+enum clk_ids {
+       /* Core Clock Outputs exported to DT */
+       LAST_DT_CORE_CLK = R8A774A1_CLK_OSC,
+
+       /* External Input Clocks */
+       CLK_EXTAL,
+       CLK_EXTALR,
+
+       /* Internal Core Clocks */
+       CLK_MAIN,
+       CLK_PLL0,
+       CLK_PLL1,
+       CLK_PLL2,
+       CLK_PLL3,
+       CLK_PLL4,
+       CLK_PLL1_DIV2,
+       CLK_PLL1_DIV4,
+       CLK_S0,
+       CLK_S1,
+       CLK_S2,
+       CLK_S3,
+       CLK_SDSRC,
+       CLK_RINT,
+
+       /* Module Clocks */
+       MOD_CLK_BASE
+};
+
+static const struct cpg_core_clk r8a774a1_core_clks[] __initconst = {
+       /* External Clock Inputs */
+       DEF_INPUT("extal",      CLK_EXTAL),
+       DEF_INPUT("extalr",     CLK_EXTALR),
+
+       /* Internal Core Clocks */
+       DEF_BASE(".main",       CLK_MAIN, CLK_TYPE_GEN3_MAIN, CLK_EXTAL),
+       DEF_BASE(".pll0",       CLK_PLL0, CLK_TYPE_GEN3_PLL0, CLK_MAIN),
+       DEF_BASE(".pll1",       CLK_PLL1, CLK_TYPE_GEN3_PLL1, CLK_MAIN),
+       DEF_BASE(".pll2",       CLK_PLL2, CLK_TYPE_GEN3_PLL2, CLK_MAIN),
+       DEF_BASE(".pll3",       CLK_PLL3, CLK_TYPE_GEN3_PLL3, CLK_MAIN),
+       DEF_BASE(".pll4",       CLK_PLL4, CLK_TYPE_GEN3_PLL4, CLK_MAIN),
+
+       DEF_FIXED(".pll1_div2", CLK_PLL1_DIV2,     CLK_PLL1,       2, 1),
+       DEF_FIXED(".pll1_div4", CLK_PLL1_DIV4,     CLK_PLL1_DIV2,  2, 1),
+       DEF_FIXED(".s0",        CLK_S0,            CLK_PLL1_DIV2,  2, 1),
+       DEF_FIXED(".s1",        CLK_S1,            CLK_PLL1_DIV2,  3, 1),
+       DEF_FIXED(".s2",        CLK_S2,            CLK_PLL1_DIV2,  4, 1),
+       DEF_FIXED(".s3",        CLK_S3,            CLK_PLL1_DIV2,  6, 1),
+       DEF_FIXED(".sdsrc",     CLK_SDSRC,         CLK_PLL1_DIV2,  2, 1),
+
+       DEF_GEN3_OSC(".r",      CLK_RINT,          CLK_EXTAL,      32),
+
+       /* Core Clock Outputs */
+       DEF_BASE("z",           R8A774A1_CLK_Z,     CLK_TYPE_GEN3_Z, CLK_PLL0),
+       DEF_BASE("z2",          R8A774A1_CLK_Z2,    CLK_TYPE_GEN3_Z2, CLK_PLL2),
+       DEF_FIXED("ztr",        R8A774A1_CLK_ZTR,   CLK_PLL1_DIV2,  6, 1),
+       DEF_FIXED("ztrd2",      R8A774A1_CLK_ZTRD2, CLK_PLL1_DIV2, 12, 1),
+       DEF_FIXED("zt",         R8A774A1_CLK_ZT,    CLK_PLL1_DIV2,  4, 1),
+       DEF_FIXED("zx",         R8A774A1_CLK_ZX,    CLK_PLL1_DIV2,  2, 1),
+       DEF_FIXED("s0d1",       R8A774A1_CLK_S0D1,  CLK_S0,         1, 1),
+       DEF_FIXED("s0d2",       R8A774A1_CLK_S0D2,  CLK_S0,         2, 1),
+       DEF_FIXED("s0d3",       R8A774A1_CLK_S0D3,  CLK_S0,         3, 1),
+       DEF_FIXED("s0d4",       R8A774A1_CLK_S0D4,  CLK_S0,         4, 1),
+       DEF_FIXED("s0d6",       R8A774A1_CLK_S0D6,  CLK_S0,         6, 1),
+       DEF_FIXED("s0d8",       R8A774A1_CLK_S0D8,  CLK_S0,         8, 1),
+       DEF_FIXED("s0d12",      R8A774A1_CLK_S0D12, CLK_S0,        12, 1),
+       DEF_FIXED("s1d2",       R8A774A1_CLK_S1D2,  CLK_S1,         2, 1),
+       DEF_FIXED("s1d4",       R8A774A1_CLK_S1D4,  CLK_S1,         4, 1),
+       DEF_FIXED("s2d1",       R8A774A1_CLK_S2D1,  CLK_S2,         1, 1),
+       DEF_FIXED("s2d2",       R8A774A1_CLK_S2D2,  CLK_S2,         2, 1),
+       DEF_FIXED("s2d4",       R8A774A1_CLK_S2D4,  CLK_S2,         4, 1),
+       DEF_FIXED("s3d1",       R8A774A1_CLK_S3D1,  CLK_S3,         1, 1),
+       DEF_FIXED("s3d2",       R8A774A1_CLK_S3D2,  CLK_S3,         2, 1),
+       DEF_FIXED("s3d4",       R8A774A1_CLK_S3D4,  CLK_S3,         4, 1),
+
+       DEF_GEN3_SD("sd0",      R8A774A1_CLK_SD0,   CLK_SDSRC,     0x074),
+       DEF_GEN3_SD("sd1",      R8A774A1_CLK_SD1,   CLK_SDSRC,     0x078),
+       DEF_GEN3_SD("sd2",      R8A774A1_CLK_SD2,   CLK_SDSRC,     0x268),
+       DEF_GEN3_SD("sd3",      R8A774A1_CLK_SD3,   CLK_SDSRC,     0x26c),
+
+       DEF_FIXED("cl",         R8A774A1_CLK_CL,    CLK_PLL1_DIV2, 48, 1),
+       DEF_FIXED("cp",         R8A774A1_CLK_CP,    CLK_EXTAL,      2, 1),
+
+       DEF_DIV6P1("csi0",      R8A774A1_CLK_CSI0,  CLK_PLL1_DIV4, 0x00c),
+       DEF_DIV6P1("mso",       R8A774A1_CLK_MSO,   CLK_PLL1_DIV4, 0x014),
+       DEF_DIV6P1("hdmi",      R8A774A1_CLK_HDMI,  CLK_PLL1_DIV4, 0x250),
+
+       DEF_GEN3_OSC("osc",     R8A774A1_CLK_OSC,   CLK_EXTAL,     8),
+
+       DEF_BASE("r",           R8A774A1_CLK_R,     CLK_TYPE_GEN3_R, CLK_RINT),
+};
+
+static const struct mssr_mod_clk r8a774a1_mod_clks[] __initconst = {
+       DEF_MOD("fdp1-0",                119,   R8A774A1_CLK_S0D1),
+       DEF_MOD("scif5",                 202,   R8A774A1_CLK_S3D4),
+       DEF_MOD("scif4",                 203,   R8A774A1_CLK_S3D4),
+       DEF_MOD("scif3",                 204,   R8A774A1_CLK_S3D4),
+       DEF_MOD("scif1",                 206,   R8A774A1_CLK_S3D4),
+       DEF_MOD("scif0",                 207,   R8A774A1_CLK_S3D4),
+       DEF_MOD("msiof3",                208,   R8A774A1_CLK_MSO),
+       DEF_MOD("msiof2",                209,   R8A774A1_CLK_MSO),
+       DEF_MOD("msiof1",                210,   R8A774A1_CLK_MSO),
+       DEF_MOD("msiof0",                211,   R8A774A1_CLK_MSO),
+       DEF_MOD("sys-dmac2",             217,   R8A774A1_CLK_S0D3),
+       DEF_MOD("sys-dmac1",             218,   R8A774A1_CLK_S0D3),
+       DEF_MOD("sys-dmac0",             219,   R8A774A1_CLK_S0D3),
+       DEF_MOD("cmt3",                  300,   R8A774A1_CLK_R),
+       DEF_MOD("cmt2",                  301,   R8A774A1_CLK_R),
+       DEF_MOD("cmt1",                  302,   R8A774A1_CLK_R),
+       DEF_MOD("cmt0",                  303,   R8A774A1_CLK_R),
+       DEF_MOD("scif2",                 310,   R8A774A1_CLK_S3D4),
+       DEF_MOD("sdif3",                 311,   R8A774A1_CLK_SD3),
+       DEF_MOD("sdif2",                 312,   R8A774A1_CLK_SD2),
+       DEF_MOD("sdif1",                 313,   R8A774A1_CLK_SD1),
+       DEF_MOD("sdif0",                 314,   R8A774A1_CLK_SD0),
+       DEF_MOD("pcie1",                 318,   R8A774A1_CLK_S3D1),
+       DEF_MOD("pcie0",                 319,   R8A774A1_CLK_S3D1),
+       DEF_MOD("usb3-if0",              328,   R8A774A1_CLK_S3D1),
+       DEF_MOD("usb-dmac0",             330,   R8A774A1_CLK_S3D1),
+       DEF_MOD("usb-dmac1",             331,   R8A774A1_CLK_S3D1),
+       DEF_MOD("rwdt",                  402,   R8A774A1_CLK_R),
+       DEF_MOD("intc-ex",               407,   R8A774A1_CLK_CP),
+       DEF_MOD("intc-ap",               408,   R8A774A1_CLK_S0D3),
+       DEF_MOD("audmac1",               501,   R8A774A1_CLK_S0D3),
+       DEF_MOD("audmac0",               502,   R8A774A1_CLK_S0D3),
+       DEF_MOD("hscif4",                516,   R8A774A1_CLK_S3D1),
+       DEF_MOD("hscif3",                517,   R8A774A1_CLK_S3D1),
+       DEF_MOD("hscif2",                518,   R8A774A1_CLK_S3D1),
+       DEF_MOD("hscif1",                519,   R8A774A1_CLK_S3D1),
+       DEF_MOD("hscif0",                520,   R8A774A1_CLK_S3D1),
+       DEF_MOD("thermal",               522,   R8A774A1_CLK_CP),
+       DEF_MOD("pwm",                   523,   R8A774A1_CLK_S0D12),
+       DEF_MOD("fcpvd2",                601,   R8A774A1_CLK_S0D2),
+       DEF_MOD("fcpvd1",                602,   R8A774A1_CLK_S0D2),
+       DEF_MOD("fcpvd0",                603,   R8A774A1_CLK_S0D2),
+       DEF_MOD("fcpvb0",                607,   R8A774A1_CLK_S0D1),
+       DEF_MOD("fcpvi0",                611,   R8A774A1_CLK_S0D1),
+       DEF_MOD("fcpf0",                 615,   R8A774A1_CLK_S0D1),
+       DEF_MOD("fcpci0",                617,   R8A774A1_CLK_S0D2),
+       DEF_MOD("fcpcs",                 619,   R8A774A1_CLK_S0D2),
+       DEF_MOD("vspd2",                 621,   R8A774A1_CLK_S0D2),
+       DEF_MOD("vspd1",                 622,   R8A774A1_CLK_S0D2),
+       DEF_MOD("vspd0",                 623,   R8A774A1_CLK_S0D2),
+       DEF_MOD("vspb",                  626,   R8A774A1_CLK_S0D1),
+       DEF_MOD("vspi0",                 631,   R8A774A1_CLK_S0D1),
+       DEF_MOD("ehci1",                 702,   R8A774A1_CLK_S3D4),
+       DEF_MOD("ehci0",                 703,   R8A774A1_CLK_S3D4),
+       DEF_MOD("hsusb",                 704,   R8A774A1_CLK_S3D4),
+       DEF_MOD("csi20",                 714,   R8A774A1_CLK_CSI0),
+       DEF_MOD("csi40",                 716,   R8A774A1_CLK_CSI0),
+       DEF_MOD("du2",                   722,   R8A774A1_CLK_S2D1),
+       DEF_MOD("du1",                   723,   R8A774A1_CLK_S2D1),
+       DEF_MOD("du0",                   724,   R8A774A1_CLK_S2D1),
+       DEF_MOD("lvds",                  727,   R8A774A1_CLK_S2D1),
+       DEF_MOD("hdmi0",                 729,   R8A774A1_CLK_HDMI),
+       DEF_MOD("vin7",                  804,   R8A774A1_CLK_S0D2),
+       DEF_MOD("vin6",                  805,   R8A774A1_CLK_S0D2),
+       DEF_MOD("vin5",                  806,   R8A774A1_CLK_S0D2),
+       DEF_MOD("vin4",                  807,   R8A774A1_CLK_S0D2),
+       DEF_MOD("vin3",                  808,   R8A774A1_CLK_S0D2),
+       DEF_MOD("vin2",                  809,   R8A774A1_CLK_S0D2),
+       DEF_MOD("vin1",                  810,   R8A774A1_CLK_S0D2),
+       DEF_MOD("vin0",                  811,   R8A774A1_CLK_S0D2),
+       DEF_MOD("etheravb",              812,   R8A774A1_CLK_S0D6),
+       DEF_MOD("gpio7",                 905,   R8A774A1_CLK_S3D4),
+       DEF_MOD("gpio6",                 906,   R8A774A1_CLK_S3D4),
+       DEF_MOD("gpio5",                 907,   R8A774A1_CLK_S3D4),
+       DEF_MOD("gpio4",                 908,   R8A774A1_CLK_S3D4),
+       DEF_MOD("gpio3",                 909,   R8A774A1_CLK_S3D4),
+       DEF_MOD("gpio2",                 910,   R8A774A1_CLK_S3D4),
+       DEF_MOD("gpio1",                 911,   R8A774A1_CLK_S3D4),
+       DEF_MOD("gpio0",                 912,   R8A774A1_CLK_S3D4),
+       DEF_MOD("can-if1",               915,   R8A774A1_CLK_S3D4),
+       DEF_MOD("can-if0",               916,   R8A774A1_CLK_S3D4),
+       DEF_MOD("i2c6",                  918,   R8A774A1_CLK_S0D6),
+       DEF_MOD("i2c5",                  919,   R8A774A1_CLK_S0D6),
+       DEF_MOD("i2c-dvfs",              926,   R8A774A1_CLK_CP),
+       DEF_MOD("i2c4",                  927,   R8A774A1_CLK_S0D6),
+       DEF_MOD("i2c3",                  928,   R8A774A1_CLK_S0D6),
+       DEF_MOD("i2c2",                  929,   R8A774A1_CLK_S3D2),
+       DEF_MOD("i2c1",                  930,   R8A774A1_CLK_S3D2),
+       DEF_MOD("i2c0",                  931,   R8A774A1_CLK_S3D2),
+       DEF_MOD("ssi-all",              1005,   R8A774A1_CLK_S3D4),
+       DEF_MOD("ssi9",                 1006,   MOD_CLK_ID(1005)),
+       DEF_MOD("ssi8",                 1007,   MOD_CLK_ID(1005)),
+       DEF_MOD("ssi7",                 1008,   MOD_CLK_ID(1005)),
+       DEF_MOD("ssi6",                 1009,   MOD_CLK_ID(1005)),
+       DEF_MOD("ssi5",                 1010,   MOD_CLK_ID(1005)),
+       DEF_MOD("ssi4",                 1011,   MOD_CLK_ID(1005)),
+       DEF_MOD("ssi3",                 1012,   MOD_CLK_ID(1005)),
+       DEF_MOD("ssi2",                 1013,   MOD_CLK_ID(1005)),
+       DEF_MOD("ssi1",                 1014,   MOD_CLK_ID(1005)),
+       DEF_MOD("ssi0",                 1015,   MOD_CLK_ID(1005)),
+       DEF_MOD("scu-all",              1017,   R8A774A1_CLK_S3D4),
+       DEF_MOD("scu-dvc1",             1018,   MOD_CLK_ID(1017)),
+       DEF_MOD("scu-dvc0",             1019,   MOD_CLK_ID(1017)),
+       DEF_MOD("scu-ctu1-mix1",        1020,   MOD_CLK_ID(1017)),
+       DEF_MOD("scu-ctu0-mix0",        1021,   MOD_CLK_ID(1017)),
+       DEF_MOD("scu-src9",             1022,   MOD_CLK_ID(1017)),
+       DEF_MOD("scu-src8",             1023,   MOD_CLK_ID(1017)),
+       DEF_MOD("scu-src7",             1024,   MOD_CLK_ID(1017)),
+       DEF_MOD("scu-src6",             1025,   MOD_CLK_ID(1017)),
+       DEF_MOD("scu-src5",             1026,   MOD_CLK_ID(1017)),
+       DEF_MOD("scu-src4",             1027,   MOD_CLK_ID(1017)),
+       DEF_MOD("scu-src3",             1028,   MOD_CLK_ID(1017)),
+       DEF_MOD("scu-src2",             1029,   MOD_CLK_ID(1017)),
+       DEF_MOD("scu-src1",             1030,   MOD_CLK_ID(1017)),
+       DEF_MOD("scu-src0",             1031,   MOD_CLK_ID(1017)),
+};
+
+static const unsigned int r8a774a1_crit_mod_clks[] __initconst = {
+       MOD_CLK_ID(408),        /* INTC-AP (GIC) */
+};
+
+/*
+ * CPG Clock Data
+ */
+
+/*
+ *   MD                EXTAL           PLL0    PLL1    PLL2    PLL3    PLL4    OSC
+ * 14 13 19 17 (MHz)
+ *-------------------------------------------------------------------------
+ * 0  0  0  0  16.66 x 1       x180    x192    x144    x192    x144    /16
+ * 0  0  0  1  16.66 x 1       x180    x192    x144    x128    x144    /16
+ * 0  0  1  0  Prohibited setting
+ * 0  0  1  1  16.66 x 1       x180    x192    x144    x192    x144    /16
+ * 0  1  0  0  20    x 1       x150    x160    x120    x160    x120    /19
+ * 0  1  0  1  20    x 1       x150    x160    x120    x106    x120    /19
+ * 0  1  1  0  Prohibited setting
+ * 0  1  1  1  20    x 1       x150    x160    x120    x160    x120    /19
+ * 1  0  0  0  25    x 1       x120    x128    x96     x128    x96     /24
+ * 1  0  0  1  25    x 1       x120    x128    x96     x84     x96     /24
+ * 1  0  1  0  Prohibited setting
+ * 1  0  1  1  25    x 1       x120    x128    x96     x128    x96     /24
+ * 1  1  0  0  33.33 / 2       x180    x192    x144    x192    x144    /32
+ * 1  1  0  1  33.33 / 2       x180    x192    x144    x128    x144    /32
+ * 1  1  1  0  Prohibited setting
+ * 1  1  1  1  33.33 / 2       x180    x192    x144    x192    x144    /32
+ */
+#define CPG_PLL_CONFIG_INDEX(md)       ((((md) & BIT(14)) >> 11) | \
+                                        (((md) & BIT(13)) >> 11) | \
+                                        (((md) & BIT(19)) >> 18) | \
+                                        (((md) & BIT(17)) >> 17))
+
+static const struct rcar_gen3_cpg_pll_config cpg_pll_configs[16] __initconst = {
+       /* EXTAL div    PLL1 mult/div   PLL3 mult/div   OSC prediv */
+       { 1,            192,    1,      192,    1,      16,     },
+       { 1,            192,    1,      128,    1,      16,     },
+       { 0, /* Prohibited setting */                           },
+       { 1,            192,    1,      192,    1,      16,     },
+       { 1,            160,    1,      160,    1,      19,     },
+       { 1,            160,    1,      106,    1,      19,     },
+       { 0, /* Prohibited setting */                           },
+       { 1,            160,    1,      160,    1,      19,     },
+       { 1,            128,    1,      128,    1,      24,     },
+       { 1,            128,    1,      84,     1,      24,     },
+       { 0, /* Prohibited setting */                           },
+       { 1,            128,    1,      128,    1,      24,     },
+       { 2,            192,    1,      192,    1,      32,     },
+       { 2,            192,    1,      128,    1,      32,     },
+       { 0, /* Prohibited setting */                           },
+       { 2,            192,    1,      192,    1,      32,     },
+};
+
+static int __init r8a774a1_cpg_mssr_init(struct device *dev)
+{
+       const struct rcar_gen3_cpg_pll_config *cpg_pll_config;
+       u32 cpg_mode;
+       int error;
+
+       error = rcar_rst_read_mode_pins(&cpg_mode);
+       if (error)
+               return error;
+
+       cpg_pll_config = &cpg_pll_configs[CPG_PLL_CONFIG_INDEX(cpg_mode)];
+       if (!cpg_pll_config->extal_div) {
+               dev_err(dev, "Prohibited setting (cpg_mode=0x%x)\n", cpg_mode);
+               return -EINVAL;
+       }
+
+       return rcar_gen3_cpg_init(cpg_pll_config, CLK_EXTALR, cpg_mode);
+}
+
+const struct cpg_mssr_info r8a774a1_cpg_mssr_info __initconst = {
+       /* Core Clocks */
+       .core_clks = r8a774a1_core_clks,
+       .num_core_clks = ARRAY_SIZE(r8a774a1_core_clks),
+       .last_dt_core_clk = LAST_DT_CORE_CLK,
+       .num_total_core_clks = MOD_CLK_BASE,
+
+       /* Module Clocks */
+       .mod_clks = r8a774a1_mod_clks,
+       .num_mod_clks = ARRAY_SIZE(r8a774a1_mod_clks),
+       .num_hw_mod_clks = 12 * 32,
+
+       /* Critical Module Clocks */
+       .crit_mod_clks = r8a774a1_crit_mod_clks,
+       .num_crit_mod_clks = ARRAY_SIZE(r8a774a1_crit_mod_clks),
+
+       /* Callbacks */
+       .init = r8a774a1_cpg_mssr_init,
+       .cpg_clk_register = rcar_gen3_cpg_clk_register,
+};
diff --git a/drivers/clk/renesas/r8a774c0-cpg-mssr.c b/drivers/clk/renesas/r8a774c0-cpg-mssr.c
new file mode 100644 (file)
index 0000000..10b9689
--- /dev/null
@@ -0,0 +1,286 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * r8a774c0 Clock Pulse Generator / Module Standby and Software Reset
+ *
+ * Copyright (C) 2018 Renesas Electronics Corp.
+ *
+ * Based on r8a77990-cpg-mssr.c
+ *
+ * Copyright (C) 2015 Glider bvba
+ * Copyright (C) 2015 Renesas Electronics Corp.
+ */
+
+#include <linux/device.h>
+#include <linux/init.h>
+#include <linux/kernel.h>
+#include <linux/soc/renesas/rcar-rst.h>
+
+#include <dt-bindings/clock/r8a774c0-cpg-mssr.h>
+
+#include "renesas-cpg-mssr.h"
+#include "rcar-gen3-cpg.h"
+
+enum clk_ids {
+       /* Core Clock Outputs exported to DT */
+       LAST_DT_CORE_CLK = R8A774C0_CLK_CPEX,
+
+       /* External Input Clocks */
+       CLK_EXTAL,
+
+       /* Internal Core Clocks */
+       CLK_MAIN,
+       CLK_PLL0,
+       CLK_PLL1,
+       CLK_PLL3,
+       CLK_PLL0D4,
+       CLK_PLL0D8,
+       CLK_PLL0D20,
+       CLK_PLL0D24,
+       CLK_PLL1D2,
+       CLK_PE,
+       CLK_S0,
+       CLK_S1,
+       CLK_S2,
+       CLK_S3,
+       CLK_SDSRC,
+       CLK_RINT,
+       CLK_OCO,
+
+       /* Module Clocks */
+       MOD_CLK_BASE
+};
+
+static const struct cpg_core_clk r8a774c0_core_clks[] __initconst = {
+       /* External Clock Inputs */
+       DEF_INPUT("extal",     CLK_EXTAL),
+
+       /* Internal Core Clocks */
+       DEF_BASE(".main",      CLK_MAIN, CLK_TYPE_GEN3_MAIN,       CLK_EXTAL),
+       DEF_BASE(".pll1",      CLK_PLL1, CLK_TYPE_GEN3_PLL1,       CLK_MAIN),
+       DEF_BASE(".pll3",      CLK_PLL3, CLK_TYPE_GEN3_PLL3,       CLK_MAIN),
+
+       DEF_FIXED(".pll0",     CLK_PLL0,           CLK_MAIN,       1, 100),
+       DEF_FIXED(".pll0d4",   CLK_PLL0D4,         CLK_PLL0,       4, 1),
+       DEF_FIXED(".pll0d8",   CLK_PLL0D8,         CLK_PLL0,       8, 1),
+       DEF_FIXED(".pll0d20",  CLK_PLL0D20,        CLK_PLL0,      20, 1),
+       DEF_FIXED(".pll0d24",  CLK_PLL0D24,        CLK_PLL0,      24, 1),
+       DEF_FIXED(".pll1d2",   CLK_PLL1D2,         CLK_PLL1,       2, 1),
+       DEF_FIXED(".pe",       CLK_PE,             CLK_PLL0D20,    1, 1),
+       DEF_FIXED(".s0",       CLK_S0,             CLK_PLL1,       2, 1),
+       DEF_FIXED(".s1",       CLK_S1,             CLK_PLL1,       3, 1),
+       DEF_FIXED(".s2",       CLK_S2,             CLK_PLL1,       4, 1),
+       DEF_FIXED(".s3",       CLK_S3,             CLK_PLL1,       6, 1),
+       DEF_FIXED(".sdsrc",    CLK_SDSRC,          CLK_PLL1,       2, 1),
+
+       DEF_DIV6_RO(".r",      CLK_RINT,           CLK_EXTAL, CPG_RCKCR, 32),
+
+       DEF_RATE(".oco",       CLK_OCO,            8 * 1000 * 1000),
+
+       /* Core Clock Outputs */
+       DEF_FIXED("za2",       R8A774C0_CLK_ZA2,   CLK_PLL0D24,    1, 1),
+       DEF_FIXED("za8",       R8A774C0_CLK_ZA8,   CLK_PLL0D8,     1, 1),
+       DEF_FIXED("ztr",       R8A774C0_CLK_ZTR,   CLK_PLL1,       6, 1),
+       DEF_FIXED("zt",        R8A774C0_CLK_ZT,    CLK_PLL1,       4, 1),
+       DEF_FIXED("zx",        R8A774C0_CLK_ZX,    CLK_PLL1,       3, 1),
+       DEF_FIXED("s0d1",      R8A774C0_CLK_S0D1,  CLK_S0,         1, 1),
+       DEF_FIXED("s0d3",      R8A774C0_CLK_S0D3,  CLK_S0,         3, 1),
+       DEF_FIXED("s0d6",      R8A774C0_CLK_S0D6,  CLK_S0,         6, 1),
+       DEF_FIXED("s0d12",     R8A774C0_CLK_S0D12, CLK_S0,        12, 1),
+       DEF_FIXED("s0d24",     R8A774C0_CLK_S0D24, CLK_S0,        24, 1),
+       DEF_FIXED("s1d1",      R8A774C0_CLK_S1D1,  CLK_S1,         1, 1),
+       DEF_FIXED("s1d2",      R8A774C0_CLK_S1D2,  CLK_S1,         2, 1),
+       DEF_FIXED("s1d4",      R8A774C0_CLK_S1D4,  CLK_S1,         4, 1),
+       DEF_FIXED("s2d1",      R8A774C0_CLK_S2D1,  CLK_S2,         1, 1),
+       DEF_FIXED("s2d2",      R8A774C0_CLK_S2D2,  CLK_S2,         2, 1),
+       DEF_FIXED("s2d4",      R8A774C0_CLK_S2D4,  CLK_S2,         4, 1),
+       DEF_FIXED("s3d1",      R8A774C0_CLK_S3D1,  CLK_S3,         1, 1),
+       DEF_FIXED("s3d2",      R8A774C0_CLK_S3D2,  CLK_S3,         2, 1),
+       DEF_FIXED("s3d4",      R8A774C0_CLK_S3D4,  CLK_S3,         4, 1),
+
+       DEF_GEN3_SD("sd0",     R8A774C0_CLK_SD0,   CLK_SDSRC,     0x0074),
+       DEF_GEN3_SD("sd1",     R8A774C0_CLK_SD1,   CLK_SDSRC,     0x0078),
+       DEF_GEN3_SD("sd3",     R8A774C0_CLK_SD3,   CLK_SDSRC,     0x026c),
+
+       DEF_FIXED("cl",        R8A774C0_CLK_CL,    CLK_PLL1,      48, 1),
+       DEF_FIXED("cp",        R8A774C0_CLK_CP,    CLK_EXTAL,      2, 1),
+       DEF_FIXED("cpex",      R8A774C0_CLK_CPEX,  CLK_EXTAL,      4, 1),
+
+       DEF_DIV6_RO("osc",     R8A774C0_CLK_OSC,   CLK_EXTAL, CPG_RCKCR,  8),
+
+       DEF_GEN3_PE("s0d6c",   R8A774C0_CLK_S0D6C, CLK_S0, 6, CLK_PE, 2),
+       DEF_GEN3_PE("s3d1c",   R8A774C0_CLK_S3D1C, CLK_S3, 1, CLK_PE, 1),
+       DEF_GEN3_PE("s3d2c",   R8A774C0_CLK_S3D2C, CLK_S3, 2, CLK_PE, 2),
+       DEF_GEN3_PE("s3d4c",   R8A774C0_CLK_S3D4C, CLK_S3, 4, CLK_PE, 4),
+
+       DEF_DIV6P1("csi0",     R8A774C0_CLK_CSI0,  CLK_PLL1D2, 0x00c),
+       DEF_DIV6P1("mso",      R8A774C0_CLK_MSO,   CLK_PLL1D2, 0x014),
+
+       DEF_GEN3_RCKSEL("r",   R8A774C0_CLK_R, CLK_RINT, 1, CLK_OCO, 61 * 4),
+};
+
+static const struct mssr_mod_clk r8a774c0_mod_clks[] __initconst = {
+       DEF_MOD("scif5",                 202,   R8A774C0_CLK_S3D4C),
+       DEF_MOD("scif4",                 203,   R8A774C0_CLK_S3D4C),
+       DEF_MOD("scif3",                 204,   R8A774C0_CLK_S3D4C),
+       DEF_MOD("scif1",                 206,   R8A774C0_CLK_S3D4C),
+       DEF_MOD("scif0",                 207,   R8A774C0_CLK_S3D4C),
+       DEF_MOD("msiof3",                208,   R8A774C0_CLK_MSO),
+       DEF_MOD("msiof2",                209,   R8A774C0_CLK_MSO),
+       DEF_MOD("msiof1",                210,   R8A774C0_CLK_MSO),
+       DEF_MOD("msiof0",                211,   R8A774C0_CLK_MSO),
+       DEF_MOD("sys-dmac2",             217,   R8A774C0_CLK_S3D1),
+       DEF_MOD("sys-dmac1",             218,   R8A774C0_CLK_S3D1),
+       DEF_MOD("sys-dmac0",             219,   R8A774C0_CLK_S3D1),
+
+       DEF_MOD("cmt3",                  300,   R8A774C0_CLK_R),
+       DEF_MOD("cmt2",                  301,   R8A774C0_CLK_R),
+       DEF_MOD("cmt1",                  302,   R8A774C0_CLK_R),
+       DEF_MOD("cmt0",                  303,   R8A774C0_CLK_R),
+       DEF_MOD("scif2",                 310,   R8A774C0_CLK_S3D4C),
+       DEF_MOD("sdif3",                 311,   R8A774C0_CLK_SD3),
+       DEF_MOD("sdif1",                 313,   R8A774C0_CLK_SD1),
+       DEF_MOD("sdif0",                 314,   R8A774C0_CLK_SD0),
+       DEF_MOD("pcie0",                 319,   R8A774C0_CLK_S3D1),
+       DEF_MOD("usb3-if0",              328,   R8A774C0_CLK_S3D1),
+       DEF_MOD("usb-dmac0",             330,   R8A774C0_CLK_S3D1),
+       DEF_MOD("usb-dmac1",             331,   R8A774C0_CLK_S3D1),
+
+       DEF_MOD("rwdt",                  402,   R8A774C0_CLK_R),
+       DEF_MOD("intc-ex",               407,   R8A774C0_CLK_CP),
+       DEF_MOD("intc-ap",               408,   R8A774C0_CLK_S0D3),
+
+       DEF_MOD("audmac0",               502,   R8A774C0_CLK_S3D4),
+       DEF_MOD("hscif4",                516,   R8A774C0_CLK_S3D1C),
+       DEF_MOD("hscif3",                517,   R8A774C0_CLK_S3D1C),
+       DEF_MOD("hscif2",                518,   R8A774C0_CLK_S3D1C),
+       DEF_MOD("hscif1",                519,   R8A774C0_CLK_S3D1C),
+       DEF_MOD("hscif0",                520,   R8A774C0_CLK_S3D1C),
+       DEF_MOD("thermal",               522,   R8A774C0_CLK_CP),
+       DEF_MOD("pwm",                   523,   R8A774C0_CLK_S3D4C),
+
+       DEF_MOD("fcpvd1",                602,   R8A774C0_CLK_S1D2),
+       DEF_MOD("fcpvd0",                603,   R8A774C0_CLK_S1D2),
+       DEF_MOD("fcpvb0",                607,   R8A774C0_CLK_S0D1),
+       DEF_MOD("fcpvi0",                611,   R8A774C0_CLK_S0D1),
+       DEF_MOD("fcpf0",                 615,   R8A774C0_CLK_S0D1),
+       DEF_MOD("fcpcs",                 619,   R8A774C0_CLK_S0D1),
+       DEF_MOD("vspd1",                 622,   R8A774C0_CLK_S1D2),
+       DEF_MOD("vspd0",                 623,   R8A774C0_CLK_S1D2),
+       DEF_MOD("vspb",                  626,   R8A774C0_CLK_S0D1),
+       DEF_MOD("vspi0",                 631,   R8A774C0_CLK_S0D1),
+
+       DEF_MOD("ehci0",                 703,   R8A774C0_CLK_S3D4),
+       DEF_MOD("hsusb",                 704,   R8A774C0_CLK_S3D4),
+       DEF_MOD("csi40",                 716,   R8A774C0_CLK_CSI0),
+       DEF_MOD("du1",                   723,   R8A774C0_CLK_S2D1),
+       DEF_MOD("du0",                   724,   R8A774C0_CLK_S2D1),
+       DEF_MOD("lvds",                  727,   R8A774C0_CLK_S2D1),
+
+       DEF_MOD("vin5",                  806,   R8A774C0_CLK_S1D2),
+       DEF_MOD("vin4",                  807,   R8A774C0_CLK_S1D2),
+       DEF_MOD("etheravb",              812,   R8A774C0_CLK_S3D2),
+
+       DEF_MOD("gpio6",                 906,   R8A774C0_CLK_S3D4),
+       DEF_MOD("gpio5",                 907,   R8A774C0_CLK_S3D4),
+       DEF_MOD("gpio4",                 908,   R8A774C0_CLK_S3D4),
+       DEF_MOD("gpio3",                 909,   R8A774C0_CLK_S3D4),
+       DEF_MOD("gpio2",                 910,   R8A774C0_CLK_S3D4),
+       DEF_MOD("gpio1",                 911,   R8A774C0_CLK_S3D4),
+       DEF_MOD("gpio0",                 912,   R8A774C0_CLK_S3D4),
+       DEF_MOD("can-if1",               915,   R8A774C0_CLK_S3D4),
+       DEF_MOD("can-if0",               916,   R8A774C0_CLK_S3D4),
+       DEF_MOD("i2c6",                  918,   R8A774C0_CLK_S3D2),
+       DEF_MOD("i2c5",                  919,   R8A774C0_CLK_S3D2),
+       DEF_MOD("i2c-dvfs",              926,   R8A774C0_CLK_CP),
+       DEF_MOD("i2c4",                  927,   R8A774C0_CLK_S3D2),
+       DEF_MOD("i2c3",                  928,   R8A774C0_CLK_S3D2),
+       DEF_MOD("i2c2",                  929,   R8A774C0_CLK_S3D2),
+       DEF_MOD("i2c1",                  930,   R8A774C0_CLK_S3D2),
+       DEF_MOD("i2c0",                  931,   R8A774C0_CLK_S3D2),
+
+       DEF_MOD("i2c7",                 1003,   R8A774C0_CLK_S3D2),
+       DEF_MOD("ssi-all",              1005,   R8A774C0_CLK_S3D4),
+       DEF_MOD("ssi9",                 1006,   MOD_CLK_ID(1005)),
+       DEF_MOD("ssi8",                 1007,   MOD_CLK_ID(1005)),
+       DEF_MOD("ssi7",                 1008,   MOD_CLK_ID(1005)),
+       DEF_MOD("ssi6",                 1009,   MOD_CLK_ID(1005)),
+       DEF_MOD("ssi5",                 1010,   MOD_CLK_ID(1005)),
+       DEF_MOD("ssi4",                 1011,   MOD_CLK_ID(1005)),
+       DEF_MOD("ssi3",                 1012,   MOD_CLK_ID(1005)),
+       DEF_MOD("ssi2",                 1013,   MOD_CLK_ID(1005)),
+       DEF_MOD("ssi1",                 1014,   MOD_CLK_ID(1005)),
+       DEF_MOD("ssi0",                 1015,   MOD_CLK_ID(1005)),
+       DEF_MOD("scu-all",              1017,   R8A774C0_CLK_S3D4),
+       DEF_MOD("scu-dvc1",             1018,   MOD_CLK_ID(1017)),
+       DEF_MOD("scu-dvc0",             1019,   MOD_CLK_ID(1017)),
+       DEF_MOD("scu-ctu1-mix1",        1020,   MOD_CLK_ID(1017)),
+       DEF_MOD("scu-ctu0-mix0",        1021,   MOD_CLK_ID(1017)),
+       DEF_MOD("scu-src9",             1022,   MOD_CLK_ID(1017)),
+       DEF_MOD("scu-src8",             1023,   MOD_CLK_ID(1017)),
+       DEF_MOD("scu-src7",             1024,   MOD_CLK_ID(1017)),
+       DEF_MOD("scu-src6",             1025,   MOD_CLK_ID(1017)),
+       DEF_MOD("scu-src5",             1026,   MOD_CLK_ID(1017)),
+       DEF_MOD("scu-src4",             1027,   MOD_CLK_ID(1017)),
+       DEF_MOD("scu-src3",             1028,   MOD_CLK_ID(1017)),
+       DEF_MOD("scu-src2",             1029,   MOD_CLK_ID(1017)),
+       DEF_MOD("scu-src1",             1030,   MOD_CLK_ID(1017)),
+       DEF_MOD("scu-src0",             1031,   MOD_CLK_ID(1017)),
+};
+
+static const unsigned int r8a774c0_crit_mod_clks[] __initconst = {
+       MOD_CLK_ID(408),        /* INTC-AP (GIC) */
+};
+
+/*
+ * CPG Clock Data
+ */
+
+/*
+ * MD19                EXTAL (MHz)     PLL0            PLL1            PLL3
+ *--------------------------------------------------------------------
+ * 0           48 x 1          x100/1          x100/3          x100/3
+ * 1           48 x 1          x100/1          x100/3           x58/3
+ */
+#define CPG_PLL_CONFIG_INDEX(md)       (((md) & BIT(19)) >> 19)
+
+static const struct rcar_gen3_cpg_pll_config cpg_pll_configs[2] __initconst = {
+       /* EXTAL div    PLL1 mult/div   PLL3 mult/div */
+       { 1,            100,    3,      100,    3,      },
+       { 1,            100,    3,       58,    3,      },
+};
+
+static int __init r8a774c0_cpg_mssr_init(struct device *dev)
+{
+       const struct rcar_gen3_cpg_pll_config *cpg_pll_config;
+       u32 cpg_mode;
+       int error;
+
+       error = rcar_rst_read_mode_pins(&cpg_mode);
+       if (error)
+               return error;
+
+       cpg_pll_config = &cpg_pll_configs[CPG_PLL_CONFIG_INDEX(cpg_mode)];
+
+       return rcar_gen3_cpg_init(cpg_pll_config, 0, cpg_mode);
+}
+
+const struct cpg_mssr_info r8a774c0_cpg_mssr_info __initconst = {
+       /* Core Clocks */
+       .core_clks = r8a774c0_core_clks,
+       .num_core_clks = ARRAY_SIZE(r8a774c0_core_clks),
+       .last_dt_core_clk = LAST_DT_CORE_CLK,
+       .num_total_core_clks = MOD_CLK_BASE,
+
+       /* Module Clocks */
+       .mod_clks = r8a774c0_mod_clks,
+       .num_mod_clks = ARRAY_SIZE(r8a774c0_mod_clks),
+       .num_hw_mod_clks = 12 * 32,
+
+       /* Critical Module Clocks */
+       .crit_mod_clks = r8a774c0_crit_mod_clks,
+       .num_crit_mod_clks = ARRAY_SIZE(r8a774c0_crit_mod_clks),
+
+       /* Callbacks */
+       .init = r8a774c0_cpg_mssr_init,
+       .cpg_clk_register = rcar_gen3_cpg_clk_register,
+};
index f936cb74b6811678f8ba93a003a573afc0c0151d..c57cb93f831589f85eed013f616d99ceadf5c740 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
  * r8a7790 Clock Pulse Generator / Module Standby and Software Reset
  *
@@ -6,10 +7,6 @@
  * Based on clk-rcar-gen2.c
  *
  * Copyright (C) 2013 Ideas On Board SPRL
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2 of the License.
  */
 
 #include <linux/device.h>
index 1b91f03b7598076683f1300ce01b6ccd3b7a416d..65702debcabbf654a23ad9922415b3c5f95d77b5 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
  * r8a7791 Clock Pulse Generator / Module Standby and Software Reset
  *
@@ -6,10 +7,6 @@
  * Based on clk-rcar-gen2.c
  *
  * Copyright (C) 2013 Ideas On Board SPRL
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2 of the License.
  */
 
 #include <linux/device.h>
index 493e07859f5fa40deee18d36ee78bea180c932e3..cf8b84a3a06052fbdacf63e6975e0b60bc6b4456 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
  * r8a7792 Clock Pulse Generator / Module Standby and Software Reset
  *
@@ -6,10 +7,6 @@
  * Based on clk-rcar-gen2.c
  *
  * Copyright (C) 2013 Ideas On Board SPRL
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2 of the License.
  */
 
 #include <linux/device.h>
index 088f4b79fdfcdab4448a242ed6de89df97688716..c1948693c5c1c499b8262b12925c74a2ef1fb8e3 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
  * r8a7794 Clock Pulse Generator / Module Standby and Software Reset
  *
@@ -6,10 +7,6 @@
  * Based on clk-rcar-gen2.c
  *
  * Copyright (C) 2013 Ideas On Board SPRL
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2 of the License.
  */
 
 #include <linux/device.h>
index a85dd50e89110d5d4c571c791a5a8cb87a4d537a..119c024407263568e89d0a66bcf89be8a6259c43 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
  * r8a7795 Clock Pulse Generator / Module Standby and Software Reset
  *
@@ -6,10 +7,6 @@
  * Based on clk-rcar-gen3.c
  *
  * Copyright (C) 2015 Renesas Electronics Corp.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2 of the License.
  */
 
 #include <linux/device.h>
@@ -73,6 +70,8 @@ static struct cpg_core_clk r8a7795_core_clks[] __initdata = {
        DEF_FIXED(".s3",        CLK_S3,            CLK_PLL1_DIV2,  6, 1),
        DEF_FIXED(".sdsrc",     CLK_SDSRC,         CLK_PLL1_DIV2,  2, 1),
 
+       DEF_GEN3_OSC(".r",      CLK_RINT,          CLK_EXTAL,      32),
+
        /* Core Clock Outputs */
        DEF_BASE("z",           R8A7795_CLK_Z,     CLK_TYPE_GEN3_Z, CLK_PLL0),
        DEF_BASE("z2",          R8A7795_CLK_Z2,    CLK_TYPE_GEN3_Z2, CLK_PLL2),
@@ -111,8 +110,7 @@ static struct cpg_core_clk r8a7795_core_clks[] __initdata = {
        DEF_DIV6P1("mso",       R8A7795_CLK_MSO,   CLK_PLL1_DIV4, 0x014),
        DEF_DIV6P1("hdmi",      R8A7795_CLK_HDMI,  CLK_PLL1_DIV4, 0x250),
 
-       DEF_DIV6_RO("osc",      R8A7795_CLK_OSC,   CLK_EXTAL, CPG_RCKCR,  8),
-       DEF_DIV6_RO("r_int",    CLK_RINT,          CLK_EXTAL, CPG_RCKCR, 32),
+       DEF_GEN3_OSC("osc",     R8A7795_CLK_OSC,   CLK_EXTAL,     8),
 
        DEF_BASE("r",           R8A7795_CLK_R,     CLK_TYPE_GEN3_R, CLK_RINT),
 };
@@ -283,25 +281,25 @@ static const unsigned int r8a7795_crit_mod_clks[] __initconst = {
  */
 
 /*
- *   MD                EXTAL           PLL0    PLL1    PLL2    PLL3    PLL4
+ *   MD                EXTAL           PLL0    PLL1    PLL2    PLL3    PLL4    OSC
  * 14 13 19 17 (MHz)
- *-------------------------------------------------------------------
- * 0  0  0  0  16.66 x 1       x180    x192    x144    x192    x144
- * 0  0  0  1  16.66 x 1       x180    x192    x144    x128    x144
+ *-------------------------------------------------------------------------
+ * 0  0  0  0  16.66 x 1       x180    x192    x144    x192    x144    /16
+ * 0  0  0  1  16.66 x 1       x180    x192    x144    x128    x144    /16
  * 0  0  1  0  Prohibited setting
- * 0  0  1  1  16.66 x 1       x180    x192    x144    x192    x144
- * 0  1  0  0  20    x 1       x150    x160    x120    x160    x120
- * 0  1  0  1  20    x 1       x150    x160    x120    x106    x120
+ * 0  0  1  1  16.66 x 1       x180    x192    x144    x192    x144    /16
+ * 0  1  0  0  20    x 1       x150    x160    x120    x160    x120    /19
+ * 0  1  0  1  20    x 1       x150    x160    x120    x106    x120    /19
  * 0  1  1  0  Prohibited setting
- * 0  1  1  1  20    x 1       x150    x160    x120    x160    x120
- * 1  0  0  0  25    x 1       x120    x128    x96     x128    x96
- * 1  0  0  1  25    x 1       x120    x128    x96     x84     x96
+ * 0  1  1  1  20    x 1       x150    x160    x120    x160    x120    /19
+ * 1  0  0  0  25    x 1       x120    x128    x96     x128    x96     /24
+ * 1  0  0  1  25    x 1       x120    x128    x96     x84     x96     /24
  * 1  0  1  0  Prohibited setting
- * 1  0  1  1  25    x 1       x120    x128    x96     x128    x96
- * 1  1  0  0  33.33 / 2       x180    x192    x144    x192    x144
- * 1  1  0  1  33.33 / 2       x180    x192    x144    x128    x144
+ * 1  0  1  1  25    x 1       x120    x128    x96     x128    x96     /24
+ * 1  1  0  0  33.33 / 2       x180    x192    x144    x192    x144    /32
+ * 1  1  0  1  33.33 / 2       x180    x192    x144    x128    x144    /32
  * 1  1  1  0  Prohibited setting
- * 1  1  1  1  33.33 / 2       x180    x192    x144    x192    x144
+ * 1  1  1  1  33.33 / 2       x180    x192    x144    x192    x144    /32
  */
 #define CPG_PLL_CONFIG_INDEX(md)       ((((md) & BIT(14)) >> 11) | \
                                         (((md) & BIT(13)) >> 11) | \
@@ -309,23 +307,23 @@ static const unsigned int r8a7795_crit_mod_clks[] __initconst = {
                                         (((md) & BIT(17)) >> 17))
 
 static const struct rcar_gen3_cpg_pll_config cpg_pll_configs[16] __initconst = {
-       /* EXTAL div    PLL1 mult/div   PLL3 mult/div */
-       { 1,            192,    1,      192,    1,      },
-       { 1,            192,    1,      128,    1,      },
-       { 0, /* Prohibited setting */                   },
-       { 1,            192,    1,      192,    1,      },
-       { 1,            160,    1,      160,    1,      },
-       { 1,            160,    1,      106,    1,      },
-       { 0, /* Prohibited setting */                   },
-       { 1,            160,    1,      160,    1,      },
-       { 1,            128,    1,      128,    1,      },
-       { 1,            128,    1,      84,     1,      },
-       { 0, /* Prohibited setting */                   },
-       { 1,            128,    1,      128,    1,      },
-       { 2,            192,    1,      192,    1,      },
-       { 2,            192,    1,      128,    1,      },
-       { 0, /* Prohibited setting */                   },
-       { 2,            192,    1,      192,    1,      },
+       /* EXTAL div    PLL1 mult/div   PLL3 mult/div   OSC prediv */
+       { 1,            192,    1,      192,    1,      16,     },
+       { 1,            192,    1,      128,    1,      16,     },
+       { 0, /* Prohibited setting */                           },
+       { 1,            192,    1,      192,    1,      16,     },
+       { 1,            160,    1,      160,    1,      19,     },
+       { 1,            160,    1,      106,    1,      19,     },
+       { 0, /* Prohibited setting */                           },
+       { 1,            160,    1,      160,    1,      19,     },
+       { 1,            128,    1,      128,    1,      24,     },
+       { 1,            128,    1,      84,     1,      24,     },
+       { 0, /* Prohibited setting */                           },
+       { 1,            128,    1,      128,    1,      24,     },
+       { 2,            192,    1,      192,    1,      32,     },
+       { 2,            192,    1,      128,    1,      32,     },
+       { 0, /* Prohibited setting */                           },
+       { 2,            192,    1,      192,    1,      32,     },
 };
 
 static const struct soc_device_attribute r8a7795es1[] __initconst = {
index dfb267a92f2a20d384b9f0ea1f04859eb71aeefc..10567386e6dd83eb8e9e4f9e448eaafa6bcdc95d 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
  * r8a7796 Clock Pulse Generator / Module Standby and Software Reset
  *
@@ -7,10 +8,6 @@
  *
  * Copyright (C) 2015 Glider bvba
  * Copyright (C) 2015 Renesas Electronics Corp.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2 of the License.
  */
 
 #include <linux/device.h>
@@ -73,6 +70,8 @@ static const struct cpg_core_clk r8a7796_core_clks[] __initconst = {
        DEF_FIXED(".s3",        CLK_S3,            CLK_PLL1_DIV2,  6, 1),
        DEF_FIXED(".sdsrc",     CLK_SDSRC,         CLK_PLL1_DIV2,  2, 1),
 
+       DEF_GEN3_OSC(".r",      CLK_RINT,          CLK_EXTAL,      32),
+
        /* Core Clock Outputs */
        DEF_BASE("z",           R8A7796_CLK_Z,     CLK_TYPE_GEN3_Z, CLK_PLL0),
        DEF_BASE("z2",          R8A7796_CLK_Z2,    CLK_TYPE_GEN3_Z2, CLK_PLL2),
@@ -110,8 +109,7 @@ static const struct cpg_core_clk r8a7796_core_clks[] __initconst = {
        DEF_DIV6P1("mso",       R8A7796_CLK_MSO,   CLK_PLL1_DIV4, 0x014),
        DEF_DIV6P1("hdmi",      R8A7796_CLK_HDMI,  CLK_PLL1_DIV4, 0x250),
 
-       DEF_DIV6_RO("osc",      R8A7796_CLK_OSC,   CLK_EXTAL, CPG_RCKCR,  8),
-       DEF_DIV6_RO("r_int",    CLK_RINT,          CLK_EXTAL, CPG_RCKCR, 32),
+       DEF_GEN3_OSC("osc",     R8A7796_CLK_OSC,   CLK_EXTAL,     8),
 
        DEF_BASE("r",           R8A7796_CLK_R,     CLK_TYPE_GEN3_R, CLK_RINT),
 };
@@ -255,25 +253,25 @@ static const unsigned int r8a7796_crit_mod_clks[] __initconst = {
  */
 
 /*
- *   MD                EXTAL           PLL0    PLL1    PLL2    PLL3    PLL4
+ *   MD                EXTAL           PLL0    PLL1    PLL2    PLL3    PLL4    OSC
  * 14 13 19 17 (MHz)
- *-------------------------------------------------------------------
- * 0  0  0  0  16.66 x 1       x180    x192    x144    x192    x144
- * 0  0  0  1  16.66 x 1       x180    x192    x144    x128    x144
+ *-------------------------------------------------------------------------
+ * 0  0  0  0  16.66 x 1       x180    x192    x144    x192    x144    /16
+ * 0  0  0  1  16.66 x 1       x180    x192    x144    x128    x144    /16
  * 0  0  1  0  Prohibited setting
- * 0  0  1  1  16.66 x 1       x180    x192    x144    x192    x144
- * 0  1  0  0  20    x 1       x150    x160    x120    x160    x120
- * 0  1  0  1  20    x 1       x150    x160    x120    x106    x120
+ * 0  0  1  1  16.66 x 1       x180    x192    x144    x192    x144    /16
+ * 0  1  0  0  20    x 1       x150    x160    x120    x160    x120    /19
+ * 0  1  0  1  20    x 1       x150    x160    x120    x106    x120    /19
  * 0  1  1  0  Prohibited setting
- * 0  1  1  1  20    x 1       x150    x160    x120    x160    x120
- * 1  0  0  0  25    x 1       x120    x128    x96     x128    x96
- * 1  0  0  1  25    x 1       x120    x128    x96     x84     x96
+ * 0  1  1  1  20    x 1       x150    x160    x120    x160    x120    /19
+ * 1  0  0  0  25    x 1       x120    x128    x96     x128    x96     /24
+ * 1  0  0  1  25    x 1       x120    x128    x96     x84     x96     /24
  * 1  0  1  0  Prohibited setting
- * 1  0  1  1  25    x 1       x120    x128    x96     x128    x96
- * 1  1  0  0  33.33 / 2       x180    x192    x144    x192    x144
- * 1  1  0  1  33.33 / 2       x180    x192    x144    x128    x144
+ * 1  0  1  1  25    x 1       x120    x128    x96     x128    x96     /24
+ * 1  1  0  0  33.33 / 2       x180    x192    x144    x192    x144    /32
+ * 1  1  0  1  33.33 / 2       x180    x192    x144    x128    x144    /32
  * 1  1  1  0  Prohibited setting
- * 1  1  1  1  33.33 / 2       x180    x192    x144    x192    x144
+ * 1  1  1  1  33.33 / 2       x180    x192    x144    x192    x144    /32
  */
 #define CPG_PLL_CONFIG_INDEX(md)       ((((md) & BIT(14)) >> 11) | \
                                         (((md) & BIT(13)) >> 11) | \
@@ -281,23 +279,23 @@ static const unsigned int r8a7796_crit_mod_clks[] __initconst = {
                                         (((md) & BIT(17)) >> 17))
 
 static const struct rcar_gen3_cpg_pll_config cpg_pll_configs[16] __initconst = {
-       /* EXTAL div    PLL1 mult/div   PLL3 mult/div */
-       { 1,            192,    1,      192,    1,      },
-       { 1,            192,    1,      128,    1,      },
-       { 0, /* Prohibited setting */                   },
-       { 1,            192,    1,      192,    1,      },
-       { 1,            160,    1,      160,    1,      },
-       { 1,            160,    1,      106,    1,      },
-       { 0, /* Prohibited setting */                   },
-       { 1,            160,    1,      160,    1,      },
-       { 1,            128,    1,      128,    1,      },
-       { 1,            128,    1,      84,     1,      },
-       { 0, /* Prohibited setting */                   },
-       { 1,            128,    1,      128,    1,      },
-       { 2,            192,    1,      192,    1,      },
-       { 2,            192,    1,      128,    1,      },
-       { 0, /* Prohibited setting */                   },
-       { 2,            192,    1,      192,    1,      },
+       /* EXTAL div    PLL1 mult/div   PLL3 mult/div   OSC prediv */
+       { 1,            192,    1,      192,    1,      16,     },
+       { 1,            192,    1,      128,    1,      16,     },
+       { 0, /* Prohibited setting */                           },
+       { 1,            192,    1,      192,    1,      16,     },
+       { 1,            160,    1,      160,    1,      19,     },
+       { 1,            160,    1,      106,    1,      19,     },
+       { 0, /* Prohibited setting */                           },
+       { 1,            160,    1,      160,    1,      19,     },
+       { 1,            128,    1,      128,    1,      24,     },
+       { 1,            128,    1,      84,     1,      24,     },
+       { 0, /* Prohibited setting */                           },
+       { 1,            128,    1,      128,    1,      24,     },
+       { 2,            192,    1,      192,    1,      32,     },
+       { 2,            192,    1,      128,    1,      32,     },
+       { 0, /* Prohibited setting */                           },
+       { 2,            192,    1,      192,    1,      32,     },
 };
 
 static int __init r8a7796_cpg_mssr_init(struct device *dev)
index 8fae5e9c4a77242d9ea1615f14e1cf08e6507b8e..1fcc411502da5e5f317c7f44a30d69b84d5cf2bf 100644 (file)
@@ -68,6 +68,8 @@ static const struct cpg_core_clk r8a77965_core_clks[] __initconst = {
        DEF_FIXED(".s3",        CLK_S3,                 CLK_PLL1_DIV2,  6, 1),
        DEF_FIXED(".sdsrc",     CLK_SDSRC,              CLK_PLL1_DIV2,  2, 1),
 
+       DEF_GEN3_OSC(".r",      CLK_RINT,               CLK_EXTAL,      32),
+
        /* Core Clock Outputs */
        DEF_BASE("z",           R8A77965_CLK_Z,         CLK_TYPE_GEN3_Z, CLK_PLL0),
        DEF_FIXED("ztr",        R8A77965_CLK_ZTR,       CLK_PLL1_DIV2,  6, 1),
@@ -104,13 +106,13 @@ static const struct cpg_core_clk r8a77965_core_clks[] __initconst = {
        DEF_DIV6P1("mso",       R8A77965_CLK_MSO,       CLK_PLL1_DIV4,  0x014),
        DEF_DIV6P1("hdmi",      R8A77965_CLK_HDMI,      CLK_PLL1_DIV4,  0x250),
 
-       DEF_DIV6_RO("osc",      R8A77965_CLK_OSC, CLK_EXTAL, CPG_RCKCR, 8),
-       DEF_DIV6_RO("r_int",    CLK_RINT, CLK_EXTAL, CPG_RCKCR, 32),
+       DEF_GEN3_OSC("osc",     R8A77965_CLK_OSC,       CLK_EXTAL,      8),
 
        DEF_BASE("r",           R8A77965_CLK_R, CLK_TYPE_GEN3_R, CLK_RINT),
 };
 
 static const struct mssr_mod_clk r8a77965_mod_clks[] __initconst = {
+       DEF_MOD("fdp1-0",               119,    R8A77965_CLK_S0D1),
        DEF_MOD("scif5",                202,    R8A77965_CLK_S3D4),
        DEF_MOD("scif4",                203,    R8A77965_CLK_S3D4),
        DEF_MOD("scif3",                204,    R8A77965_CLK_S3D4),
@@ -192,6 +194,7 @@ static const struct mssr_mod_clk r8a77965_mod_clks[] __initconst = {
        DEF_MOD("vin1",                 810,    R8A77965_CLK_S0D2),
        DEF_MOD("vin0",                 811,    R8A77965_CLK_S0D2),
        DEF_MOD("etheravb",             812,    R8A77965_CLK_S0D6),
+       DEF_MOD("sata0",                815,    R8A77965_CLK_S3D2),
        DEF_MOD("imr1",                 822,    R8A77965_CLK_S0D2),
        DEF_MOD("imr0",                 823,    R8A77965_CLK_S0D2),
 
@@ -252,25 +255,25 @@ static const unsigned int r8a77965_crit_mod_clks[] __initconst = {
  */
 
 /*
- *   MD                EXTAL           PLL0    PLL1    PLL3    PLL4
+ *   MD                EXTAL           PLL0    PLL1    PLL3    PLL4    OSC
  * 14 13 19 17 (MHz)
- *-----------------------------------------------------------
- * 0  0  0  0  16.66 x 1       x180    x192    x192    x144
- * 0  0  0  1  16.66 x 1       x180    x192    x128    x144
+ *-----------------------------------------------------------------
+ * 0  0  0  0  16.66 x 1       x180    x192    x192    x144    /16
+ * 0  0  0  1  16.66 x 1       x180    x192    x128    x144    /16
  * 0  0  1  0  Prohibited setting
- * 0  0  1  1  16.66 x 1       x180    x192    x192    x144
- * 0  1  0  0  20    x 1       x150    x160    x160    x120
- * 0  1  0  1  20    x 1       x150    x160    x106    x120
+ * 0  0  1  1  16.66 x 1       x180    x192    x192    x144    /16
+ * 0  1  0  0  20    x 1       x150    x160    x160    x120    /19
+ * 0  1  0  1  20    x 1       x150    x160    x106    x120    /19
  * 0  1  1  0  Prohibited setting
- * 0  1  1  1  20    x 1       x150    x160    x160    x120
- * 1  0  0  0  25    x 1       x120    x128    x128    x96
- * 1  0  0  1  25    x 1       x120    x128    x84     x96
+ * 0  1  1  1  20    x 1       x150    x160    x160    x120    /19
+ * 1  0  0  0  25    x 1       x120    x128    x128    x96     /24
+ * 1  0  0  1  25    x 1       x120    x128    x84     x96     /24
  * 1  0  1  0  Prohibited setting
- * 1  0  1  1  25    x 1       x120    x128    x128    x96
- * 1  1  0  0  33.33 / 2       x180    x192    x192    x144
- * 1  1  0  1  33.33 / 2       x180    x192    x128    x144
+ * 1  0  1  1  25    x 1       x120    x128    x128    x96     /24
+ * 1  1  0  0  33.33 / 2       x180    x192    x192    x144    /32
+ * 1  1  0  1  33.33 / 2       x180    x192    x128    x144    /32
  * 1  1  1  0  Prohibited setting
- * 1  1  1  1  33.33 / 2       x180    x192    x192    x144
+ * 1  1  1  1  33.33 / 2       x180    x192    x192    x144    /32
  */
 #define CPG_PLL_CONFIG_INDEX(md)       ((((md) & BIT(14)) >> 11) | \
                                         (((md) & BIT(13)) >> 11) | \
@@ -278,23 +281,23 @@ static const unsigned int r8a77965_crit_mod_clks[] __initconst = {
                                         (((md) & BIT(17)) >> 17))
 
 static const struct rcar_gen3_cpg_pll_config cpg_pll_configs[16] __initconst = {
-       /* EXTAL div    PLL1 mult/div   PLL3 mult/div */
-       { 1,            192,    1,      192,    1,      },
-       { 1,            192,    1,      128,    1,      },
-       { 0, /* Prohibited setting */                   },
-       { 1,            192,    1,      192,    1,      },
-       { 1,            160,    1,      160,    1,      },
-       { 1,            160,    1,      106,    1,      },
-       { 0, /* Prohibited setting */                   },
-       { 1,            160,    1,      160,    1,      },
-       { 1,            128,    1,      128,    1,      },
-       { 1,            128,    1,      84,     1,      },
-       { 0, /* Prohibited setting */                   },
-       { 1,            128,    1,      128,    1,      },
-       { 2,            192,    1,      192,    1,      },
-       { 2,            192,    1,      128,    1,      },
-       { 0, /* Prohibited setting */                   },
-       { 2,            192,    1,      192,    1,      },
+       /* EXTAL div    PLL1 mult/div   PLL3 mult/div   OSC prediv */
+       { 1,            192,    1,      192,    1,      16,     },
+       { 1,            192,    1,      128,    1,      16,     },
+       { 0, /* Prohibited setting */                           },
+       { 1,            192,    1,      192,    1,      16,     },
+       { 1,            160,    1,      160,    1,      19,     },
+       { 1,            160,    1,      106,    1,      19,     },
+       { 0, /* Prohibited setting */                           },
+       { 1,            160,    1,      160,    1,      19,     },
+       { 1,            128,    1,      128,    1,      24,     },
+       { 1,            128,    1,      84,     1,      24,     },
+       { 0, /* Prohibited setting */                           },
+       { 1,            128,    1,      128,    1,      24,     },
+       { 2,            192,    1,      192,    1,      32,     },
+       { 2,            192,    1,      128,    1,      32,     },
+       { 0, /* Prohibited setting */                           },
+       { 2,            192,    1,      192,    1,      32,     },
 };
 
 static int __init r8a77965_cpg_mssr_init(struct device *dev)
index f55842917e8dd36ab86135113ffb468cd60798ba..2015e45543e948f23aa70160a4a5b34f9f61355d 100644 (file)
@@ -1,17 +1,15 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
  * r8a77970 Clock Pulse Generator / Module Standby and Software Reset
  *
- * Copyright (C) 2017 Cogent Embedded Inc.
+ * Copyright (C) 2017-2018 Cogent Embedded Inc.
  *
  * Based on r8a7795-cpg-mssr.c
  *
  * Copyright (C) 2015 Glider bvba
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2 of the License.
  */
 
+#include <linux/clk-provider.h>
 #include <linux/device.h>
 #include <linux/init.h>
 #include <linux/kernel.h>
 #include "renesas-cpg-mssr.h"
 #include "rcar-gen3-cpg.h"
 
+#define CPG_SD0CKCR            0x0074
+
+enum r8a77970_clk_types {
+       CLK_TYPE_R8A77970_SD0H = CLK_TYPE_GEN3_SOC_BASE,
+       CLK_TYPE_R8A77970_SD0,
+};
+
 enum clk_ids {
        /* Core Clock Outputs exported to DT */
        LAST_DT_CORE_CLK = R8A77970_CLK_OSC,
@@ -42,6 +47,20 @@ enum clk_ids {
        MOD_CLK_BASE
 };
 
+static spinlock_t cpg_lock;
+
+static const struct clk_div_table cpg_sd0h_div_table[] = {
+       {  0,  2 }, {  1,  3 }, {  2,  4 }, {  3,  6 },
+       {  4,  8 }, {  5, 12 }, {  6, 16 }, {  7, 18 },
+       {  8, 24 }, { 10, 36 }, { 11, 48 }, {  0,  0 },
+};
+
+static const struct clk_div_table cpg_sd0_div_table[] = {
+       {  4,  8 }, {  5, 12 }, {  6, 16 }, {  7, 18 },
+       {  8, 24 }, { 10, 36 }, { 11, 48 }, { 12, 10 },
+       {  0,  0 },
+};
+
 static const struct cpg_core_clk r8a77970_core_clks[] __initconst = {
        /* External Clock Inputs */
        DEF_INPUT("extal",      CLK_EXTAL),
@@ -68,6 +87,10 @@ static const struct cpg_core_clk r8a77970_core_clks[] __initconst = {
        DEF_FIXED("s2d2",       R8A77970_CLK_S2D2,  CLK_PLL1_DIV2, 12, 1),
        DEF_FIXED("s2d4",       R8A77970_CLK_S2D4,  CLK_PLL1_DIV2, 24, 1),
 
+       DEF_BASE("sd0h", R8A77970_CLK_SD0H, CLK_TYPE_R8A77970_SD0H,
+                CLK_PLL1_DIV2),
+       DEF_BASE("sd0", R8A77970_CLK_SD0, CLK_TYPE_R8A77970_SD0, CLK_PLL1_DIV2),
+
        DEF_FIXED("cl",         R8A77970_CLK_CL,    CLK_PLL1_DIV2, 48, 1),
        DEF_FIXED("cp",         R8A77970_CLK_CP,    CLK_EXTAL,      2, 1),
 
@@ -80,6 +103,11 @@ static const struct cpg_core_clk r8a77970_core_clks[] __initconst = {
 };
 
 static const struct mssr_mod_clk r8a77970_mod_clks[] __initconst = {
+       DEF_MOD("tmu4",                  121,   R8A77970_CLK_S2D2),
+       DEF_MOD("tmu3",                  122,   R8A77970_CLK_S2D2),
+       DEF_MOD("tmu2",                  123,   R8A77970_CLK_S2D2),
+       DEF_MOD("tmu1",                  124,   R8A77970_CLK_S2D2),
+       DEF_MOD("tmu0",                  125,   R8A77970_CLK_CP),
        DEF_MOD("ivcp1e",                127,   R8A77970_CLK_S2D1),
        DEF_MOD("scif4",                 203,   R8A77970_CLK_S2D4),
        DEF_MOD("scif3",                 204,   R8A77970_CLK_S2D4),
@@ -92,6 +120,12 @@ static const struct mssr_mod_clk r8a77970_mod_clks[] __initconst = {
        DEF_MOD("mfis",                  213,   R8A77970_CLK_S2D2),
        DEF_MOD("sys-dmac2",             217,   R8A77970_CLK_S2D1),
        DEF_MOD("sys-dmac1",             218,   R8A77970_CLK_S2D1),
+       DEF_MOD("cmt3",                  300,   R8A77970_CLK_R),
+       DEF_MOD("cmt2",                  301,   R8A77970_CLK_R),
+       DEF_MOD("cmt1",                  302,   R8A77970_CLK_R),
+       DEF_MOD("cmt0",                  303,   R8A77970_CLK_R),
+       DEF_MOD("tpu0",                  304,   R8A77970_CLK_S2D4),
+       DEF_MOD("sd-if",                 314,   R8A77970_CLK_SD0),
        DEF_MOD("rwdt",                  402,   R8A77970_CLK_R),
        DEF_MOD("intc-ex",               407,   R8A77970_CLK_CP),
        DEF_MOD("intc-ap",               408,   R8A77970_CLK_S2D1),
@@ -173,11 +207,46 @@ static int __init r8a77970_cpg_mssr_init(struct device *dev)
        if (error)
                return error;
 
+       spin_lock_init(&cpg_lock);
+
        cpg_pll_config = &cpg_pll_configs[CPG_PLL_CONFIG_INDEX(cpg_mode)];
 
        return rcar_gen3_cpg_init(cpg_pll_config, CLK_EXTALR, cpg_mode);
 }
 
+static struct clk * __init r8a77970_cpg_clk_register(struct device *dev,
+       const struct cpg_core_clk *core, const struct cpg_mssr_info *info,
+       struct clk **clks, void __iomem *base,
+       struct raw_notifier_head *notifiers)
+{
+       const struct clk_div_table *table;
+       const struct clk *parent;
+       unsigned int shift;
+
+       switch (core->type) {
+       case CLK_TYPE_R8A77970_SD0H:
+               table = cpg_sd0h_div_table;
+               shift = 8;
+               break;
+       case CLK_TYPE_R8A77970_SD0:
+               table = cpg_sd0_div_table;
+               shift = 4;
+               break;
+       default:
+               return rcar_gen3_cpg_clk_register(dev, core, info, clks, base,
+                                                 notifiers);
+       }
+
+       parent = clks[core->parent];
+       if (IS_ERR(parent))
+               return ERR_CAST(parent);
+
+       return clk_register_divider_table(NULL, core->name,
+                                         __clk_get_name(parent), 0,
+                                         base + CPG_SD0CKCR,
+                                         shift, 4, 0, table, &cpg_lock);
+}
+
 const struct cpg_mssr_info r8a77970_cpg_mssr_info __initconst = {
        /* Core Clocks */
        .core_clks = r8a77970_core_clks,
@@ -196,5 +265,5 @@ const struct cpg_mssr_info r8a77970_cpg_mssr_info __initconst = {
 
        /* Callbacks */
        .init = r8a77970_cpg_mssr_init,
-       .cpg_clk_register = rcar_gen3_cpg_clk_register,
+       .cpg_clk_register = r8a77970_cpg_clk_register,
 };
index d7ebd9ec00594fc8e12d8c90c9d8f321a8c1daed..25a3083b676413df960e6dbbe963c04524386511 100644 (file)
@@ -41,6 +41,7 @@ enum clk_ids {
        CLK_S2,
        CLK_S3,
        CLK_SDSRC,
+       CLK_OCO,
 
        /* Module Clocks */
        MOD_CLK_BASE
@@ -64,6 +65,7 @@ static const struct cpg_core_clk r8a77980_core_clks[] __initconst = {
        DEF_FIXED(".s2",        CLK_S2,            CLK_PLL1_DIV2,  4, 1),
        DEF_FIXED(".s3",        CLK_S3,            CLK_PLL1_DIV2,  6, 1),
        DEF_FIXED(".sdsrc",     CLK_SDSRC,         CLK_PLL1_DIV2,  2, 1),
+       DEF_RATE(".oco",        CLK_OCO,           32768),
 
        /* Core Clock Outputs */
        DEF_FIXED("ztr",        R8A77980_CLK_ZTR,   CLK_PLL1_DIV2,  6, 1),
@@ -96,6 +98,9 @@ static const struct cpg_core_clk r8a77980_core_clks[] __initconst = {
        DEF_DIV6P1("canfd",     R8A77980_CLK_CANFD, CLK_PLL1_DIV4, 0x244),
        DEF_DIV6P1("csi0",      R8A77980_CLK_CSI0,  CLK_PLL1_DIV4, 0x00c),
        DEF_DIV6P1("mso",       R8A77980_CLK_MSO,   CLK_PLL1_DIV4, 0x014),
+
+       DEF_GEN3_OSC("osc",     R8A77980_CLK_OSC,   CLK_EXTAL,     8),
+       DEF_GEN3_MDSEL("r",     R8A77980_CLK_R, 29, CLK_EXTALR, 1, CLK_OCO, 1),
 };
 
 static const struct mssr_mod_clk r8a77980_mod_clks[] __initconst = {
@@ -114,9 +119,14 @@ static const struct mssr_mod_clk r8a77980_mod_clks[] __initconst = {
        DEF_MOD("msiof0",                211,   R8A77980_CLK_MSO),
        DEF_MOD("sys-dmac2",             217,   R8A77980_CLK_S0D3),
        DEF_MOD("sys-dmac1",             218,   R8A77980_CLK_S0D3),
+       DEF_MOD("cmt3",                  300,   R8A77980_CLK_R),
+       DEF_MOD("cmt2",                  301,   R8A77980_CLK_R),
+       DEF_MOD("cmt1",                  302,   R8A77980_CLK_R),
+       DEF_MOD("cmt0",                  303,   R8A77980_CLK_R),
        DEF_MOD("tpu0",                  304,   R8A77980_CLK_S3D4),
        DEF_MOD("sdif",                  314,   R8A77980_CLK_SD0),
        DEF_MOD("pciec0",                319,   R8A77980_CLK_S2D2),
+       DEF_MOD("rwdt",                  402,   R8A77980_CLK_R),
        DEF_MOD("intc-ex",               407,   R8A77980_CLK_CP),
        DEF_MOD("intc-ap",               408,   R8A77980_CLK_S0D3),
        DEF_MOD("hscif3",                517,   R8A77980_CLK_S3D1),
@@ -171,23 +181,23 @@ static const unsigned int r8a77980_crit_mod_clks[] __initconst = {
  */
 
 /*
- *   MD                EXTAL           PLL2    PLL1    PLL3
+ *   MD                EXTAL           PLL2    PLL1    PLL3    OSC
  * 14 13       (MHz)
- * --------------------------------------------------
- * 0  0                16.66 x 1       x240    x192    x192
- * 0  1                20    x 1       x200    x160    x160
- * 1  0                27    x 1       x148    x118    x118
- * 1  1                33.33 / 2       x240    x192    x192
+ * --------------------------------------------------------
+ * 0  0                16.66 x 1       x240    x192    x192    /16
+ * 0  1                20    x 1       x200    x160    x160    /19
+ * 1  0                27    x 1       x148    x118    x118    /26
+ * 1  1                33.33 / 2       x240    x192    x192    /32
  */
 #define CPG_PLL_CONFIG_INDEX(md)       ((((md) & BIT(14)) >> 13) | \
                                         (((md) & BIT(13)) >> 13))
 
 static const struct rcar_gen3_cpg_pll_config cpg_pll_configs[4] __initconst = {
-       /* EXTAL div    PLL1 mult/div   PLL3 mult/div */
-       { 1,            192,    1,      192,    1,      },
-       { 1,            160,    1,      160,    1,      },
-       { 1,            118,    1,      118,    1,      },
-       { 2,            192,    1,      192,    1,      },
+       /* EXTAL div    PLL1 mult/div   PLL3 mult/div   OSC prediv */
+       { 1,            192,    1,      192,    1,      16,     },
+       { 1,            160,    1,      160,    1,      19,     },
+       { 1,            118,    1,      118,    1,      26,     },
+       { 2,            192,    1,      192,    1,      32,     },
 };
 
 static int __init r8a77980_cpg_mssr_init(struct device *dev)
index 9e14f1486fbb93ccb887c9b85cae0a61757741f3..9eb80180eea0b1a627ace5e586656f53a26a6472 100644 (file)
@@ -44,6 +44,8 @@ enum clk_ids {
        CLK_S2,
        CLK_S3,
        CLK_SDSRC,
+       CLK_RINT,
+       CLK_OCO,
 
        /* Module Clocks */
        MOD_CLK_BASE
@@ -72,6 +74,10 @@ static const struct cpg_core_clk r8a77990_core_clks[] __initconst = {
        DEF_FIXED(".s3",       CLK_S3,             CLK_PLL1,       6, 1),
        DEF_FIXED(".sdsrc",    CLK_SDSRC,          CLK_PLL1,       2, 1),
 
+       DEF_DIV6_RO(".r",      CLK_RINT,           CLK_EXTAL, CPG_RCKCR, 32),
+
+       DEF_RATE(".oco",       CLK_OCO,            8 * 1000 * 1000),
+
        /* Core Clock Outputs */
        DEF_FIXED("za2",       R8A77990_CLK_ZA2,   CLK_PLL0D24,    1, 1),
        DEF_FIXED("za8",       R8A77990_CLK_ZA8,   CLK_PLL0D8,     1, 1),
@@ -100,8 +106,8 @@ static const struct cpg_core_clk r8a77990_core_clks[] __initconst = {
        DEF_FIXED("cl",        R8A77990_CLK_CL,    CLK_PLL1,      48, 1),
        DEF_FIXED("cp",        R8A77990_CLK_CP,    CLK_EXTAL,      2, 1),
        DEF_FIXED("cpex",      R8A77990_CLK_CPEX,  CLK_EXTAL,      4, 1),
-       DEF_FIXED("osc",       R8A77990_CLK_OSC,   CLK_EXTAL,    384, 1),
-       DEF_FIXED("r",         R8A77990_CLK_R,     CLK_EXTAL,   1536, 1),
+
+       DEF_DIV6_RO("osc",     R8A77990_CLK_OSC,   CLK_EXTAL, CPG_RCKCR,  8),
 
        DEF_GEN3_PE("s0d6c",   R8A77990_CLK_S0D6C, CLK_S0, 6, CLK_PE, 2),
        DEF_GEN3_PE("s3d1c",   R8A77990_CLK_S3D1C, CLK_S3, 1, CLK_PE, 1),
@@ -111,6 +117,8 @@ static const struct cpg_core_clk r8a77990_core_clks[] __initconst = {
        DEF_DIV6P1("canfd",    R8A77990_CLK_CANFD, CLK_PLL0D6, 0x244),
        DEF_DIV6P1("csi0",     R8A77990_CLK_CSI0,  CLK_PLL1D2, 0x00c),
        DEF_DIV6P1("mso",      R8A77990_CLK_MSO,   CLK_PLL1D2, 0x014),
+
+       DEF_GEN3_RCKSEL("r",   R8A77990_CLK_R, CLK_RINT, 1, CLK_OCO, 61 * 4),
 };
 
 static const struct mssr_mod_clk r8a77990_mod_clks[] __initconst = {
@@ -202,6 +210,7 @@ static const struct mssr_mod_clk r8a77990_mod_clks[] __initconst = {
        DEF_MOD("i2c1",                  930,   R8A77990_CLK_S3D2),
        DEF_MOD("i2c0",                  931,   R8A77990_CLK_S3D2),
 
+       DEF_MOD("i2c7",                 1003,   R8A77990_CLK_S3D2),
        DEF_MOD("ssi-all",              1005,   R8A77990_CLK_S3D4),
        DEF_MOD("ssi9",                 1006,   MOD_CLK_ID(1005)),
        DEF_MOD("ssi8",                 1007,   MOD_CLK_ID(1005)),
@@ -241,8 +250,8 @@ static const unsigned int r8a77990_crit_mod_clks[] __initconst = {
 /*
  * MD19                EXTAL (MHz)     PLL0            PLL1            PLL3
  *--------------------------------------------------------------------
- * 0           48 x 1          x100/4          x100/3          x100/3
- * 1           48 x 1          x100/4          x100/3           x58/3
+ * 0           48 x 1          x100/1          x100/3          x100/3
+ * 1           48 x 1          x100/1          x100/3           x58/3
  */
 #define CPG_PLL_CONFIG_INDEX(md)       (((md) & BIT(19)) >> 19)
 
index ea4cafbe6e851aca89c24f79b4912b1a2278d774..47e60e3dbe05ff18252c7513ec2bd5e3c5b39aff 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
  * r8a77995 Clock Pulse Generator / Module Standby and Software Reset
  *
@@ -7,10 +8,6 @@
  *
  * Copyright (C) 2015 Glider bvba
  * Copyright (C) 2015 Renesas Electronics Corp.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2 of the License.
  */
 
 #include <linux/device.h>
@@ -46,6 +43,8 @@ enum clk_ids {
        CLK_S3,
        CLK_SDSRC,
        CLK_SSPSRC,
+       CLK_RINT,
+       CLK_OCO,
 
        /* Module Clocks */
        MOD_CLK_BASE
@@ -72,6 +71,10 @@ static const struct cpg_core_clk r8a77995_core_clks[] __initconst = {
        DEF_FIXED(".s3",       CLK_S3,             CLK_PLL1,       6, 1),
        DEF_FIXED(".sdsrc",    CLK_SDSRC,          CLK_PLL1,       2, 1),
 
+       DEF_DIV6_RO(".r",      CLK_RINT,           CLK_EXTAL, CPG_RCKCR, 32),
+
+       DEF_RATE(".oco",       CLK_OCO,            8 * 1000 * 1000),
+
        /* Core Clock Outputs */
        DEF_FIXED("z2",        R8A77995_CLK_Z2,    CLK_PLL0D3,     1, 1),
        DEF_FIXED("ztr",       R8A77995_CLK_ZTR,   CLK_PLL1,       6, 1),
@@ -90,8 +93,8 @@ static const struct cpg_core_clk r8a77995_core_clks[] __initconst = {
 
        DEF_FIXED("cl",        R8A77995_CLK_CL,    CLK_PLL1,      48, 1),
        DEF_FIXED("cp",        R8A77995_CLK_CP,    CLK_EXTAL,      2, 1),
-       DEF_FIXED("osc",       R8A77995_CLK_OSC,   CLK_EXTAL,    384, 1),
-       DEF_FIXED("r",         R8A77995_CLK_R,     CLK_EXTAL,   1536, 1),
+
+       DEF_DIV6_RO("osc",     R8A77995_CLK_OSC,   CLK_EXTAL, CPG_RCKCR,  8),
 
        DEF_GEN3_PE("s1d4c",   R8A77995_CLK_S1D4C, CLK_S1, 4, CLK_PE, 2),
        DEF_GEN3_PE("s3d1c",   R8A77995_CLK_S3D1C, CLK_S3, 1, CLK_PE, 1),
@@ -102,6 +105,8 @@ static const struct cpg_core_clk r8a77995_core_clks[] __initconst = {
 
        DEF_DIV6P1("canfd",    R8A77995_CLK_CANFD, CLK_PLL0D3,    0x244),
        DEF_DIV6P1("mso",      R8A77995_CLK_MSO,   CLK_PLL1D2,    0x014),
+
+       DEF_GEN3_RCKSEL("r",   R8A77995_CLK_R, CLK_RINT, 1, CLK_OCO, 61 * 4),
 };
 
 static const struct mssr_mod_clk r8a77995_mod_clks[] __initconst = {
index a0b6ecdc63dd3bba3af1675da498c6429fb99904..6d2b56891559725d3d22bf53444b5854feb37a82 100644 (file)
@@ -539,7 +539,8 @@ r9a06g032_div_round_rate(struct clk_hw *hw,
         * several uarts attached to this divider, and changing this impacts
         * everyone.
         */
-       if (clk->index == R9A06G032_DIV_UART) {
+       if (clk->index == R9A06G032_DIV_UART ||
+           clk->index == R9A06G032_DIV_P2_PG) {
                pr_devel("%s div uart hack!\n", __func__);
                return clk_get_rate(hw->clk);
        }
index daf88bc2cdae177becd5adaea85c886a6c56ffc8..f596a2dafcf4d8d1548b53ed506063f984578816 100644 (file)
@@ -1,11 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
  * R-Car Gen2 Clock Pulse Generator
  *
  * Copyright (C) 2016 Cogent Embedded Inc.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 as published
- * by the Free Software Foundation.
  */
 
 #include <linux/bug.h>
index 020a3baad0154231fb397792912fed327f39a0c1..bff9551c7a38a01e90506cc8f424a9b267cb981a 100644 (file)
@@ -1,11 +1,8 @@
-/*
+/* SPDX-License-Identifier: GPL-2.0
+ *
  * R-Car Gen2 Clock Pulse Generator
  *
  * Copyright (C) 2016 Cogent Embedded Inc.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 as published
- * by the Free Software Foundation; version 2 of the License.
  */
 
 #ifndef __CLK_RENESAS_RCAR_GEN2_CPG_H__
index 628b63b85d3f09c5cfdf37dea4b565953e41264a..4ba38f98cc7bab8296631c04e1d3901870e4891e 100644 (file)
@@ -1,15 +1,12 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
  * R-Car Gen3 Clock Pulse Generator
  *
- * Copyright (C) 2015-2016 Glider bvba
+ * Copyright (C) 2015-2018 Glider bvba
  *
  * Based on clk-rcar-gen3.c
  *
  * Copyright (C) 2015 Renesas Electronics Corp.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2 of the License.
  */
 
 #include <linux/bug.h>
@@ -31,6 +28,8 @@
 #define CPG_PLL2CR             0x002c
 #define CPG_PLL4CR             0x01f4
 
+#define CPG_RCKCR_CKSEL        BIT(15) /* RCLK Clock Source Select */
+
 struct cpg_simple_notifier {
        struct notifier_block nb;
        void __iomem *reg;
@@ -444,7 +443,7 @@ struct clk * __init rcar_gen3_cpg_clk_register(struct device *dev,
        unsigned int div = 1;
        u32 value;
 
-       parent = clks[core->parent & 0xffff];   /* CLK_TYPE_PE uses high bits */
+       parent = clks[core->parent & 0xffff];   /* some types use high bits */
        if (IS_ERR(parent))
                return ERR_CAST(parent);
 
@@ -524,7 +523,7 @@ struct clk * __init rcar_gen3_cpg_clk_register(struct device *dev,
 
                        if (clk_get_rate(clks[cpg_clk_extalr])) {
                                parent = clks[cpg_clk_extalr];
-                               value |= BIT(15);
+                               value |= CPG_RCKCR_CKSEL;
                        }
 
                        writel(value, csn->reg);
@@ -537,16 +536,14 @@ struct clk * __init rcar_gen3_cpg_clk_register(struct device *dev,
                        parent = clks[cpg_clk_extalr];
                break;
 
-       case CLK_TYPE_GEN3_PE:
+       case CLK_TYPE_GEN3_MDSEL:
                /*
-                * Peripheral clock with a fixed divider, selectable between
-                * clean and spread spectrum parents using MD12
+                * Clock selectable between two parents and two fixed dividers
+                * using a mode pin
                 */
-               if (cpg_mode & BIT(12)) {
-                       /* Clean */
+               if (cpg_mode & BIT(core->offset)) {
                        div = core->div & 0xffff;
                } else {
-                       /* SCCG */
                        parent = clks[core->parent >> 16];
                        if (IS_ERR(parent))
                                return ERR_CAST(parent);
@@ -563,6 +560,28 @@ struct clk * __init rcar_gen3_cpg_clk_register(struct device *dev,
                return cpg_z_clk_register(core->name, __clk_get_name(parent),
                                          base, CPG_FRQCRC_Z2FC_MASK);
 
+       case CLK_TYPE_GEN3_OSC:
+               /*
+                * Clock combining OSC EXTAL predivider and a fixed divider
+                */
+               div = cpg_pll_config->osc_prediv * core->div;
+               break;
+
+       case CLK_TYPE_GEN3_RCKSEL:
+               /*
+                * Clock selectable between two parents and two fixed dividers
+                * using RCKCR.CKSEL
+                */
+               if (readl(base + CPG_RCKCR) & CPG_RCKCR_CKSEL) {
+                       div = core->div & 0xffff;
+               } else {
+                       parent = clks[core->parent >> 16];
+                       if (IS_ERR(parent))
+                               return ERR_CAST(parent);
+                       div = core->div >> 16;
+               }
+               break;
+
        default:
                return ERR_PTR(-EINVAL);
        }
index ea4f8fc3c4c972e79418cef9a251bad3bd4fcbee..f4fb6cf16688cfb3d34a07f8add2764a181c46d9 100644 (file)
@@ -1,11 +1,9 @@
-/*
+/* SPDX-License-Identifier: GPL-2.0
+ *
  * R-Car Gen3 Clock Pulse Generator
  *
- * Copyright (C) 2015-2016 Glider bvba
+ * Copyright (C) 2015-2018 Glider bvba
  *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2 of the License.
  */
 
 #ifndef __CLK_RENESAS_RCAR_GEN3_CPG_H__
@@ -20,19 +18,35 @@ enum rcar_gen3_clk_types {
        CLK_TYPE_GEN3_PLL4,
        CLK_TYPE_GEN3_SD,
        CLK_TYPE_GEN3_R,
-       CLK_TYPE_GEN3_PE,
+       CLK_TYPE_GEN3_MDSEL,    /* Select parent/divider using mode pin */
        CLK_TYPE_GEN3_Z,
        CLK_TYPE_GEN3_Z2,
+       CLK_TYPE_GEN3_OSC,      /* OSC EXTAL predivider and fixed divider */
+       CLK_TYPE_GEN3_RCKSEL,   /* Select parent/divider using RCKCR.CKSEL */
+
+       /* SoC specific definitions start here */
+       CLK_TYPE_GEN3_SOC_BASE,
 };
 
 #define DEF_GEN3_SD(_name, _id, _parent, _offset)      \
        DEF_BASE(_name, _id, CLK_TYPE_GEN3_SD, _parent, .offset = _offset)
 
+#define DEF_GEN3_MDSEL(_name, _id, _md, _parent0, _div0, _parent1, _div1) \
+       DEF_BASE(_name, _id, CLK_TYPE_GEN3_MDSEL,       \
+                (_parent0) << 16 | (_parent1),         \
+                .div = (_div0) << 16 | (_div1), .offset = _md)
+
 #define DEF_GEN3_PE(_name, _id, _parent_sscg, _div_sscg, _parent_clean, \
                    _div_clean) \
-       DEF_BASE(_name, _id, CLK_TYPE_GEN3_PE,                  \
-                (_parent_sscg) << 16 | (_parent_clean),        \
-                .div = (_div_sscg) << 16 | (_div_clean))
+       DEF_GEN3_MDSEL(_name, _id, 12, _parent_sscg, _div_sscg, \
+                      _parent_clean, _div_clean)
+
+#define DEF_GEN3_OSC(_name, _id, _parent, _div)                \
+       DEF_BASE(_name, _id, CLK_TYPE_GEN3_OSC, _parent, .div = _div)
+
+#define DEF_GEN3_RCKSEL(_name, _id, _parent0, _div0, _parent1, _div1) \
+       DEF_BASE(_name, _id, CLK_TYPE_GEN3_RCKSEL,      \
+                (_parent0) << 16 | (_parent1), .div = (_div0) << 16 | (_div1))
 
 struct rcar_gen3_cpg_pll_config {
        u8 extal_div;
@@ -40,6 +54,7 @@ struct rcar_gen3_cpg_pll_config {
        u8 pll1_div;
        u8 pll3_mult;
        u8 pll3_div;
+       u8 osc_prediv;
 };
 
 #define CPG_RCKCR      0x240
index 6cd030a589641335fb10e1137bf6a4d476dba182..b241f9ca3d7146ba85b27ffff0355cc0e9f32277 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
  * Renesas R-Car USB2.0 clock selector
  *
@@ -6,10 +7,6 @@
  * Based on renesas-cpg-mssr.c
  *
  * Copyright (C) 2015 Glider bvba
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2 of the License.
  */
 
 #include <linux/clk.h>
index f4b013e9352d9efca6260c5ca763e8fcc53eb6f5..f7bb817420b4fdbb681680fb6bed29dbaf8b9bf4 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
  * Renesas Clock Pulse Generator / Module Standby and Software Reset
  *
@@ -7,10 +8,6 @@
  *
  * Copyright (C) 2013 Ideas On Board SPRL
  * Copyright (C) 2015 Renesas Electronics Corp.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2 of the License.
  */
 
 #include <linux/clk.h>
@@ -73,6 +70,17 @@ static const u16 smstpcr[] = {
 
 #define        SMSTPCR(i)      smstpcr[i]
 
+/*
+ * Standby Control Register offsets (RZ/A)
+ * Base address is FRQCR register
+ */
+
+static const u16 stbcr[] = {
+       0xFFFF/*dummy*/, 0x010, 0x014, 0x410, 0x414, 0x418, 0x41C, 0x420,
+       0x424, 0x428, 0x42C,
+};
+
+#define        STBCR(i)        stbcr[i]
 
 /*
  * Software Reset Register offsets
@@ -110,6 +118,7 @@ static const u16 srcr[] = {
  * @notifiers: Notifier chain to save/restore clock state for system resume
  * @smstpcr_saved[].mask: Mask of SMSTPCR[] bits under our control
  * @smstpcr_saved[].val: Saved values of SMSTPCR[]
+ * @stbyctrl: This device has Standby Control Registers
  */
 struct cpg_mssr_priv {
 #ifdef CONFIG_RESET_CONTROLLER
@@ -118,11 +127,13 @@ struct cpg_mssr_priv {
        struct device *dev;
        void __iomem *base;
        spinlock_t rmw_lock;
+       struct device_node *np;
 
        struct clk **clks;
        unsigned int num_core_clks;
        unsigned int num_mod_clks;
        unsigned int last_dt_core_clk;
+       bool stbyctrl;
 
        struct raw_notifier_head notifiers;
        struct {
@@ -131,6 +142,7 @@ struct cpg_mssr_priv {
        } smstpcr_saved[ARRAY_SIZE(smstpcr)];
 };
 
+static struct cpg_mssr_priv *cpg_mssr_priv;
 
 /**
  * struct mstp_clock - MSTP gating clock
@@ -162,16 +174,29 @@ static int cpg_mstp_clock_endisable(struct clk_hw *hw, bool enable)
                enable ? "ON" : "OFF");
        spin_lock_irqsave(&priv->rmw_lock, flags);
 
-       value = readl(priv->base + SMSTPCR(reg));
-       if (enable)
-               value &= ~bitmask;
-       else
-               value |= bitmask;
-       writel(value, priv->base + SMSTPCR(reg));
+       if (priv->stbyctrl) {
+               value = readb(priv->base + STBCR(reg));
+               if (enable)
+                       value &= ~bitmask;
+               else
+                       value |= bitmask;
+               writeb(value, priv->base + STBCR(reg));
+
+               /* dummy read to ensure write has completed */
+               readb(priv->base + STBCR(reg));
+               barrier_data(priv->base + STBCR(reg));
+       } else {
+               value = readl(priv->base + SMSTPCR(reg));
+               if (enable)
+                       value &= ~bitmask;
+               else
+                       value |= bitmask;
+               writel(value, priv->base + SMSTPCR(reg));
+       }
 
        spin_unlock_irqrestore(&priv->rmw_lock, flags);
 
-       if (!enable)
+       if (!enable || priv->stbyctrl)
                return 0;
 
        for (i = 1000; i > 0; --i) {
@@ -205,7 +230,10 @@ static int cpg_mstp_clock_is_enabled(struct clk_hw *hw)
        struct cpg_mssr_priv *priv = clock->priv;
        u32 value;
 
-       value = readl(priv->base + MSTPSR(clock->index / 32));
+       if (priv->stbyctrl)
+               value = readb(priv->base + STBCR(clock->index / 32));
+       else
+               value = readl(priv->base + MSTPSR(clock->index / 32));
 
        return !(value & BIT(clock->index % 32));
 }
@@ -226,6 +254,7 @@ struct clk *cpg_mssr_clk_src_twocell_get(struct of_phandle_args *clkspec,
        unsigned int idx;
        const char *type;
        struct clk *clk;
+       int range_check;
 
        switch (clkspec->args[0]) {
        case CPG_CORE:
@@ -240,8 +269,14 @@ struct clk *cpg_mssr_clk_src_twocell_get(struct of_phandle_args *clkspec,
 
        case CPG_MOD:
                type = "module";
-               idx = MOD_CLK_PACK(clkidx);
-               if (clkidx % 100 > 31 || idx >= priv->num_mod_clks) {
+               if (priv->stbyctrl) {
+                       idx = MOD_CLK_PACK_10(clkidx);
+                       range_check = 7 - (clkidx % 10);
+               } else {
+                       idx = MOD_CLK_PACK(clkidx);
+                       range_check = 31 - (clkidx % 100);
+               }
+               if (range_check < 0 || idx >= priv->num_mod_clks) {
                        dev_err(dev, "Invalid %s clock index %u\n", type,
                                clkidx);
                        return ERR_PTR(-EINVAL);
@@ -283,7 +318,7 @@ static void __init cpg_mssr_register_core_clk(const struct cpg_core_clk *core,
 
        switch (core->type) {
        case CLK_TYPE_IN:
-               clk = of_clk_get_by_name(priv->dev->of_node, core->name);
+               clk = of_clk_get_by_name(priv->np, core->name);
                break;
 
        case CLK_TYPE_FF:
@@ -313,6 +348,11 @@ static void __init cpg_mssr_register_core_clk(const struct cpg_core_clk *core,
                }
                break;
 
+       case CLK_TYPE_FR:
+               clk = clk_register_fixed_rate(NULL, core->name, NULL, 0,
+                                             core->mult);
+               break;
+
        default:
                if (info->cpg_clk_register)
                        clk = info->cpg_clk_register(dev, core, info,
@@ -641,11 +681,22 @@ static inline int cpg_mssr_reset_controller_register(struct cpg_mssr_priv *priv)
 
 
 static const struct of_device_id cpg_mssr_match[] = {
+#ifdef CONFIG_CLK_R7S9210
+       {
+               .compatible = "renesas,r7s9210-cpg-mssr",
+               .data = &r7s9210_cpg_mssr_info,
+       },
+#endif
 #ifdef CONFIG_CLK_R8A7743
        {
                .compatible = "renesas,r8a7743-cpg-mssr",
                .data = &r8a7743_cpg_mssr_info,
        },
+       /* RZ/G1N is (almost) identical to RZ/G1M w.r.t. clocks. */
+       {
+               .compatible = "renesas,r8a7744-cpg-mssr",
+               .data = &r8a7743_cpg_mssr_info,
+       },
 #endif
 #ifdef CONFIG_CLK_R8A7745
        {
@@ -659,6 +710,18 @@ static const struct of_device_id cpg_mssr_match[] = {
                .data = &r8a77470_cpg_mssr_info,
        },
 #endif
+#ifdef CONFIG_CLK_R8A774A1
+       {
+               .compatible = "renesas,r8a774a1-cpg-mssr",
+               .data = &r8a774a1_cpg_mssr_info,
+       },
+#endif
+#ifdef CONFIG_CLK_R8A774C0
+       {
+               .compatible = "renesas,r8a774c0-cpg-mssr",
+               .data = &r8a774c0_cpg_mssr_info,
+       },
+#endif
 #ifdef CONFIG_CLK_R8A7790
        {
                .compatible = "renesas,r8a7790-cpg-mssr",
@@ -780,13 +843,23 @@ static int cpg_mssr_resume_noirq(struct device *dev)
                if (!mask)
                        continue;
 
-               oldval = readl(priv->base + SMSTPCR(reg));
+               if (priv->stbyctrl)
+                       oldval = readb(priv->base + STBCR(reg));
+               else
+                       oldval = readl(priv->base + SMSTPCR(reg));
                newval = oldval & ~mask;
                newval |= priv->smstpcr_saved[reg].val & mask;
                if (newval == oldval)
                        continue;
 
-               writel(newval, priv->base + SMSTPCR(reg));
+               if (priv->stbyctrl) {
+                       writeb(newval, priv->base + STBCR(reg));
+                       /* dummy read to ensure write has completed */
+                       readb(priv->base + STBCR(reg));
+                       barrier_data(priv->base + STBCR(reg));
+                       continue;
+               } else
+                       writel(newval, priv->base + SMSTPCR(reg));
 
                /* Wait until enabled clocks are really enabled */
                mask &= ~priv->smstpcr_saved[reg].val;
@@ -817,61 +890,115 @@ static const struct dev_pm_ops cpg_mssr_pm = {
 #define DEV_PM_OPS     NULL
 #endif /* CONFIG_PM_SLEEP && CONFIG_ARM_PSCI_FW */
 
-static int __init cpg_mssr_probe(struct platform_device *pdev)
+static int __init cpg_mssr_common_init(struct device *dev,
+                                      struct device_node *np,
+                                      const struct cpg_mssr_info *info)
 {
-       struct device *dev = &pdev->dev;
-       struct device_node *np = dev->of_node;
-       const struct cpg_mssr_info *info;
        struct cpg_mssr_priv *priv;
+       struct clk **clks = NULL;
        unsigned int nclks, i;
-       struct resource *res;
-       struct clk **clks;
        int error;
 
-       info = of_device_get_match_data(dev);
        if (info->init) {
                error = info->init(dev);
                if (error)
                        return error;
        }
 
-       priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
+       priv = kzalloc(sizeof(*priv), GFP_KERNEL);
        if (!priv)
                return -ENOMEM;
 
+       priv->np = np;
        priv->dev = dev;
        spin_lock_init(&priv->rmw_lock);
 
-       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       priv->base = devm_ioremap_resource(dev, res);
-       if (IS_ERR(priv->base))
-               return PTR_ERR(priv->base);
+       priv->base = of_iomap(np, 0);
+       if (!priv->base) {
+               error = -ENOMEM;
+               goto out_err;
+       }
 
        nclks = info->num_total_core_clks + info->num_hw_mod_clks;
-       clks = devm_kmalloc_array(dev, nclks, sizeof(*clks), GFP_KERNEL);
-       if (!clks)
-               return -ENOMEM;
+       clks = kmalloc_array(nclks, sizeof(*clks), GFP_KERNEL);
+       if (!clks) {
+               error = -ENOMEM;
+               goto out_err;
+       }
 
-       dev_set_drvdata(dev, priv);
+       cpg_mssr_priv = priv;
        priv->clks = clks;
        priv->num_core_clks = info->num_total_core_clks;
        priv->num_mod_clks = info->num_hw_mod_clks;
        priv->last_dt_core_clk = info->last_dt_core_clk;
        RAW_INIT_NOTIFIER_HEAD(&priv->notifiers);
+       priv->stbyctrl = info->stbyctrl;
 
        for (i = 0; i < nclks; i++)
                clks[i] = ERR_PTR(-ENOENT);
 
+       error = of_clk_add_provider(np, cpg_mssr_clk_src_twocell_get, priv);
+       if (error)
+               goto out_err;
+
+       return 0;
+
+out_err:
+       kfree(clks);
+       if (priv->base)
+               iounmap(priv->base);
+       kfree(priv);
+
+       return error;
+}
+
+void __init cpg_mssr_early_init(struct device_node *np,
+                               const struct cpg_mssr_info *info)
+{
+       int error;
+       int i;
+
+       error = cpg_mssr_common_init(NULL, np, info);
+       if (error)
+               return;
+
+       for (i = 0; i < info->num_early_core_clks; i++)
+               cpg_mssr_register_core_clk(&info->early_core_clks[i], info,
+                                          cpg_mssr_priv);
+
+       for (i = 0; i < info->num_early_mod_clks; i++)
+               cpg_mssr_register_mod_clk(&info->early_mod_clks[i], info,
+                                         cpg_mssr_priv);
+
+}
+
+static int __init cpg_mssr_probe(struct platform_device *pdev)
+{
+       struct device *dev = &pdev->dev;
+       struct device_node *np = dev->of_node;
+       const struct cpg_mssr_info *info;
+       struct cpg_mssr_priv *priv;
+       unsigned int i;
+       int error;
+
+       info = of_device_get_match_data(dev);
+
+       if (!cpg_mssr_priv) {
+               error = cpg_mssr_common_init(dev, dev->of_node, info);
+               if (error)
+                       return error;
+       }
+
+       priv = cpg_mssr_priv;
+       priv->dev = dev;
+       dev_set_drvdata(dev, priv);
+
        for (i = 0; i < info->num_core_clks; i++)
                cpg_mssr_register_core_clk(&info->core_clks[i], info, priv);
 
        for (i = 0; i < info->num_mod_clks; i++)
                cpg_mssr_register_mod_clk(&info->mod_clks[i], info, priv);
 
-       error = of_clk_add_provider(np, cpg_mssr_clk_src_twocell_get, priv);
-       if (error)
-               return error;
-
        error = devm_add_action_or_reset(dev,
                                         cpg_mssr_del_clk_provider,
                                         np);
@@ -883,6 +1010,10 @@ static int __init cpg_mssr_probe(struct platform_device *pdev)
        if (error)
                return error;
 
+       /* Reset Controller not supported for Standby Control SoCs */
+       if (info->stbyctrl)
+               return 0;
+
        error = cpg_mssr_reset_controller_register(priv);
        if (error)
                return error;
index 642f720b9b055337f554357be8904463d38bce4d..c4ec9df146fd990e90bb3b93b78e93c1d14e811c 100644 (file)
@@ -1,11 +1,8 @@
-/*
+/* SPDX-License-Identifier: GPL-2.0
+ *
  * Renesas Clock Pulse Generator / Module Standby and Software Reset
  *
  * Copyright (C) 2015 Glider bvba
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2 of the License.
  */
 
 #ifndef __CLK_RENESAS_CPG_MSSR_H__
@@ -38,6 +35,7 @@ enum clk_types {
        CLK_TYPE_FF,            /* Fixed Factor Clock */
        CLK_TYPE_DIV6P1,        /* DIV6 Clock with 1 parent clock */
        CLK_TYPE_DIV6_RO,       /* DIV6 Clock read only with extra divisor */
+       CLK_TYPE_FR,            /* Fixed Rate Clock */
 
        /* Custom definitions start here */
        CLK_TYPE_CUSTOM,
@@ -56,6 +54,8 @@ enum clk_types {
        DEF_BASE(_name, _id, CLK_TYPE_DIV6P1, _parent, .offset = _offset)
 #define DEF_DIV6_RO(_name, _id, _parent, _offset, _div)        \
        DEF_BASE(_name, _id, CLK_TYPE_DIV6_RO, _parent, .offset = _offset, .div = _div, .mult = 1)
+#define DEF_RATE(_name, _id, _rate)    \
+       DEF_TYPE(_name, _id, CLK_TYPE_FR, .mult = _rate)
 
     /*
      * Definitions of Module Clocks
@@ -75,12 +75,24 @@ struct mssr_mod_clk {
 #define DEF_MOD(_name, _mod, _parent...)       \
        { .name = _name, .id = MOD_CLK_ID(_mod), .parent = _parent }
 
+/* Convert from sparse base-10 to packed index space */
+#define MOD_CLK_PACK_10(x)     ((x / 10) * 32 + (x % 10))
+
+#define MOD_CLK_ID_10(x)       (MOD_CLK_BASE + MOD_CLK_PACK_10(x))
+
+#define DEF_MOD_STB(_name, _mod, _parent...)   \
+       { .name = _name, .id = MOD_CLK_ID_10(_mod), .parent = _parent }
 
 struct device_node;
 
     /**
      * SoC-specific CPG/MSSR Description
      *
+     * @early_core_clks: Array of Early Core Clock definitions
+     * @num_early_core_clks: Number of entries in early_core_clks[]
+     * @early_mod_clks: Array of Early Module Clock definitions
+     * @num_early_mod_clks: Number of entries in early_mod_clks[]
+     *
      * @core_clks: Array of Core Clock definitions
      * @num_core_clks: Number of entries in core_clks[]
      * @last_dt_core_clk: ID of the last Core Clock exported to DT
@@ -100,14 +112,25 @@ struct device_node;
      *
      * @init: Optional callback to perform SoC-specific initialization
      * @cpg_clk_register: Optional callback to handle special Core Clock types
+     *
+     * @stbyctrl: This device has Standby Control Registers which are 8-bits
+     *            wide, no status registers (MSTPSR) and have different address
+     *            offsets.
      */
 
 struct cpg_mssr_info {
+       /* Early Clocks */
+       const struct cpg_core_clk *early_core_clks;
+       unsigned int num_early_core_clks;
+       const struct mssr_mod_clk *early_mod_clks;
+       unsigned int num_early_mod_clks;
+
        /* Core Clocks */
        const struct cpg_core_clk *core_clks;
        unsigned int num_core_clks;
        unsigned int last_dt_core_clk;
        unsigned int num_total_core_clks;
+       bool stbyctrl;
 
        /* Module Clocks */
        const struct mssr_mod_clk *mod_clks;
@@ -131,9 +154,12 @@ struct cpg_mssr_info {
                                        struct raw_notifier_head *notifiers);
 };
 
+extern const struct cpg_mssr_info r7s9210_cpg_mssr_info;
 extern const struct cpg_mssr_info r8a7743_cpg_mssr_info;
 extern const struct cpg_mssr_info r8a7745_cpg_mssr_info;
 extern const struct cpg_mssr_info r8a77470_cpg_mssr_info;
+extern const struct cpg_mssr_info r8a774a1_cpg_mssr_info;
+extern const struct cpg_mssr_info r8a774c0_cpg_mssr_info;
 extern const struct cpg_mssr_info r8a7790_cpg_mssr_info;
 extern const struct cpg_mssr_info r8a7791_cpg_mssr_info;
 extern const struct cpg_mssr_info r8a7792_cpg_mssr_info;
@@ -146,6 +172,8 @@ extern const struct cpg_mssr_info r8a77980_cpg_mssr_info;
 extern const struct cpg_mssr_info r8a77990_cpg_mssr_info;
 extern const struct cpg_mssr_info r8a77995_cpg_mssr_info;
 
+void __init cpg_mssr_early_init(struct device_node *np,
+                               const struct cpg_mssr_info *info);
 
     /*
      * Helpers for fixing up clock tables depending on SoC revision
index a79d81985c4e0251a6049d5d09b89415d0354ba3..cfa000007622d63dc08d590594e03e390e037a01 100644 (file)
@@ -936,7 +936,7 @@ static void __init st_of_quadfs_setup(struct device_node *np,
        if (!clk_parent_name)
                return;
 
-       pll_name = kasprintf(GFP_KERNEL, "%s.pll", np->name);
+       pll_name = kasprintf(GFP_KERNEL, "%pOFn.pll", np);
        if (!pll_name)
                return;
 
index a27c264cc9b4fb34f2b2d6d8748336ad102e4841..fc0278a1acc7ac6219617f499c11eca1c5c395a5 100644 (file)
@@ -140,8 +140,8 @@ static void __init sun9i_a80_mod0_setup(struct device_node *node)
 
        reg = of_io_request_and_map(node, 0, of_node_full_name(node));
        if (IS_ERR(reg)) {
-               pr_err("Could not get registers for mod0-clk: %s\n",
-                      node->name);
+               pr_err("Could not get registers for mod0-clk: %pOFn\n",
+                      node);
                return;
        }
 
@@ -306,7 +306,7 @@ static void __init sunxi_mmc_setup(struct device_node *node,
 
        reg = of_io_request_and_map(node, 0, of_node_full_name(node));
        if (IS_ERR(reg)) {
-               pr_err("Couldn't map the %s clock registers\n", node->name);
+               pr_err("Couldn't map the %pOFn clock registers\n", node);
                return;
        }
 
index e9295c286d5d9017a110010a5c2102778824b104..7e21b2b10c946f92b9996160ce7d046fd754d426 100644 (file)
@@ -88,8 +88,8 @@ static void __init sun9i_a80_pll4_setup(struct device_node *node)
 
        reg = of_io_request_and_map(node, 0, of_node_full_name(node));
        if (IS_ERR(reg)) {
-               pr_err("Could not get registers for a80-pll4-clk: %s\n",
-                      node->name);
+               pr_err("Could not get registers for a80-pll4-clk: %pOFn\n",
+                      node);
                return;
        }
 
@@ -142,8 +142,8 @@ static void __init sun9i_a80_gt_setup(struct device_node *node)
 
        reg = of_io_request_and_map(node, 0, of_node_full_name(node));
        if (IS_ERR(reg)) {
-               pr_err("Could not get registers for a80-gt-clk: %s\n",
-                      node->name);
+               pr_err("Could not get registers for a80-gt-clk: %pOFn\n",
+                      node);
                return;
        }
 
@@ -197,8 +197,8 @@ static void __init sun9i_a80_ahb_setup(struct device_node *node)
 
        reg = of_io_request_and_map(node, 0, of_node_full_name(node));
        if (IS_ERR(reg)) {
-               pr_err("Could not get registers for a80-ahb-clk: %s\n",
-                      node->name);
+               pr_err("Could not get registers for a80-ahb-clk: %pOFn\n",
+                      node);
                return;
        }
 
@@ -223,8 +223,8 @@ static void __init sun9i_a80_apb0_setup(struct device_node *node)
 
        reg = of_io_request_and_map(node, 0, of_node_full_name(node));
        if (IS_ERR(reg)) {
-               pr_err("Could not get registers for a80-apb0-clk: %s\n",
-                      node->name);
+               pr_err("Could not get registers for a80-apb0-clk: %pOFn\n",
+                      node);
                return;
        }
 
@@ -280,8 +280,8 @@ static void __init sun9i_a80_apb1_setup(struct device_node *node)
 
        reg = of_io_request_and_map(node, 0, of_node_full_name(node));
        if (IS_ERR(reg)) {
-               pr_err("Could not get registers for a80-apb1-clk: %s\n",
-                      node->name);
+               pr_err("Could not get registers for a80-apb1-clk: %pOFn\n",
+                      node);
                return;
        }
 
index 012714d94b429bcca04b277aed39983a140b08d0..892c29030b7b26772aa7a58b2598faab5c7bc94e 100644 (file)
@@ -568,8 +568,8 @@ static struct clk * __init sunxi_factors_clk_setup(struct device_node *node,
 
        reg = of_iomap(node, 0);
        if (!reg) {
-               pr_err("Could not get registers for factors-clk: %s\n",
-                      node->name);
+               pr_err("Could not get registers for factors-clk: %pOFn\n",
+                      node);
                return NULL;
        }
 
index 61c126a5d26ad88aacc4491c73f85248fe2d2f4f..222f68bc3f2ae5149d188ac683c36396750a7191 100644 (file)
@@ -143,8 +143,8 @@ static void __init omap_clk_register_apll(void *user,
 
        clk = of_clk_get(node, 0);
        if (IS_ERR(clk)) {
-               pr_debug("clk-ref for %s not ready, retry\n",
-                        node->name);
+               pr_debug("clk-ref for %pOFn not ready, retry\n",
+                        node);
                if (!ti_clk_retry_init(node, hw, omap_clk_register_apll))
                        return;
 
@@ -155,8 +155,8 @@ static void __init omap_clk_register_apll(void *user,
 
        clk = of_clk_get(node, 1);
        if (IS_ERR(clk)) {
-               pr_debug("clk-bypass for %s not ready, retry\n",
-                        node->name);
+               pr_debug("clk-bypass for %pOFn not ready, retry\n",
+                        node);
                if (!ti_clk_retry_init(node, hw, omap_clk_register_apll))
                        return;
 
@@ -202,7 +202,7 @@ static void __init of_dra7_apll_setup(struct device_node *node)
 
        init->num_parents = of_clk_get_parent_count(node);
        if (init->num_parents < 1) {
-               pr_err("dra7 apll %s must have parent(s)\n", node->name);
+               pr_err("dra7 apll %pOFn must have parent(s)\n", node);
                goto cleanup;
        }
 
@@ -366,7 +366,7 @@ static void __init of_omap2_apll_setup(struct device_node *node)
 
        init->num_parents = of_clk_get_parent_count(node);
        if (init->num_parents != 1) {
-               pr_err("%s must have one parent\n", node->name);
+               pr_err("%pOFn must have one parent\n", node);
                goto cleanup;
        }
 
@@ -374,13 +374,13 @@ static void __init of_omap2_apll_setup(struct device_node *node)
        init->parent_names = &parent_name;
 
        if (of_property_read_u32(node, "ti,clock-frequency", &val)) {
-               pr_err("%s missing clock-frequency\n", node->name);
+               pr_err("%pOFn missing clock-frequency\n", node);
                goto cleanup;
        }
        clk_hw->fixed_rate = val;
 
        if (of_property_read_u32(node, "ti,bit-shift", &val)) {
-               pr_err("%s missing bit-shift\n", node->name);
+               pr_err("%pOFn missing bit-shift\n", node);
                goto cleanup;
        }
 
@@ -389,7 +389,7 @@ static void __init of_omap2_apll_setup(struct device_node *node)
        ad->autoidle_mask = 0x3 << val;
 
        if (of_property_read_u32(node, "ti,idlest-shift", &val)) {
-               pr_err("%s missing idlest-shift\n", node->name);
+               pr_err("%pOFn missing idlest-shift\n", node);
                goto cleanup;
        }
 
index 14881547043130d1e686055387a6276e49fd11f9..a01ca9395179a77c9f0c620e5389fe98b1d0fba3 100644 (file)
@@ -190,8 +190,8 @@ static void __init of_dra7_atl_clock_setup(struct device_node *node)
        init.num_parents = of_clk_get_parent_count(node);
 
        if (init.num_parents != 1) {
-               pr_err("%s: atl clock %s must have 1 parent\n", __func__,
-                      node->name);
+               pr_err("%s: atl clock %pOFn must have 1 parent\n", __func__,
+                      node);
                goto cleanup;
        }
 
index 7d22e1af224770d7084cd7d8ec29e24d3f87368f..33001a75d90cf10f51d91f1dd8ad27c2ec173f6c 100644 (file)
@@ -129,7 +129,7 @@ int ti_clk_setup_ll_ops(struct ti_clk_ll_ops *ops)
 void __init ti_dt_clocks_register(struct ti_dt_clk oclks[])
 {
        struct ti_dt_clk *c;
-       struct device_node *node;
+       struct device_node *node, *parent;
        struct clk *clk;
        struct of_phandle_args clkspec;
        char buf[64];
@@ -164,8 +164,12 @@ void __init ti_dt_clocks_register(struct ti_dt_clk oclks[])
                        continue;
 
                node = of_find_node_by_name(NULL, buf);
-               if (num_args)
-                       node = of_find_node_by_name(node, "clk");
+               if (num_args) {
+                       parent = node;
+                       node = of_get_child_by_name(parent, "clk");
+                       of_node_put(parent);
+               }
+
                clkspec.np = node;
                clkspec.args_count = num_args;
                for (i = 0; i < num_args; i++) {
@@ -173,11 +177,12 @@ void __init ti_dt_clocks_register(struct ti_dt_clk oclks[])
                        if (ret) {
                                pr_warn("Bad tag in %s at %d: %s\n",
                                        c->node_name, i, tags[i]);
+                               of_node_put(node);
                                return;
                        }
                }
                clk = of_clk_get_from_provider(&clkspec);
-
+               of_node_put(node);
                if (!IS_ERR(clk)) {
                        c->lk.clk = clk;
                        clkdev_add(&c->lk);
@@ -223,7 +228,7 @@ int __init ti_clk_retry_init(struct device_node *node, void *user,
 {
        struct clk_init_item *retry;
 
-       pr_debug("%s: adding to retry list...\n", node->name);
+       pr_debug("%pOFn: adding to retry list...\n", node);
        retry = kzalloc(sizeof(*retry), GFP_KERNEL);
        if (!retry)
                return -ENOMEM;
@@ -258,14 +263,14 @@ int ti_clk_get_reg_addr(struct device_node *node, int index,
        }
 
        if (i == CLK_MAX_MEMMAPS) {
-               pr_err("clk-provider not found for %s!\n", node->name);
+               pr_err("clk-provider not found for %pOFn!\n", node);
                return -ENOENT;
        }
 
        reg->index = i;
 
        if (of_property_read_u32_index(node, "reg", index, &val)) {
-               pr_err("%s must have reg[%d]!\n", node->name, index);
+               pr_err("%pOFn must have reg[%d]!\n", node, index);
                return -EINVAL;
        }
 
@@ -312,7 +317,7 @@ int __init omap2_clk_provider_init(struct device_node *parent, int index,
        /* get clocks for this parent */
        clocks = of_get_child_by_name(parent, "clocks");
        if (!clocks) {
-               pr_err("%s missing 'clocks' child node.\n", parent->name);
+               pr_err("%pOFn missing 'clocks' child node.\n", parent);
                return -EINVAL;
        }
 
@@ -365,7 +370,7 @@ void ti_dt_clk_init_retry_clks(void)
 
        while (!list_empty(&retry_list) && retries) {
                list_for_each_entry_safe(retry, tmp, &retry_list, link) {
-                       pr_debug("retry-init: %s\n", retry->node->name);
+                       pr_debug("retry-init: %pOFn\n", retry->node);
                        retry->func(retry->user, retry->node);
                        list_del(&retry->link);
                        kfree(retry);
index 421b0539222058354d94ae6c29347d03b02ddd93..240e911a3db9ef6a0b1525beaf07bcb4e595cf49 100644 (file)
@@ -259,8 +259,8 @@ _ti_clkctrl_clk_register(struct omap_clkctrl_provider *provider,
        struct omap_clkctrl_clk *clkctrl_clk;
        int ret = 0;
 
-       init.name = kasprintf(GFP_KERNEL, "%s:%s:%04x:%d", node->parent->name,
-                             node->name, offset, bit);
+       init.name = kasprintf(GFP_KERNEL, "%pOFn:%pOFn:%04x:%d", node->parent,
+                             node, offset, bit);
        clkctrl_clk = kzalloc(sizeof(*clkctrl_clk), GFP_KERNEL);
        if (!init.name || !clkctrl_clk) {
                ret = -ENOMEM;
@@ -492,8 +492,7 @@ static void __init _ti_omap4_clkctrl_setup(struct device_node *node)
 
        provider->base = of_iomap(node, 0);
 
-       provider->clkdm_name = kmalloc(strlen(node->parent->name) + 3,
-                                      GFP_KERNEL);
+       provider->clkdm_name = kasprintf(GFP_KERNEL, "%pOFnxxx", node->parent);
        if (!provider->clkdm_name) {
                kfree(provider);
                return;
@@ -503,8 +502,7 @@ static void __init _ti_omap4_clkctrl_setup(struct device_node *node)
         * Create default clkdm name, replace _cm from end of parent node
         * name with _clkdm
         */
-       strcpy(provider->clkdm_name, node->parent->name);
-       provider->clkdm_name[strlen(provider->clkdm_name) - 2] = 0;
+       provider->clkdm_name[strlen(provider->clkdm_name) - 5] = 0;
        strcat(provider->clkdm_name, "clkdm");
 
        INIT_LIST_HEAD(&provider->clocks);
@@ -539,8 +537,8 @@ static void __init _ti_omap4_clkctrl_setup(struct device_node *node)
                init.flags = 0;
                if (reg_data->flags & CLKF_SET_RATE_PARENT)
                        init.flags |= CLK_SET_RATE_PARENT;
-               init.name = kasprintf(GFP_KERNEL, "%s:%s:%04x:%d",
-                                     node->parent->name, node->name,
+               init.name = kasprintf(GFP_KERNEL, "%pOFn:%pOFn:%04x:%d",
+                                     node->parent, node,
                                      reg_data->offset, 0);
                clkctrl_clk = kzalloc(sizeof(*clkctrl_clk), GFP_KERNEL);
                if (!init.name || !clkctrl_clk)
index 030e8b2c10500cde5f8805d5674140ded9a17b12..6a89936ba03afe26578a7494275e0c723dad69d4 100644 (file)
@@ -135,8 +135,8 @@ static void __init _register_composite(void *user,
 
                comp = _lookup_component(cclk->comp_nodes[i]);
                if (!comp) {
-                       pr_debug("component %s not ready for %s, retry\n",
-                                cclk->comp_nodes[i]->name, node->name);
+                       pr_debug("component %s not ready for %pOFn, retry\n",
+                                cclk->comp_nodes[i]->name, node);
                        if (!ti_clk_retry_init(node, hw,
                                               _register_composite))
                                return;
@@ -144,8 +144,8 @@ static void __init _register_composite(void *user,
                        goto cleanup;
                }
                if (cclk->comp_clks[comp->type] != NULL) {
-                       pr_err("duplicate component types for %s (%s)!\n",
-                              node->name, component_clk_types[comp->type]);
+                       pr_err("duplicate component types for %pOFn (%s)!\n",
+                              node, component_clk_types[comp->type]);
                        goto cleanup;
                }
 
@@ -168,7 +168,7 @@ static void __init _register_composite(void *user,
        }
 
        if (!num_parents) {
-               pr_err("%s: no parents found for %s!\n", __func__, node->name);
+               pr_err("%s: no parents found for %pOFn!\n", __func__, node);
                goto cleanup;
        }
 
@@ -212,7 +212,7 @@ static void __init of_ti_composite_clk_setup(struct device_node *node)
        num_clks = of_clk_get_parent_count(node);
 
        if (!num_clks) {
-               pr_err("composite clk %s must have component(s)\n", node->name);
+               pr_err("composite clk %pOFn must have component(s)\n", node);
                return;
        }
 
@@ -248,7 +248,7 @@ int __init ti_clk_add_component(struct device_node *node, struct clk_hw *hw,
        num_parents = of_clk_get_parent_count(node);
 
        if (!num_parents) {
-               pr_err("component-clock %s must have parent(s)\n", node->name);
+               pr_err("component-clock %pOFn must have parent(s)\n", node);
                return -EINVAL;
        }
 
index ccfb4d9a152aea55c3e414dc26d2ddd3ce792ee4..4fcb337a6d1ccd2bdcf417c097973b308b7531de 100644 (file)
@@ -492,7 +492,7 @@ __init ti_clk_get_div_table(struct device_node *node)
        }
 
        if (!valid_div) {
-               pr_err("no valid dividers for %s table\n", node->name);
+               pr_err("no valid dividers for %pOFn table\n", node);
                return ERR_PTR(-EINVAL);
        }
 
@@ -530,7 +530,7 @@ static int _get_divider_width(struct device_node *node,
                        min_div = 1;
 
                if (of_property_read_u32(node, "ti,max-div", &max_div)) {
-                       pr_err("no max-div for %s!\n", node->name);
+                       pr_err("no max-div for %pOFn!\n", node);
                        return -EINVAL;
                }
 
index dc86d07d09211e35a6b9bf9338381ac2f4ef9183..2e80c5ead74a2e944f751415b5013a7b77e36b50 100644 (file)
@@ -162,8 +162,8 @@ static void __init _register_dpll(void *user,
 
        clk = of_clk_get(node, 0);
        if (IS_ERR(clk)) {
-               pr_debug("clk-ref missing for %s, retry later\n",
-                        node->name);
+               pr_debug("clk-ref missing for %pOFn, retry later\n",
+                        node);
                if (!ti_clk_retry_init(node, hw, _register_dpll))
                        return;
 
@@ -175,8 +175,8 @@ static void __init _register_dpll(void *user,
        clk = of_clk_get(node, 1);
 
        if (IS_ERR(clk)) {
-               pr_debug("clk-bypass missing for %s, retry later\n",
-                        node->name);
+               pr_debug("clk-bypass missing for %pOFn, retry later\n",
+                        node);
                if (!ti_clk_retry_init(node, hw, _register_dpll))
                        return;
 
@@ -226,7 +226,7 @@ static void _register_dpll_x2(struct device_node *node,
 
        parent_name = of_clk_get_parent_name(node, 0);
        if (!parent_name) {
-               pr_err("%s must have parent\n", node->name);
+               pr_err("%pOFn must have parent\n", node);
                return;
        }
 
@@ -305,7 +305,7 @@ static void __init of_ti_dpll_setup(struct device_node *node,
 
        init->num_parents = of_clk_get_parent_count(node);
        if (!init->num_parents) {
-               pr_err("%s must have parent(s)\n", node->name);
+               pr_err("%pOFn must have parent(s)\n", node);
                goto cleanup;
        }
 
index 071af44b1ba856d28ec4438f3373bc3ab9750475..ed24f20f63c73f4da764d3a3ec97a8079e3dd9d5 100644 (file)
@@ -555,7 +555,7 @@ static void __init ti_fapll_setup(struct device_node *node)
 
        init->num_parents = of_clk_get_parent_count(node);
        if (init->num_parents != 2) {
-               pr_err("%s must have two parents\n", node->name);
+               pr_err("%pOFn must have two parents\n", node);
                goto free;
        }
 
@@ -564,19 +564,19 @@ static void __init ti_fapll_setup(struct device_node *node)
 
        fd->clk_ref = of_clk_get(node, 0);
        if (IS_ERR(fd->clk_ref)) {
-               pr_err("%s could not get clk_ref\n", node->name);
+               pr_err("%pOFn could not get clk_ref\n", node);
                goto free;
        }
 
        fd->clk_bypass = of_clk_get(node, 1);
        if (IS_ERR(fd->clk_bypass)) {
-               pr_err("%s could not get clk_bypass\n", node->name);
+               pr_err("%pOFn could not get clk_bypass\n", node);
                goto free;
        }
 
        fd->base = of_iomap(node, 0);
        if (!fd->base) {
-               pr_err("%s could not get IO base\n", node->name);
+               pr_err("%pOFn could not get IO base\n", node);
                goto free;
        }
 
index 0174a51a4ba6c11dfa4cec9b2a57bc44e156ef67..7cbe896db07166532886c9b7613acc79f3efa068 100644 (file)
@@ -42,12 +42,12 @@ static void __init of_ti_fixed_factor_clk_setup(struct device_node *node)
        u32 flags = 0;
 
        if (of_property_read_u32(node, "ti,clock-div", &div)) {
-               pr_err("%s must have a clock-div property\n", node->name);
+               pr_err("%pOFn must have a clock-div property\n", node);
                return;
        }
 
        if (of_property_read_u32(node, "ti,clock-mult", &mult)) {
-               pr_err("%s must have a clock-mult property\n", node->name);
+               pr_err("%pOFn must have a clock-mult property\n", node);
                return;
        }
 
index 935b2de5fb88702af4f6caf045b03cd7c355e7ec..d4b5638e8b99c883b42bcbcc59325003eb830d62 100644 (file)
@@ -179,7 +179,7 @@ static void __init _of_ti_gate_clk_setup(struct device_node *node,
        }
 
        if (of_clk_get_parent_count(node) != 1) {
-               pr_err("%s must have 1 parent\n", node->name);
+               pr_err("%pOFn must have 1 parent\n", node);
                return;
        }
 
index 41ae7021670ea0179f43ef194be4bb73ed1fff33..87e00c2ee957d9dab2a6bd646f36b8c21040c358 100644 (file)
@@ -84,7 +84,7 @@ static void __init _of_ti_interface_clk_setup(struct device_node *node,
 
        parent_name = of_clk_get_parent_name(node, 0);
        if (!parent_name) {
-               pr_err("%s must have a parent\n", node->name);
+               pr_err("%pOFn must have a parent\n", node);
                return;
        }
 
index 69a4308a5a983b9e027eb8610ac5da53c8b15cec..18be7eb51546a81145cc5b9c27e037bb8fe60535 100644 (file)
@@ -186,7 +186,7 @@ static void of_mux_clk_setup(struct device_node *node)
 
        num_parents = of_clk_get_parent_count(node);
        if (num_parents < 2) {
-               pr_err("mux-clock %s must have parents\n", node->name);
+               pr_err("mux-clock %pOFn must have parents\n", node);
                return;
        }
        parent_names = kzalloc((sizeof(char *) * num_parents), GFP_KERNEL);
@@ -278,7 +278,7 @@ static void __init of_ti_composite_mux_clk_setup(struct device_node *node)
        num_parents = of_clk_get_parent_count(node);
 
        if (num_parents < 2) {
-               pr_err("%s must have parents\n", node->name);
+               pr_err("%pOFn must have parents\n", node);
                goto cleanup;
        }
 
index 88a2cab37f627b86bebe9512ffee9db720b327e1..d7b53ac8ad11520101c11823fd44c0b9eaec178f 100644 (file)
@@ -602,7 +602,7 @@ void __init zynq_clock_init(void)
        }
 
        if (of_address_to_resource(np, 0, &res)) {
-               pr_err("%s: failed to get resource\n", np->name);
+               pr_err("%pOFn: failed to get resource\n", np);
                goto np_err;
        }
 
@@ -611,7 +611,7 @@ void __init zynq_clock_init(void)
        if (slcr->data) {
                zynq_clkc_base = (__force void __iomem *)slcr->data + res.start;
        } else {
-               pr_err("%s: Unable to get I/O memory\n", np->name);
+               pr_err("%pOFn: Unable to get I/O memory\n", np);
                of_node_put(slcr);
                goto np_err;
        }
index 7b28b09058699a31b2c6441189fc222667680c79..af8261dcace1dc9e58d78b92bd58529ddf959daf 100644 (file)
@@ -1,10 +1,7 @@
+/* SPDX-License-Identifier: GPL-2.0 */
 /*
  * Copyright (C) 2014 Google, Inc
  *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
  * Device Tree binding constants clocks for the Maxim 77686 PMIC.
  */
 
index 997312edcbb5b059375f1c31e745bb66568411ed..51adcbaed697ad3cc564545439f803d1fbd956e0 100644 (file)
@@ -1,10 +1,7 @@
+/* SPDX-License-Identifier: GPL-2.0 */
 /*
  * Copyright (C) 2014 Google, Inc
  *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
  * Device Tree binding constants clocks for the Maxim 77802 PMIC.
  */
 
index 75b07cf5eed0f9a2941f0367af601b77c0bd1599..db80f2ee571b22fdbf77b9fa8a2477fc7747d528 100644 (file)
 #define GCC_RX1_USB2_CLKREF_CLK                                        218
 #define GCC_HLOS1_VOTE_LPASS_CORE_SMMU_CLK                     219
 #define GCC_HLOS1_VOTE_LPASS_ADSP_SMMU_CLK                     220
+#define GCC_EDP_CLKREF_CLK                                     221
+#define GCC_MSS_CFG_AHB_CLK                                    222
+#define GCC_MSS_Q6_BIMC_AXI_CLK                                        223
+#define GCC_MSS_SNOC_AXI_CLK                                   224
+#define GCC_MSS_MNOC_BIMC_AXI_CLK                              225
+#define GCC_DCC_AHB_CLK                                                226
+#define GCC_AGGRE0_NOC_MPU_CFG_AHB_CLK                         227
+#define GCC_MMSS_GPLL0_DIV_CLK                                 228
+#define GCC_MSS_GPLL0_DIV_CLK                                  229
 
 #define GCC_SYSTEM_NOC_BCR                                     0
 #define GCC_CONFIG_NOC_BCR                                     1
index f96fc2dbf60e0dd74b03b1b8d48394e2fd957b52..b8eae5a76503079b18374348cfdcd1992f84479e 100644 (file)
 #define GPLL4                                                  184
 #define GCC_CPUSS_DVM_BUS_CLK                                  185
 #define GCC_CPUSS_GNOC_CLK                                     186
+#define GCC_QSPI_CORE_CLK_SRC                                  187
+#define GCC_QSPI_CORE_CLK                                      188
+#define GCC_QSPI_CNOC_PERIPH_AHB_CLK                           189
 
 /* GCC Resets */
 #define GCC_MMSS_BCR                                           0
index 0dcb3e87d44c121ec55b8614cee46fae6b1417d7..a267ac25014355493fa29b5830824c5a5982884c 100644 (file)
@@ -1,10 +1,7 @@
-/*
+/* SPDX-License-Identifier: GPL-2.0
+ *
  * Copyright (C) 2014 Renesas Solutions Corp.
  * Copyright (C) 2014 Wolfram Sang, Sang Engineering <wsa@sang-engineering.com>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2 of the License.
  */
 
 #ifndef __DT_BINDINGS_CLOCK_R7S72100_H__
diff --git a/include/dt-bindings/clock/r7s9210-cpg-mssr.h b/include/dt-bindings/clock/r7s9210-cpg-mssr.h
new file mode 100644 (file)
index 0000000..b6f85ca
--- /dev/null
@@ -0,0 +1,20 @@
+/* SPDX-License-Identifier: GPL-2.0
+ *
+ * Copyright (C) 2018 Renesas Electronics Corp.
+ *
+ */
+
+#ifndef __DT_BINDINGS_CLOCK_R7S9210_CPG_MSSR_H__
+#define __DT_BINDINGS_CLOCK_R7S9210_CPG_MSSR_H__
+
+#include <dt-bindings/clock/renesas-cpg-mssr.h>
+
+/* R7S9210 CPG Core Clocks */
+#define R7S9210_CLK_I                  0
+#define R7S9210_CLK_G                  1
+#define R7S9210_CLK_B                  2
+#define R7S9210_CLK_P1                 3
+#define R7S9210_CLK_P1C                        4
+#define R7S9210_CLK_P0                 5
+
+#endif /* __DT_BINDINGS_CLOCK_R7S9210_CPG_MSSR_H__ */
index e1d1f3c6a99ea95c72bd3500cead514aef40d3f8..3ba936029d9fbaee5a3180d7855c368d73944c72 100644 (file)
@@ -1,10 +1,6 @@
-/*
- * Copyright (C) 2016 Cogent Embedded Inc.
+/* SPDX-License-Identifier: GPL-2.0+
  *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
+ * Copyright (C) 2016 Cogent Embedded Inc.
  */
 #ifndef __DT_BINDINGS_CLOCK_R8A7743_CPG_MSSR_H__
 #define __DT_BINDINGS_CLOCK_R8A7743_CPG_MSSR_H__
diff --git a/include/dt-bindings/clock/r8a7744-cpg-mssr.h b/include/dt-bindings/clock/r8a7744-cpg-mssr.h
new file mode 100644 (file)
index 0000000..2690be0
--- /dev/null
@@ -0,0 +1,39 @@
+/* SPDX-License-Identifier: GPL-2.0
+ *
+ * Copyright (C) 2018 Renesas Electronics Corp.
+ */
+#ifndef __DT_BINDINGS_CLOCK_R8A7744_CPG_MSSR_H__
+#define __DT_BINDINGS_CLOCK_R8A7744_CPG_MSSR_H__
+
+#include <dt-bindings/clock/renesas-cpg-mssr.h>
+
+/* r8a7744 CPG Core Clocks */
+#define R8A7744_CLK_Z          0
+#define R8A7744_CLK_ZG         1
+#define R8A7744_CLK_ZTR                2
+#define R8A7744_CLK_ZTRD2      3
+#define R8A7744_CLK_ZT         4
+#define R8A7744_CLK_ZX         5
+#define R8A7744_CLK_ZS         6
+#define R8A7744_CLK_HP         7
+#define R8A7744_CLK_B          9
+#define R8A7744_CLK_LB         10
+#define R8A7744_CLK_P          11
+#define R8A7744_CLK_CL         12
+#define R8A7744_CLK_M2         13
+#define R8A7744_CLK_ZB3                15
+#define R8A7744_CLK_ZB3D2      16
+#define R8A7744_CLK_DDR                17
+#define R8A7744_CLK_SDH                18
+#define R8A7744_CLK_SD0                19
+#define R8A7744_CLK_SD2                20
+#define R8A7744_CLK_SD3                21
+#define R8A7744_CLK_MMC0       22
+#define R8A7744_CLK_MP         23
+#define R8A7744_CLK_QSPI       26
+#define R8A7744_CLK_CP         27
+#define R8A7744_CLK_RCAN       28
+#define R8A7744_CLK_R          29
+#define R8A7744_CLK_OSC                30
+
+#endif /* __DT_BINDINGS_CLOCK_R8A7744_CPG_MSSR_H__ */
index 56ad6f0c67606d74bd99098a6ed5d401d5799c39..f81066c9d19234b7c439708cdc38c30c4d4a26f4 100644 (file)
@@ -1,10 +1,6 @@
-/*
- * Copyright (C) 2016 Cogent Embedded Inc.
+/* SPDX-License-Identifier: GPL-2.0+
  *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
+ * Copyright (C) 2016 Cogent Embedded Inc.
  */
 #ifndef __DT_BINDINGS_CLOCK_R8A7745_CPG_MSSR_H__
 #define __DT_BINDINGS_CLOCK_R8A7745_CPG_MSSR_H__
diff --git a/include/dt-bindings/clock/r8a774a1-cpg-mssr.h b/include/dt-bindings/clock/r8a774a1-cpg-mssr.h
new file mode 100644 (file)
index 0000000..9bc5d45
--- /dev/null
@@ -0,0 +1,58 @@
+/* SPDX-License-Identifier: GPL-2.0
+ *
+ * Copyright (C) 2018 Renesas Electronics Corp.
+ */
+#ifndef __DT_BINDINGS_CLOCK_R8A774A1_CPG_MSSR_H__
+#define __DT_BINDINGS_CLOCK_R8A774A1_CPG_MSSR_H__
+
+#include <dt-bindings/clock/renesas-cpg-mssr.h>
+
+/* r8a774a1 CPG Core Clocks */
+#define R8A774A1_CLK_Z                 0
+#define R8A774A1_CLK_Z2                        1
+#define R8A774A1_CLK_ZG                        2
+#define R8A774A1_CLK_ZTR               3
+#define R8A774A1_CLK_ZTRD2             4
+#define R8A774A1_CLK_ZT                        5
+#define R8A774A1_CLK_ZX                        6
+#define R8A774A1_CLK_S0D1              7
+#define R8A774A1_CLK_S0D2              8
+#define R8A774A1_CLK_S0D3              9
+#define R8A774A1_CLK_S0D4              10
+#define R8A774A1_CLK_S0D6              11
+#define R8A774A1_CLK_S0D8              12
+#define R8A774A1_CLK_S0D12             13
+#define R8A774A1_CLK_S1D2              14
+#define R8A774A1_CLK_S1D4              15
+#define R8A774A1_CLK_S2D1              16
+#define R8A774A1_CLK_S2D2              17
+#define R8A774A1_CLK_S2D4              18
+#define R8A774A1_CLK_S3D1              19
+#define R8A774A1_CLK_S3D2              20
+#define R8A774A1_CLK_S3D4              21
+#define R8A774A1_CLK_LB                        22
+#define R8A774A1_CLK_CL                        23
+#define R8A774A1_CLK_ZB3               24
+#define R8A774A1_CLK_ZB3D2             25
+#define R8A774A1_CLK_ZB3D4             26
+#define R8A774A1_CLK_CR                        27
+#define R8A774A1_CLK_CRD2              28
+#define R8A774A1_CLK_SD0H              29
+#define R8A774A1_CLK_SD0               30
+#define R8A774A1_CLK_SD1H              31
+#define R8A774A1_CLK_SD1               32
+#define R8A774A1_CLK_SD2H              33
+#define R8A774A1_CLK_SD2               34
+#define R8A774A1_CLK_SD3H              35
+#define R8A774A1_CLK_SD3               36
+#define R8A774A1_CLK_RPC               37
+#define R8A774A1_CLK_RPCD2             38
+#define R8A774A1_CLK_MSO               39
+#define R8A774A1_CLK_HDMI              40
+#define R8A774A1_CLK_CSI0              41
+#define R8A774A1_CLK_CP                        42
+#define R8A774A1_CLK_CPEX              43
+#define R8A774A1_CLK_R                 44
+#define R8A774A1_CLK_OSC               45
+
+#endif /* __DT_BINDINGS_CLOCK_R8A774A1_CPG_MSSR_H__ */
diff --git a/include/dt-bindings/clock/r8a774c0-cpg-mssr.h b/include/dt-bindings/clock/r8a774c0-cpg-mssr.h
new file mode 100644 (file)
index 0000000..8fe51b6
--- /dev/null
@@ -0,0 +1,60 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * Copyright (C) 2018 Renesas Electronics Corp.
+ */
+#ifndef __DT_BINDINGS_CLOCK_R8A774C0_CPG_MSSR_H__
+#define __DT_BINDINGS_CLOCK_R8A774C0_CPG_MSSR_H__
+
+#include <dt-bindings/clock/renesas-cpg-mssr.h>
+
+/* r8a774c0 CPG Core Clocks */
+#define R8A774C0_CLK_Z2                        0
+#define R8A774C0_CLK_ZG                        1
+#define R8A774C0_CLK_ZTR               2
+#define R8A774C0_CLK_ZT                        3
+#define R8A774C0_CLK_ZX                        4
+#define R8A774C0_CLK_S0D1              5
+#define R8A774C0_CLK_S0D3              6
+#define R8A774C0_CLK_S0D6              7
+#define R8A774C0_CLK_S0D12             8
+#define R8A774C0_CLK_S0D24             9
+#define R8A774C0_CLK_S1D1              10
+#define R8A774C0_CLK_S1D2              11
+#define R8A774C0_CLK_S1D4              12
+#define R8A774C0_CLK_S2D1              13
+#define R8A774C0_CLK_S2D2              14
+#define R8A774C0_CLK_S2D4              15
+#define R8A774C0_CLK_S3D1              16
+#define R8A774C0_CLK_S3D2              17
+#define R8A774C0_CLK_S3D4              18
+#define R8A774C0_CLK_S0D6C             19
+#define R8A774C0_CLK_S3D1C             20
+#define R8A774C0_CLK_S3D2C             21
+#define R8A774C0_CLK_S3D4C             22
+#define R8A774C0_CLK_LB                        23
+#define R8A774C0_CLK_CL                        24
+#define R8A774C0_CLK_ZB3               25
+#define R8A774C0_CLK_ZB3D2             26
+#define R8A774C0_CLK_CR                        27
+#define R8A774C0_CLK_CRD2              28
+#define R8A774C0_CLK_SD0H              29
+#define R8A774C0_CLK_SD0               30
+#define R8A774C0_CLK_SD1H              31
+#define R8A774C0_CLK_SD1               32
+#define R8A774C0_CLK_SD3H              33
+#define R8A774C0_CLK_SD3               34
+#define R8A774C0_CLK_RPC               35
+#define R8A774C0_CLK_RPCD2             36
+#define R8A774C0_CLK_ZA2               37
+#define R8A774C0_CLK_ZA8               38
+#define R8A774C0_CLK_Z2D               39
+#define R8A774C0_CLK_MSO               40
+#define R8A774C0_CLK_R                 41
+#define R8A774C0_CLK_OSC               42
+#define R8A774C0_CLK_LV0               43
+#define R8A774C0_CLK_LV1               44
+#define R8A774C0_CLK_CSI0              45
+#define R8A774C0_CLK_CP                        46
+#define R8A774C0_CLK_CPEX              47
+
+#endif /* __DT_BINDINGS_CLOCK_R8A774C0_CPG_MSSR_H__ */
index 1625b8bf34822b6e8f41f1dbdead56c8ce13bff6..c5955b56b36d80876e7cf6cd037a3d018909f1ef 100644 (file)
@@ -1,10 +1,6 @@
-/*
- * Copyright (C) 2015 Renesas Electronics Corp.
+/* SPDX-License-Identifier: GPL-2.0+
  *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
+ * Copyright (C) 2015 Renesas Electronics Corp.
  */
 
 #ifndef __DT_BINDINGS_CLOCK_R8A7790_CPG_MSSR_H__
index e8823410c01c5a09d0676ddf547c1821b42cf619..aadd06c566c043e7e1909a3dc23fa70514022de1 100644 (file)
@@ -1,10 +1,6 @@
-/*
- * Copyright (C) 2015 Renesas Electronics Corp.
+/* SPDX-License-Identifier: GPL-2.0+
  *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
+ * Copyright (C) 2015 Renesas Electronics Corp.
  */
 
 #ifndef __DT_BINDINGS_CLOCK_R8A7791_CPG_MSSR_H__
index 72ce85cb2f94b0abb206145d9332dc14a47f738c..829c44db0271c27a95b788a740bd728a733bb41b 100644 (file)
@@ -1,10 +1,6 @@
-/*
- * Copyright (C) 2015 Renesas Electronics Corp.
+/* SPDX-License-Identifier: GPL-2.0+
  *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
+ * Copyright (C) 2015 Renesas Electronics Corp.
  */
 
 #ifndef __DT_BINDINGS_CLOCK_R8A7792_CPG_MSSR_H__
index 7318d45d4e7e9888c41aa1fb66def087b4cb6ff4..49c66d8ed1782fc06d06000f6af96c8a2b464262 100644 (file)
@@ -1,16 +1,8 @@
-/*
+/* SPDX-License-Identifier: GPL-2.0
+ *
  * r8a7793 clock definition
  *
  * Copyright (C) 2014  Renesas Electronics Corporation
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2 of the License.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
  */
 
 #ifndef __DT_BINDINGS_CLOCK_R8A7793_H__
index 8809b0f62d615457f07a463a3c4699d0276a0250..d1ff646c31f2355bf0e67d28c563a827a9df94a6 100644 (file)
@@ -1,10 +1,6 @@
-/*
- * Copyright (C) 2015 Renesas Electronics Corp.
+/* SPDX-License-Identifier: GPL-2.0+
  *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
+ * Copyright (C) 2015 Renesas Electronics Corp.
  */
 
 #ifndef __DT_BINDINGS_CLOCK_R8A7793_CPG_MSSR_H__
index 93e99c3ffc8dafebef94d0644cb15532c86ab1b4..649f005782d05213ae3760124e67e4913c5b419c 100644 (file)
@@ -1,11 +1,7 @@
-/*
+/* SPDX-License-Identifier: GPL-2.0+
+ *
  * Copyright (C) 2014 Renesas Electronics Corporation
  * Copyright 2013 Ideas On Board SPRL
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
  */
 
 #ifndef __DT_BINDINGS_CLOCK_R8A7794_H__
index 9d720311ae3a229a324febbeeaf698f0ec977c5c..6314e23b51af5be9a019a89ac2791c03bf69c57a 100644 (file)
@@ -1,10 +1,6 @@
-/*
- * Copyright (C) 2015 Renesas Electronics Corp.
+/* SPDX-License-Identifier: GPL-2.0+
  *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
+ * Copyright (C) 2015 Renesas Electronics Corp.
  */
 
 #ifndef __DT_BINDINGS_CLOCK_R8A7794_CPG_MSSR_H__
index f047eaf261f34ac783b2187997894daffe552572..9483896415654706de2f8820c327fc4512ffa81f 100644 (file)
@@ -1,10 +1,6 @@
-/*
- * Copyright (C) 2015 Renesas Electronics Corp.
+/* SPDX-License-Identifier: GPL-2.0+
  *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
+ * Copyright (C) 2015 Renesas Electronics Corp.
  */
 #ifndef __DT_BINDINGS_CLOCK_R8A7795_CPG_MSSR_H__
 #define __DT_BINDINGS_CLOCK_R8A7795_CPG_MSSR_H__
index 1e5942695f0dd057e0e3976824e0205b357eb6b9..e6087f2f7e3aff4adcb4bf7ec6c949242e68d44a 100644 (file)
@@ -1,10 +1,6 @@
-/*
- * Copyright (C) 2016 Renesas Electronics Corp.
+/* SPDX-License-Identifier: GPL-2.0+
  *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
+ * Copyright (C) 2016 Renesas Electronics Corp.
  */
 #ifndef __DT_BINDINGS_CLOCK_R8A7796_CPG_MSSR_H__
 #define __DT_BINDINGS_CLOCK_R8A7796_CPG_MSSR_H__
index 4146395595b10bda7a255d7c309ec17b29dc552b..6145ebe66361574256e630e2d2711b6007399b59 100644 (file)
@@ -1,11 +1,7 @@
-/*
+/* SPDX-License-Identifier: GPL-2.0+
+ *
  * Copyright (C) 2016 Renesas Electronics Corp.
  * Copyright (C) 2017 Cogent Embedded, Inc.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
  */
 #ifndef __DT_BINDINGS_CLOCK_R8A77970_CPG_MSSR_H__
 #define __DT_BINDINGS_CLOCK_R8A77970_CPG_MSSR_H__
index 4e8ae3dee5901b01374e6fd609e7e988d4107676..1eb11acfa563dbd81056d997d8cf0df2d3637d50 100644 (file)
@@ -1,10 +1,6 @@
-/*
- * Copyright (C) 2017 Glider bvba
+/* SPDX-License-Identifier: GPL-2.0+
  *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
+ * Copyright (C) 2017 Glider bvba
  */
 #ifndef __DT_BINDINGS_CLOCK_R8A77995_CPG_MSSR_H__
 #define __DT_BINDINGS_CLOCK_R8A77995_CPG_MSSR_H__
index 569a3cc33ffb5bc7ed35cc2bd1948a8651d2e62a..8169ad063f0a03c760ea53ecf3bf5d7a5257577b 100644 (file)
@@ -1,10 +1,6 @@
-/*
- * Copyright (C) 2015 Renesas Electronics Corp.
+/* SPDX-License-Identifier: GPL-2.0+
  *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
+ * Copyright (C) 2015 Renesas Electronics Corp.
  */
 #ifndef __DT_BINDINGS_CLOCK_RENESAS_CPG_MSSR_H__
 #define __DT_BINDINGS_CLOCK_RENESAS_CPG_MSSR_H__
index b903d7de27c92e2fda9ca66b685c9fea953a372d..5ece35d429ffeb30f6e7cbf41951cf8e16e9a091 100644 (file)
@@ -1,10 +1,7 @@
+/* SPDX-License-Identifier: GPL-2.0 */
 /*
  * Copyright (C) 2015 Markus Reichl
  *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
  * Device Tree binding constants clocks for the Samsung S2MPS11 PMIC.
  */
 
index ad95c7f50090c749c32c7fe6f7936f179f240606..19d233f37e2fab7c6d5ee78953228200292e1036 100644 (file)
@@ -1,12 +1,9 @@
+/* SPDX-License-Identifier: GPL-2.0 */
 /*
  * Copyright (c) 2013 Tomasz Figa <tomasz.figa at gmail.com>
  *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
  * Device Tree binding constants for Samsung S3C64xx clock controller.
-*/
+ */
 
 #ifndef _DT_BINDINGS_CLOCK_SAMSUNG_S3C64XX_CLOCK_H
 #define _DT_BINDINGS_CLOCK_SAMSUNG_S3C64XX_CLOCK_H
index 9ebf1f8243bb57af54b0d5adc3b22408c858d103..0ebbe2f0b45e785440dcc0f5962d86faf331f1fd 100644 (file)
@@ -1,14 +1,10 @@
-/*
+/* SPDX-License-Identifier: GPL-2.0+
+ *
  * Copyright 2013 Ideas On Board SPRL
  * Copyright 2013, 2014 Horms Solutions Ltd.
  *
  * Contact: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
  * Contact: Simon Horman <horms@verge.net.au>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
  */
 
 #ifndef __LINUX_CLK_RENESAS_H_