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

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>

authored by

Sven Van Asbroeck and committed by
Shawn Guo
77266e72 d43dc522

+16
+16
drivers/bus/imx-weim.c
··· 19 19 unsigned int cs_count; 20 20 unsigned int cs_regs_count; 21 21 unsigned int cs_stride; 22 + unsigned int wcr_offset; 23 + unsigned int wcr_bcm; 22 24 }; 23 25 24 26 static const struct imx_weim_devtype imx1_weim_devtype = { ··· 39 37 .cs_count = 4, 40 38 .cs_regs_count = 6, 41 39 .cs_stride = 0x18, 40 + .wcr_offset = 0x90, 41 + .wcr_bcm = BIT(0), 42 42 }; 43 43 44 44 static const struct imx_weim_devtype imx51_weim_devtype = { ··· 196 192 struct device_node *child; 197 193 int ret, have_child = 0; 198 194 struct cs_timing_state ts = {}; 195 + u32 reg; 199 196 200 197 if (devtype == &imx50_weim_devtype) { 201 198 ret = imx_weim_gpr_setup(pdev); 202 199 if (ret) 203 200 return ret; 201 + } 202 + 203 + if (of_property_read_bool(pdev->dev.of_node, "fsl,burst-clk-enable")) { 204 + if (devtype->wcr_bcm) { 205 + reg = readl(base + devtype->wcr_offset); 206 + writel(reg | devtype->wcr_bcm, 207 + base + devtype->wcr_offset); 208 + } else { 209 + dev_err(&pdev->dev, "burst clk mode not supported.\n"); 210 + return -EINVAL; 211 + } 204 212 } 205 213 206 214 for_each_available_child_of_node(pdev->dev.of_node, child) {