Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp873403imm; Tue, 5 Jun 2018 05:57:44 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJhTWPSs4e+HmTimTlDF52RpiYe6nBn/dY362RI1T+LdPMHEI/fEaW2LuzZAWx1SNn2K29f X-Received: by 2002:a62:f407:: with SMTP id r7-v6mr16022719pff.47.1528203464172; Tue, 05 Jun 2018 05:57:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528203464; cv=none; d=google.com; s=arc-20160816; b=y653NFXPThBwf8HCFDxMpMQIF8QrUMRxAr+mw+4tziPik9oxl3+okdAicnHV6IZnDw FWisvPCdfSmKDe847xsci/16cScsTaeXDa1kuwzZ42h2AZ1sLvH4DsXC2kAFI1pG9Q8s vfJ1TnuieKZhIfoqJMhyEo2xsMi0+OUpit7sBsEt5qO/Pz4c/RqXBER3eaVCB/6WrhAp 890AG3Rh1Breujy3rCGJneEGEKIpOxWN+wttNvku/1HwG+cwGwd+MuQsaDZfBOXcNxSS QuMKESqxvzliRy5DsVP2Kqa7xgWMAqWXC9IPLdg7M0QYaqv7OKF+06v/z5TRzBpUKptw DjNQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dmarc-filter :dkim-signature:dkim-signature:arc-authentication-results; bh=3vJ3qOzIMkKDT2mC9prPbua1m99F2pG3ZLyPmHxyYg4=; b=Nmoxw8vWpC8+Z568B/HN3yudx+ZMD/oXlG1YrkWGaNuln3QQOe0+sKZE2DAFbuVqV1 7nadE8eQvQYSGP8IVmxL1DbEfKwAyqW8UCmO+ahNBSg0OvsZiiPxPrubbuWDFVI2eqn9 fEvfdjwb6WAs8YZ107V3kahcC587ZHVU+WL3Xywt/Zv9SdsiQBhrNFmVwmTMdC2IpRw4 oFCi4jF+PCLVRdri4o3vO8G+mtijblAgG8EErmfF1/nIPJKWHEEnOFCN05p18xxGLSZ5 0pfPruC8AlCOxQh423mKYJtxf6L8mEgwdGX0Kx1+MKs2cvdVHG023tcSbnMuokjR+Zih NuMg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=CQKBfkd9; dkim=pass header.i=@codeaurora.org header.s=default header.b=lRWlTFQs; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d14-v6si23409170pln.206.2018.06.05.05.57.29; Tue, 05 Jun 2018 05:57:44 -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=@codeaurora.org header.s=default header.b=CQKBfkd9; dkim=pass header.i=@codeaurora.org header.s=default header.b=lRWlTFQs; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751833AbeFEM4z (ORCPT + 99 others); Tue, 5 Jun 2018 08:56:55 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:39560 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751732AbeFEM4x (ORCPT ); Tue, 5 Jun 2018 08:56:53 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id AD84B6037B; Tue, 5 Jun 2018 12:56:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1528203412; bh=50F92y7p8Q3Dpd0I9umUPq2JDrSTPaq3C0GaWXR8qfA=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=CQKBfkd9Tpz8N6sH/YwFZQwLx+uyTvbSaKlf7ciHevL4b1gdGoW+8VVfMTIjl/zSV Gp51fRXsirT/NAQMTqFSpsJA4cRJU+trOM+OJpbPLAvx7yUcj1E/w5z+E5scWuzOJk pOGuhMW43HA7tYmvMHJt3xnKoXshjo3S6gOokPaE= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on pdx-caf-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.8 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,T_DKIM_INVALID autolearn=no autolearn_force=no version=3.4.0 Received: from [10.201.3.39] (blr-c-bdr-fw-01_globalnat_allzones-outside.qualcomm.com [103.229.19.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: sricharan@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 8AFAC6037B; Tue, 5 Jun 2018 12:56:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1528203411; bh=50F92y7p8Q3Dpd0I9umUPq2JDrSTPaq3C0GaWXR8qfA=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=lRWlTFQstxl5gCR1eTGXsEwmlTBiLtQ/FGxAONR7Guk3SU1ZPtUEj+kuKxtniluIF 0cv3mwfXSxMfx5jH5VMBQDKL2GlES6zycGzIyRWc8FvSXT10DPwyue44nn9bJ8q1fa w5veSrA6NTJ04qxCMuME7AfIDynW2tOpraTA0X7I= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 8AFAC6037B Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=sricharan@codeaurora.org Subject: Re: [PATCH] remoteproc: qcom: Introduce Hexagon V5 based WCSS driver To: Vinod 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 References: <1528177361-8883-1-git-send-email-sricharan@codeaurora.org> <20180605061919.GQ16230@vkoul-mobl> From: Sricharan R Message-ID: <3a4c102b-7228-153a-c588-b1bf00291fa8@codeaurora.org> Date: Tue, 5 Jun 2018 18:26:46 +0530 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <20180605061919.GQ16230@vkoul-mobl> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Antivirus: Avast (VPS 180605-0, 06/05/2018), Outbound message X-Antivirus-Status: Clean Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Vinod, On 6/5/2018 11:49 AM, Vinod wrote: > 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 > RPMSG_QCOM_GLINK_SMEM=n should be for the COMPILE_TEST. Probably that means that it should be corrected here and for ADSP, Q6V5_PIL as well. Bjorn, is that correct ?, should it be, below ? depends on (RPMSG_QCOM_SMD || (COMPILE_TEST && RPMSG_QCOM_SMD=n)) || (RPMSG_QCOM_GLINK_SMEM || (COMPILE_TEST && RPMSG_QCOM_GLINK_SMEM=n)) >> +/* 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 :) > ok. >> +/* 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? > ok. >> +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?? > ok, will find out what it is for this one and below. But atleast from register map could not find out and these are sort of hardcoded sequences coming from the hw folks. So will have to reach out to them to find the specifics. >> +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; > Regards, Sricharan -- "QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation --- This email has been checked for viruses by Avast antivirus software. https://www.avast.com/antivirus