Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp1321157ybi; Fri, 12 Jul 2019 13:44:14 -0700 (PDT) X-Google-Smtp-Source: APXvYqz3xFgXLdGU1u2eQaeI7BscQrdOoEOuJ3/ofuBJsyr8ygM2fSwF7BIlGt1wcIJh8477FH7u X-Received: by 2002:a17:90a:8d86:: with SMTP id d6mr14304191pjo.94.1562964254638; Fri, 12 Jul 2019 13:44:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562964254; cv=none; d=google.com; s=arc-20160816; b=B4CqPhdZ/Hhyyq7Z3lX3WT4hhRjjNR+b1y38xqduv8ZInZpD/G7ZXkchPi6DsrhFGC jTK2wvT4HY+agXhZHJka6VgRX7QjAVFcEQ3OLT9owCAnEon7RoFkGu4Ea9SSuhr4bncF 37bUY+xdUtoubzX0M+kQj6WxdmfXEO9IdIUFuxOHTgjSvpmcUihOZI500ba3tlYRY7Rw RVX28O/+IFxIzSRM3UCBLufj1/cXxKE4lxdalzZFyKy+ekCoJcLtjU61AY0JLwRmDvvF 4bUbN6tanhfguW7ChuXZV6zjmLA/zGK+qTgt9Lx9ALaGBrE2Fs4rwZ7pQIcCzuPh90RC ZcYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=0YO9X8JrVMhxS3C8ry3P1NpNE6uCJVJpb/vpFCRQayg=; b=WuFtXKZ6eZ4yZNGEfQeFRnOXyFTM5L8NEIKVSgQ2zhvh755rLR9hk5XH0D7RcDM//Y uunbL3sooxwlPcHmHiqq3h5hiN4g093P/FIMCqLuHq+HvZgabLJGyb7mwDy/OQQplpgN IA9e83Zmub73qff9hUKxfhKbohlYpuor4l2/1oMZDPmCaKS+hjWqZ86GfkrOy/HNgU+5 y4E3SH4aIN1V65u01bgcVQWOgxbBosYstegc0uv2j8H4MPwRmhZNNoQbSNGK0rcQ30II B2F4kYny+xKSiDX5WrbstbNzLwPT/CYisaaW5tjioZ8hO01zgiICC3APmivWYdiwIgst a9gg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="YFsPT/Cb"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a59si2572818plc.319.2019.07.12.13.43.59; Fri, 12 Jul 2019 13:44:14 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="YFsPT/Cb"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728032AbfGLUnX (ORCPT + 99 others); Fri, 12 Jul 2019 16:43:23 -0400 Received: from mail-io1-f65.google.com ([209.85.166.65]:38815 "EHLO mail-io1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727921AbfGLUnW (ORCPT ); Fri, 12 Jul 2019 16:43:22 -0400 Received: by mail-io1-f65.google.com with SMTP id j6so23260565ioa.5; Fri, 12 Jul 2019 13:43:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=0YO9X8JrVMhxS3C8ry3P1NpNE6uCJVJpb/vpFCRQayg=; b=YFsPT/CbCO1LYM1qhpMoKr6yhOs70HOyZxWiAG04T809bxgw3U/rSVm6+OJCWo3/cW Nu8hPOb34VukBWTpMKr3Mg4MG2b48byWj4eT6FSODq0k3+HJnV/YX3oDjoaAMnPdvcs0 PW+Iiq/XxaJHg0n5CZbLmrhMYGel/fLkar8lRQiWprQlMZnpnoAN6VU3FRxAuM2yNYIZ X74+KB5GrKTBV1HI3OWGXUsirgVu+flnGc4YnMZZTCFd+U6nIkwedcf08xS0TSS1eB13 5BSmF77HrzE/1Bq+SVi5h3Iqw0qViCMn/JsnWiQwhgr7fdTCc+nPbVbqFYrtnWnZ2Up/ an1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=0YO9X8JrVMhxS3C8ry3P1NpNE6uCJVJpb/vpFCRQayg=; b=DwxUpn+R6XU7ZFJ7N3gu06F/pS7Ck+Ticy/9Dz0XnwIuYoQTrGNStDD/w6q5o8Q+oH /5F1AMZmqRzvC/KoUIjt7Bz1XX7Y/Nsk2HQ9zCW11kpCOujasedqEjVxp54LFhXfrP68 S22Wd+u1TyBQSYlwTAeJ5lNJ984P+CV8ln/k4o82HGQLkENU2yZVbfJln0Zg985GSyoW 3DErYgWjKWW+fV3c/3AfIal+81CfX3UH+c4ri0S+Vr1Ac9R3k2qFoii/d1TTN3D2uTdf CiCN1q23fQBZmcJaiun9LlwzVooeqU4+8iK5jW2sftyRaRhEft89zc3Y1Q5gbShmlOfU 3ARQ== X-Gm-Message-State: APjAAAVNgUmKYMIuVim9zIdUF3E6Y27bodOLkJvbZDFGxkUasNgQU1JM R1XihyCOSyq0FV/TM5SD40c= X-Received: by 2002:a5d:8702:: with SMTP id u2mr13323425iom.228.1562964201758; Fri, 12 Jul 2019 13:43:21 -0700 (PDT) Received: from localhost.localdomain ([198.52.185.227]) by smtp.gmail.com with ESMTPSA id l14sm9725013iob.1.2019.07.12.13.43.20 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Fri, 12 Jul 2019 13:43:21 -0700 (PDT) From: Sven Van Asbroeck X-Google-Original-From: Sven Van Asbroeck To: Shawn Guo , Rob Herring Cc: NXP Linux Team , Kees Cook , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Mark Rutland , Sascha Hauer , devicetree@vger.kernel.org, Fabio Estevam , Pengutronix Kernel Team , Arnd Bergmann Subject: [PATCH 1/2] bus: imx-weim: optionally enable burst clock mode Date: Fri, 12 Jul 2019 16:43:15 -0400 Message-Id: <20190712204316.16783-1-TheSven73@gmail.com> X-Mailer: git-send-email 2.17.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- drivers/bus/imx-weim.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) 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 { unsigned int cs_count; unsigned int cs_regs_count; unsigned int cs_stride; + unsigned int wcr_offset; + unsigned int wcr_bcm; }; static const struct imx_weim_devtype imx1_weim_devtype = { @@ -37,6 +39,8 @@ static const struct imx_weim_devtype imx50_weim_devtype = { .cs_count = 4, .cs_regs_count = 6, .cs_stride = 0x18, + .wcr_offset = 0x90, + .wcr_bcm = BIT(0), }; static const struct imx_weim_devtype imx51_weim_devtype = { @@ -192,6 +196,7 @@ static int __init weim_parse_dt(struct platform_device *pdev, struct device_node *child; int ret, have_child = 0; struct cs_timing_state ts = {}; + u32 reg; if (devtype == &imx50_weim_devtype) { ret = imx_weim_gpr_setup(pdev); @@ -199,6 +204,17 @@ static int __init weim_parse_dt(struct platform_device *pdev, return ret; } + if (of_property_read_bool(pdev->dev.of_node, "fsl,burst-clk-enable")) { + if (devtype->wcr_bcm) { + reg = readl(base + devtype->wcr_offset); + writel(reg | devtype->wcr_bcm, + base + devtype->wcr_offset); + } else { + dev_err(&pdev->dev, "burst clk mode not supported.\n"); + return -EINVAL; + } + } + for_each_available_child_of_node(pdev->dev.of_node, child) { ret = weim_timing_setup(&pdev->dev, child, base, devtype, &ts); if (ret) -- 2.17.1