diff options
author | Sven Van Asbroeck <thesven73@gmail.com> | 2019-07-12 16:43:15 -0400 |
---|---|---|
committer | Shawn Guo <shawnguo@kernel.org> | 2019-08-03 04:18:56 -0400 |
commit | 77266e722feabb6eefc8a7e84ac2415837d91c5f (patch) | |
tree | f4ee9e8cad0f5ddbc2e40db5f0981f606773f8af | |
parent | d43dc52274d40a1543ca962008feb9ff784e3a49 (diff) |
bus: imx-weim: optionally enable burst clock mode
To enable burst clock mode, add the fsl,burst-clk-enable
property to the weim bus's devicetree node.
Example:
weim: weim@21b8000 {
compatible = "fsl,imx6q-weim";
reg = <0x021b8000 0x4000>;
clocks = <&clks 196>;
#address-cells = <2>;
#size-cells = <1>;
ranges = <0 0 0x08000000 0x08000000>;
fsl,weim-cs-gpr = <&gpr>;
fsl,burst-clk-enable;
client-device@0,0 {
compatible = "something";
reg = <0 0 0x02000000>;
#address-cells = <1>;
#size-cells = <1>;
bank-width = <2>;
fsl,weim-cs-timing = <0x00620081 0x00000001 0x1c022000
0x0000c000 0x1404a38e 0x00000000>;
};
};
Signed-off-by: Sven Van Asbroeck <TheSven73@gmail.com>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
-rw-r--r-- | drivers/bus/imx-weim.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/bus/imx-weim.c b/drivers/bus/imx-weim.c index db74334ca5ef..cb7d5504a22a 100644 --- a/drivers/bus/imx-weim.c +++ b/drivers/bus/imx-weim.c | |||
@@ -19,6 +19,8 @@ struct imx_weim_devtype { | |||
19 | unsigned int cs_count; | 19 | unsigned int cs_count; |
20 | unsigned int cs_regs_count; | 20 | unsigned int cs_regs_count; |
21 | unsigned int cs_stride; | 21 | unsigned int cs_stride; |
22 | unsigned int wcr_offset; | ||
23 | unsigned int wcr_bcm; | ||
22 | }; | 24 | }; |
23 | 25 | ||
24 | static const struct imx_weim_devtype imx1_weim_devtype = { | 26 | static const struct imx_weim_devtype imx1_weim_devtype = { |
@@ -37,6 +39,8 @@ static const struct imx_weim_devtype imx50_weim_devtype = { | |||
37 | .cs_count = 4, | 39 | .cs_count = 4, |
38 | .cs_regs_count = 6, | 40 | .cs_regs_count = 6, |
39 | .cs_stride = 0x18, | 41 | .cs_stride = 0x18, |
42 | .wcr_offset = 0x90, | ||
43 | .wcr_bcm = BIT(0), | ||
40 | }; | 44 | }; |
41 | 45 | ||
42 | static const struct imx_weim_devtype imx51_weim_devtype = { | 46 | static const struct imx_weim_devtype imx51_weim_devtype = { |
@@ -192,6 +196,7 @@ static int __init weim_parse_dt(struct platform_device *pdev, | |||
192 | struct device_node *child; | 196 | struct device_node *child; |
193 | int ret, have_child = 0; | 197 | int ret, have_child = 0; |
194 | struct cs_timing_state ts = {}; | 198 | struct cs_timing_state ts = {}; |
199 | u32 reg; | ||
195 | 200 | ||
196 | if (devtype == &imx50_weim_devtype) { | 201 | if (devtype == &imx50_weim_devtype) { |
197 | ret = imx_weim_gpr_setup(pdev); | 202 | ret = imx_weim_gpr_setup(pdev); |
@@ -199,6 +204,17 @@ static int __init weim_parse_dt(struct platform_device *pdev, | |||
199 | return ret; | 204 | return ret; |
200 | } | 205 | } |
201 | 206 | ||
207 | if (of_property_read_bool(pdev->dev.of_node, "fsl,burst-clk-enable")) { | ||
208 | if (devtype->wcr_bcm) { | ||
209 | reg = readl(base + devtype->wcr_offset); | ||
210 | writel(reg | devtype->wcr_bcm, | ||
211 | base + devtype->wcr_offset); | ||
212 | } else { | ||
213 | dev_err(&pdev->dev, "burst clk mode not supported.\n"); | ||
214 | return -EINVAL; | ||
215 | } | ||
216 | } | ||
217 | |||
202 | for_each_available_child_of_node(pdev->dev.of_node, child) { | 218 | for_each_available_child_of_node(pdev->dev.of_node, child) { |
203 | ret = weim_timing_setup(&pdev->dev, child, base, devtype, &ts); | 219 | ret = weim_timing_setup(&pdev->dev, child, base, devtype, &ts); |
204 | if (ret) | 220 | if (ret) |