Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp519433imm; Mon, 4 Jun 2018 23:20:55 -0700 (PDT) X-Google-Smtp-Source: ADUXVKL6u+EPZZ5rcgad5sxs2S4LqicBss8aCqGw6cBkH5OqFKwaLQJmN7CAqTUAjYCvGI/Y4KxV X-Received: by 2002:a65:6290:: with SMTP id f16-v6mr11407121pgv.155.1528179655192; Mon, 04 Jun 2018 23:20:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528179655; cv=none; d=google.com; s=arc-20160816; b=siUWg8nfdnQ78OkfbUnsTjk98q7k38f0tuRBjL6nZhQuIs1vxTnzF2Qn6/qcq+UNWz NPHs3iwqz7tnKxIcA8hpv4+n6Sd24cy4CetH1he3gfmfLEdLwCtU5Ai/ZLT0HQOwYqPw zM/+QdiKYijnWfeFtY1eUOvpCZZivvOwO7eeoUAPHqYixYjPlVlsJS7HelLP5ecrGaR1 phtx2OsFRah7WB3hfkZySqotVyMBHxKlkX7VpdOh+7k3lYpFdkMOG866lVc97Q/oDJic IyoSc1rz+EuulrotAmlhpYxKlKexVfTPm3H9G4Mcqmldd20SmdJ01iExeP5/jAt9vW97 lkRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=3bMEQGacRbDEDnkAPxKyB/adl7d8hzpEZK6+Ixjxj6I=; b=TCI7iTBsuUIvV6gvpap97BDOEG6IRlgtRvSHWLaM2Mw4RL0BwIWni6YrE6CNAXZ71r NbPyw2Io0yfFhnr0i3HPx24NJvyLhUzo6Wfh1bz7R6MqwCGeBw+haAGmcN+ymMhq3bGF kislKH01RgkTN8NqA+T0xN/M08WiQy87TriPMxJnvmIpjdAlgzqzfWu0AzNL/XfkNreC pkFlV3PoITzQf2vleB6QtWCQoGLgPu+nzEqDCUCdGsWLlytrOhYMlFy9rrhuO3Vir6hG 4dFthC7KCxUZucHzx1iZfQ8KgDo8vEtDcfpfVersV9dTeE4tbyV/IwAiXSCoDcL7Shj7 X7tA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=G6yYBm8Y; 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z2-v6si38542413pgp.234.2018.06.04.23.20.40; Mon, 04 Jun 2018 23:20:55 -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=@kernel.org header.s=default header.b=G6yYBm8Y; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751514AbeFEGTa (ORCPT + 99 others); Tue, 5 Jun 2018 02:19:30 -0400 Received: from mail.kernel.org ([198.145.29.99]:36642 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750838AbeFEGT2 (ORCPT ); Tue, 5 Jun 2018 02:19:28 -0400 Received: from localhost (unknown [106.201.60.68]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 9EAFC2077B; Tue, 5 Jun 2018 06:19:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1528179567; bh=gjh2iMIF99WERp2SPsjN86ZwZLHb6EUuh3AqtPLH6RE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=G6yYBm8YNATiRX+e7tP7n4AHGendlXwJowJHe0QTAcdtCTV1kaGulZ7FW1CNj5hbj qICwfHFXQjQ6GrGGliUCqjGHm6Hgp/65CdojpXfyNng/9x88leUOFKUSQvyDSE8a72 rrx8zc4+F0+KOjtW0KFOdJOhzSJ2ow4hqt6VqEvg= Date: Tue, 5 Jun 2018 11:49:19 +0530 From: Vinod To: Sricharan R Cc: bjorn.andersson@linaro.org, ohad@wizery.com, robh+dt@kernel.org, mark.rutland@arm.com, andy.gross@linaro.org, david.brown@linaro.org, linux-remoteproc@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-soc@vger.kernel.org, sibis@codeaurora.org Subject: Re: [PATCH] remoteproc: qcom: Introduce Hexagon V5 based WCSS driver Message-ID: <20180605061919.GQ16230@vkoul-mobl> References: <1528177361-8883-1-git-send-email-sricharan@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1528177361-8883-1-git-send-email-sricharan@codeaurora.org> User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 05-06-18, 11:12, Sricharan R wrote: > +config QCOM_Q6V5_WCSS > + tristate "Qualcomm Hexagon based WCSS Peripheral Image Loader" > + depends on OF && ARCH_QCOM > + depends on QCOM_SMEM > + depends on RPMSG_QCOM_SMD || (COMPILE_TEST && RPMSG_QCOM_SMD=n) > + depends on RPMSG_QCOM_GLINK_SMEM || RPMSG_QCOM_GLINK_SMEM=n Is there a reason why it depends on RPMSG_QCOM_GLINK_SMEM=n? What would happen if distro wants both this and RPMSG_QCOM_GLINK_SMEM > +/* QDSP6SS Register Offsets */ > +#define QDSP6SS_RESET_REG 0x014 > +#define QDSP6SS_GFMUX_CTL_REG 0x020 > +#define QDSP6SS_PWR_CTL_REG 0x030 > +#define QDSP6SS_MEM_PWR_CTL 0x0B0 > + > +/* AXI Halt Register Offsets */ > +#define AXI_HALTREQ_REG 0x0 > +#define AXI_HALTACK_REG 0x4 > +#define AXI_IDLE_REG 0x8 > + > +#define HALT_ACK_TIMEOUT_MS 100 > + > +/* QDSP6SS_RESET */ > +#define Q6SS_STOP_CORE BIT(0) > +#define Q6SS_CORE_ARES BIT(1) > +#define Q6SS_BUS_ARES_ENABLE BIT(2) Wouldn't it be nice if the defines are all consistent, some of them are QDSP6SS_xxx, some Q6SS_ some are not Please do pick one and make it consistent :) > +/* QDSP6v56 parameters */ > +#define QDSP6v56_LDO_BYP BIT(25) > +#define QDSP6v56_BHS_ON BIT(24) > +#define QDSP6v56_CLAMP_WL BIT(21) > +#define QDSP6v56_CLAMP_QMC_MEM BIT(22) > +#define HALT_CHECK_MAX_LOOPS 200 > +#define QDSP6SS_XO_CBCR 0x0038 GENMASK() perhaps? > +static int q6v5_wcss_reset(struct q6v5_wcss *wcss) > +{ > + int ret; > + u32 val; > + int i; int ret, i; > +static int q6v5_wcss_start(struct rproc *rproc) > +{ > + struct q6v5_wcss *wcss = rproc->priv; > + int ret; > + > + qcom_q6v5_prepare(&wcss->q6v5); > + > + /* Release Q6 and WCSS reset */ > + ret = reset_control_deassert(wcss->wcss_reset); > + if (ret) { > + dev_err(wcss->dev, "wcss_reset failed\n"); > + return ret; > + } > + > + ret = reset_control_deassert(wcss->wcss_q6_reset); > + if (ret) { > + dev_err(wcss->dev, "wcss_q6_reset failed\n"); > + goto wcss_reset; > + } > + > + /* Lithium configuration - clock gating and bus arbitration */ > + ret = regmap_update_bits(wcss->halt_map, > + wcss->halt_nc + TCSR_GLOBAL_CFG0, > + 0x1F, 0x14); magic numbers?? > +static int q6v5_wcss_powerdown(struct q6v5_wcss *wcss) > +{ > + int ret; > + u32 val; > + > + /* 1 - Assert WCSS/Q6 HALTREQ */ > + q6v5_wcss_halt_axi_port(wcss, wcss->halt_map, wcss->halt_wcss); > + > + /* 2 - Enable WCSSAON_CONFIG */ > + val = readl(wcss->rmb_base + SSCAON_CONFIG); > + val |= SSCAON_ENABLE; > + writel(val, wcss->rmb_base + SSCAON_CONFIG); > + > + /* 3 - Set SSCAON_CONFIG */ > + val |= BIT(15); > + val &= ~BIT(16); > + val &= ~BIT(17); > + val &= ~BIT(18); wouldn't it be nice to define these bits? > +static int q6v5_q6_powerdown(struct q6v5_wcss *wcss) > +{ > + int ret; > + u32 val; > + int i; int ret, i; -- ~Vinod