Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp207102ybz; Tue, 21 Apr 2020 07:35:17 -0700 (PDT) X-Google-Smtp-Source: APiQypJNTuCNvqOFbXKfI+bHVIwM7c1NC6p3tU+G0lXXCG+ceF8tBg8Gm12CtDm/DezUxvZFh2Bk X-Received: by 2002:a17:907:210d:: with SMTP id qn13mr21852045ejb.376.1587479716859; Tue, 21 Apr 2020 07:35:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587479716; cv=none; d=google.com; s=arc-20160816; b=CHgl1s7vhx4j8qDURbBqxXuqvDh4fX+9r1mPO9OIaSUv+0CryCTvuJadx7xnTvzqTf ESOkaD1rb3xMDa0CandLxr3P6Gc62Y0mE3DeS/PP16P7zl+yn3twtIroQ2E8CKDWeNFK HmxcdNtWNlHGenSkCaInPRWz/xZmkfLHcMqQrg+bxxqjKueFTj858PaRyB28iePSmQ7n jbqmwSJ8qQiq/O5PemzugSC28l668a3phnbtR+1LQCVWS/spZnSXNnrxzt4DHhJEq4WP u75JlKkYC4Rcmzv4qtt1+cK7alOrNKlwNNvdMxGxbhhor2WXwv4Rb7fWUSUCk0MbYiqf LTQQ== 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:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dmarc-filter:dkim-signature; bh=mNkd366fBI/Mx9MCE5qcOzNQoIGuapc6hsXcqID2Ecc=; b=O+CzTraiuieCIDRvmFmY8j9gjTdlqUIOlN/8OyGsS3z5qj9v5WC2j8flGiK27vTMVt oAGEPYXWamjbMBDtZd9VwpVRNuhYnmNuIyU/aloSxqKdqn8oQFAHNz0JCkU8QfAjZO7B p1bW/zFMtIv+JHErj9PISpbyeHTYJ0k9KI9VRAUc5/soVv7VmubD+DN2Uj7hGkYy+G41 OUj8GJairt/wZVX+su6iHunPraoGiytlxqScpgNTIjpI9DPdBlb+gA4xQ7VK55PLeyAn 4JP2K85HOpLHwrM4hAiE3N5X0rvb22qFNakYW1T5iomGN+rJw7hlR6pa20yEjdsB0OBs uF4Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@mg.codeaurora.org header.s=smtp header.b=cBw1EmTW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e8si1750912ejd.76.2020.04.21.07.34.43; Tue, 21 Apr 2020 07:35:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@mg.codeaurora.org header.s=smtp header.b=cBw1EmTW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729316AbgDUOdH (ORCPT + 99 others); Tue, 21 Apr 2020 10:33:07 -0400 Received: from mail26.static.mailgun.info ([104.130.122.26]:10368 "EHLO mail26.static.mailgun.info" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729317AbgDUOdG (ORCPT ); Tue, 21 Apr 2020 10:33:06 -0400 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1587479586; h=Content-Transfer-Encoding: MIME-Version: References: In-Reply-To: Message-Id: Date: Subject: Cc: To: From: Sender; bh=mNkd366fBI/Mx9MCE5qcOzNQoIGuapc6hsXcqID2Ecc=; b=cBw1EmTWwmZMzNBFbQYX1ma2knfa4+mFmEdH9IRVTEs8VQcuXNvJXccwmPbewi0/hbOvLpfZ EdPTusCcKCRNCHAzqUipMRmLZ1qb2kkaUORKq1TVq2t5mrGvhCS3azrc6y0+ntTffHOLLkPS LPKFUNFt67Qr2yP26UaVILEiq0Q= X-Mailgun-Sending-Ip: 104.130.122.26 X-Mailgun-Sid: WyI0MWYwYSIsICJsaW51eC1rZXJuZWxAdmdlci5rZXJuZWwub3JnIiwgImJlOWU0YSJd Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by mxa.mailgun.org with ESMTP id 5e9f0421.7f3fa9b54998-smtp-out-n03; Tue, 21 Apr 2020 14:33:05 -0000 (UTC) Received: by smtp.codeaurora.org (Postfix, from userid 1001) id AE60BC44792; Tue, 21 Apr 2020 14:33:01 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-caf-mail-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=2.0 tests=ALL_TRUSTED,SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.0 Received: from blr-ubuntu-87.qualcomm.com (blr-bdr-fw-01_GlobalNAT_AllZones-Outside.qualcomm.com [103.229.18.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: sibis) by smtp.codeaurora.org (Postfix) with ESMTPSA id C25DDC44799; Tue, 21 Apr 2020 14:32:55 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org C25DDC44799 Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; spf=none smtp.mailfrom=sibis@codeaurora.org From: Sibi Sankar To: bjorn.andersson@linaro.org, robh+dt@kernel.org Cc: agross@kernel.org, linux-arm-msm@vger.kernel.org, linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org, evgreen@chromium.org, ohad@wizery.com, mka@chromium.org, dianders@chromium.org, devicetree@vger.kernel.org, Sibi Sankar Subject: [PATCH v2 4/7] remoteproc: qcom_q6v5_mss: Extract mba/mpss from memory-region Date: Tue, 21 Apr 2020 20:02:25 +0530 Message-Id: <20200421143228.8981-5-sibis@codeaurora.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200421143228.8981-1-sibis@codeaurora.org> References: <20200421143228.8981-1-sibis@codeaurora.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In the absence of mba and mpss sub-child extract the mba/mpss regions from the memory-region property. Signed-off-by: Sibi Sankar --- drivers/remoteproc/qcom_q6v5_mss.c | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/drivers/remoteproc/qcom_q6v5_mss.c b/drivers/remoteproc/qcom_q6v5_mss.c index 3a7352776a319..5c8d04c51af71 100644 --- a/drivers/remoteproc/qcom_q6v5_mss.c +++ b/drivers/remoteproc/qcom_q6v5_mss.c @@ -1503,8 +1503,17 @@ static int q6v5_alloc_memory_region(struct q6v5 *qproc) struct resource r; int ret; + /* + * In the absence of mba/mpss sub-child, extract the mba and mpss + * reserved memory regions from device's memory-region property. + */ child = of_get_child_by_name(qproc->dev->of_node, "mba"); - node = of_parse_phandle(child, "memory-region", 0); + if (!child) + node = of_parse_phandle(qproc->dev->of_node, + "memory-region", 0); + else + node = of_parse_phandle(child, "memory-region", 0); + ret = of_address_to_resource(node, 0, &r); if (ret) { dev_err(qproc->dev, "unable to resolve mba region\n"); @@ -1521,8 +1530,14 @@ static int q6v5_alloc_memory_region(struct q6v5 *qproc) return -EBUSY; } - child = of_get_child_by_name(qproc->dev->of_node, "mpss"); - node = of_parse_phandle(child, "memory-region", 0); + if (!child) { + node = of_parse_phandle(qproc->dev->of_node, + "memory-region", 1); + } else { + child = of_get_child_by_name(qproc->dev->of_node, "mpss"); + node = of_parse_phandle(child, "memory-region", 0); + } + ret = of_address_to_resource(node, 0, &r); if (ret) { dev_err(qproc->dev, "unable to resolve mpss region\n"); -- The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project