Received: by 2002:a89:2d5:0:b0:1ef:f8eb:5d24 with SMTP id d21csp90201lqs; Sun, 17 Mar 2024 11:55:14 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUom8H4yG+rK59K01tviUfn4fT4spE690MR6nYR+O8nT7+/zDufwJTyjVXpwU68hae+XQ3U7U3sfHkmO75o9pVJHEr9V8fiB8xOoFgMAA== X-Google-Smtp-Source: AGHT+IFsTMKclK0mjD2uNO3yAaZdFuRZQ2t7yVWa2O77NI8a0x4RK+lghs2WpYNOcSbkI7Tpluz7 X-Received: by 2002:a17:906:c0d1:b0:a43:b50d:1074 with SMTP id bn17-20020a170906c0d100b00a43b50d1074mr5893119ejb.23.1710701714418; Sun, 17 Mar 2024 11:55:14 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710701714; cv=pass; d=google.com; s=arc-20160816; b=CwY8uwLSQqmul5IPe1XgMiRQSMIVpESi03mgcNza+DJTKHaP3xu7zaH51Z7TZcrJRq nNxLohtZRo2Edy0QwSdTttLGel08KZIk+t+MmG/LxtHwHCqz3gjKPDfX4E7L+oXsojSE YSWDmvpLS/5MfRdJykYOsu8ysBAJr8pWnobu06WtUrITzvO1Igqs0DHh7gq0r1pesQ+1 2BcRKq87yb3iAsYBi8YpnsFjw9wxCtKKE/U/zpvMMK9DMKOKIECiwDp/9XS1/Q10LcEA fe1MRP6pUIYc4LersKGZaVgy5Ar55WRoYdPR+0aZOMlrvPm1Fdzv8XwiGA+UyTA6qDVV SGjA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:cc :to:content-language:subject:user-agent:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:date:message-id :dkim-signature; bh=GRHG64ehdYr777M90Q2L8vb6DZOoH4ILszuVOY+EHqk=; fh=wqGpOyffeS8ibwur9qaaJccIVQJZFyPEDARcJJn0e8U=; b=i1odM1XPGho+XwmgxCgKQ7FU/NquEI00lIy9+GFc+7CLKPnZ6GcVau4BYM4XbBwZQq SbEwmUmXfpimgDDGsO9S3jqfAapOHNybTgbehSysRIysA4CdbGN80jFjJ+xq9KfEpQhM doQWghc/LWmeFp2mBwuguz0e/LT2s0zO+ImpME1GyUFeRWNaDo98CXZn1V5jqXnIA0yv U+O3o/ZY4JqjOzMzf5QBOhPrp8MnpCzl8gk4aKie0j9xpIFs5Alim3THit5OPzSBQGxB 7jGzfIOt7BYuX1/Tqj/HS2mC8hq/BNrNTI4LHtJ+7RdRAFKzgHZBbaWOji0poGRcxOiK gGYw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=zoV5SjsJ; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-105503-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-105503-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id e15-20020a17090681cf00b00a46bb764169si485012ejx.482.2024.03.17.11.55.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 17 Mar 2024 11:55:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-105503-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=zoV5SjsJ; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-105503-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-105503-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id C1CB11F210D5 for ; Sun, 17 Mar 2024 18:55:13 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7F8DF1DA37; Sun, 17 Mar 2024 18:55:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="zoV5SjsJ" Received: from mail-ej1-f50.google.com (mail-ej1-f50.google.com [209.85.218.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A23751D551 for ; Sun, 17 Mar 2024 18:55:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.50 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710701706; cv=none; b=qhN2u2aOkwILwoAM2J6Ca5Ys3VnsbirU1AqUXU8zB7LLb/O5yggbvr7TDDUExPqD277/xrZ2GzfT2MrAMW4+v6yJRgGpDcp88kOZ/m2Ec5Q7XWTWb2eKdeGqfUfoJIpqGh4uyiWMAOEjzadKgrwsYGSfSRuTLsLbtlPIzqjrKl4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710701706; c=relaxed/simple; bh=2Xy9ZyoIUnmBKgxo1xmsPG8oHaIcb8lxmxyk7KJ0h0k=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=UCs16qoIAJCad9FaVQxQHIO+/Ecn8haSCV4wfUj5rKPl90rTITkImVLm1m/xc+VI7rbJWkGyGC6b9pgYQ5Xa/2m0lCAMXn3WKuKj91LEWOlVvJL4VRSnr6p9ebOMcRzY5HXQuzieXZMR/I+egfLkt4YNPywFd1e0CCJQUenhmtA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=zoV5SjsJ; arc=none smtp.client-ip=209.85.218.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-ej1-f50.google.com with SMTP id a640c23a62f3a-a4675aaa2e8so407104066b.0 for ; Sun, 17 Mar 2024 11:55:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710701703; x=1711306503; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:cc :to:content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=GRHG64ehdYr777M90Q2L8vb6DZOoH4ILszuVOY+EHqk=; b=zoV5SjsJlg9MD5Y9f62f33rFNug6SzPO0V+ms/pYMMNIZrHIMweKKro3E+aBXqWTuA rRc/2sSU8sSp6ti/Zo927KsRXzwoSKGt+K8E2vnY0nXk4ALorgoY7ylY/QZg2IUIi8+t U5brfABDbt9vZpnoEv4fgsjbp9iSfTx2LRQJ2NOaMKHeIlGHKk3KyAdgI/U3f5jTYdo+ +LD01WLDG+CUoxvLK53noY4lSpd7c7AuaZiSZeb0VSDUlS54wWSfbV/zSDt8wIvEPBCC cBNTwesBK4OsTDOSW3Ag/6WHpjviYh22vs9vwv9hVtWo3Tnk8L34sKtz8uU0urPGxE/K JJ4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710701703; x=1711306503; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:cc :to:content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=GRHG64ehdYr777M90Q2L8vb6DZOoH4ILszuVOY+EHqk=; b=PTIAuPzG25kI0xs4TwSHgvclJe8x+qkB3Xzk5B/C36kJCOqlmwegQRyg1fSUV3mmP8 CEIFAE5AOu6PK6cFbm8PvX+5YNIf/jUGV9QENgl4nKeyLbd+AuK+b/hw3mEYio2CJ/i/ QXH9DsAYAKpe2zmmjOCnuwlJxsaanZThNIaCc9SNlMOwGadmRFg4gqVpXyusMn3HN7pG px8UDrW9joNKCfHVsO0dc5mxOe0OPmKVAtlxtxIT4vjvLb8JuHjYxGqASwSBLxmKQmn+ BxLM7oYEO7vDjehYzkAvJMHILDfLPr6+8wkxNMvoFv5qXEHO5/DKxYYHhALhks0X0wVR R7iQ== X-Forwarded-Encrypted: i=1; AJvYcCWtFk4KHAPg+t+k7/lWF/a7s0wrqYJ28SfuxmwtpTfaq+i87rA9PFeRrxqgw+9Tm15DE3IanxSI8cxFKCHLNXKDadSD2sJJaCd2O2Nw X-Gm-Message-State: AOJu0Yz4K0SZqznpg71RBfOiUpGYAJ5QQIbYR3EKIVV07t2WANDMajdG rMC51LrGpYW0aVd9Or0QLRsZMskwpMoyXaSu2QLT0ozHeoogYaVzZJbKmmfwNd4= X-Received: by 2002:a17:906:ee8e:b0:a46:bdd8:64ef with SMTP id wt14-20020a170906ee8e00b00a46bdd864efmr783037ejb.19.1710701702995; Sun, 17 Mar 2024 11:55:02 -0700 (PDT) Received: from [192.168.1.20] ([178.197.222.97]) by smtp.gmail.com with ESMTPSA id r17-20020a1709067fd100b00a466782e438sm4004900ejs.139.2024.03.17.11.55.01 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 17 Mar 2024 11:55:02 -0700 (PDT) Message-ID: Date: Sun, 17 Mar 2024 19:55:01 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 3/3] drivers: remoteproc: add Versal and Versal-NET support Content-Language: en-US To: Tanmay Shah , andersson@kernel.org, mathieu.poirier@linaro.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, michal.simek@amd.com, ben.levinsky@amd.com Cc: linux-remoteproc@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org References: <20240315211533.1996543-1-tanmay.shah@amd.com> <20240315211533.1996543-4-tanmay.shah@amd.com> From: Krzysztof Kozlowski Autocrypt: addr=krzysztof.kozlowski@linaro.org; keydata= xsFNBFVDQq4BEAC6KeLOfFsAvFMBsrCrJ2bCalhPv5+KQF2PS2+iwZI8BpRZoV+Bd5kWvN79 cFgcqTTuNHjAvxtUG8pQgGTHAObYs6xeYJtjUH0ZX6ndJ33FJYf5V3yXqqjcZ30FgHzJCFUu JMp7PSyMPzpUXfU12yfcRYVEMQrmplNZssmYhiTeVicuOOypWugZKVLGNm0IweVCaZ/DJDIH gNbpvVwjcKYrx85m9cBVEBUGaQP6AT7qlVCkrf50v8bofSIyVa2xmubbAwwFA1oxoOusjPIE J3iadrwpFvsZjF5uHAKS+7wHLoW9hVzOnLbX6ajk5Hf8Pb1m+VH/E8bPBNNYKkfTtypTDUCj NYcd27tjnXfG+SDs/EXNUAIRefCyvaRG7oRYF3Ec+2RgQDRnmmjCjoQNbFrJvJkFHlPeHaeS BosGY+XWKydnmsfY7SSnjAzLUGAFhLd/XDVpb1Een2XucPpKvt9ORF+48gy12FA5GduRLhQU vK4tU7ojoem/G23PcowM1CwPurC8sAVsQb9KmwTGh7rVz3ks3w/zfGBy3+WmLg++C2Wct6nM Pd8/6CBVjEWq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J+cY qc+rJggwMQcJL9F+oDm3wX47nr6jIsEB5ZftdybIzpMZ5V9v45lUwmdnMrSzZVgC4jRGXzsU EViBQt2CopXtHtYfPAO5nAkIvKSNp3jmGxZw4aTc5xoAZBLo0OV+Ezo71pg3AYvq0a3/oGRG KQ06ztUMRrj8eVtpImjsWCd0bDWRaaR4vqhCHvAG9iWXZu4qh3ipie2Y0oSJygcZT7H3UZxq fyYKiqEmRuqsvv6dcbblD8ZLkz1EVZL6djImH5zc5x8qpVxlA0A0i23v5QvN00m6G9NFF0Le D2GYIS41Kv4Isx2dEFh+/Q== In-Reply-To: <20240315211533.1996543-4-tanmay.shah@amd.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 15/03/2024 22:15, Tanmay Shah wrote: > AMD-Xilinx Versal and Versal-NET are successor of ZynqMP platform. ZynqMP > remoteproc driver is mostly compatible with new platforms except few > platform specific differences. > > Versal has same IP of cortex-R5 cores hence maintained compatible string > same as ZynqMP platform. However, hardcode TCM addresses are not > supported for new platforms and must be provided in device-tree as per > new bindings. This makes TCM representation data-driven and easy to > maintain. This check is provided in the driver. > > For Versal-NET platform, TCM doesn't need to be configured in lockstep > mode or split mode. Hence that call to PMC firmware is avoided in the > driver for Versal-NET platform. > > Signed-off-by: Tanmay Shah > --- > drivers/remoteproc/xlnx_r5_remoteproc.c | 19 +++++++++++++++---- > 1 file changed, 15 insertions(+), 4 deletions(-) > > diff --git a/drivers/remoteproc/xlnx_r5_remoteproc.c b/drivers/remoteproc/xlnx_r5_remoteproc.c > index d4a22caebaad..193bc159d1b4 100644 > --- a/drivers/remoteproc/xlnx_r5_remoteproc.c > +++ b/drivers/remoteproc/xlnx_r5_remoteproc.c > @@ -323,9 +323,12 @@ static int zynqmp_r5_set_mode(struct zynqmp_r5_core *r5_core, > return ret; > } > > - ret = zynqmp_pm_set_tcm_config(r5_core->pm_domain_id, tcm_mode); > - if (ret < 0) > - dev_err(r5_core->dev, "failed to configure TCM\n"); > + /* TCM configuration is not needed in versal-net */ > + if (device_is_compatible(r5_core->dev, "xlnx,zynqmp-r5f")) { > + ret = zynqmp_pm_set_tcm_config(r5_core->pm_domain_id, tcm_mode); > + if (ret < 0) > + dev_err(r5_core->dev, "failed to configure TCM\n"); > + } > > return ret; > } > @@ -933,10 +936,17 @@ static int zynqmp_r5_core_init(struct zynqmp_r5_cluster *cluster, > int ret, i; > > r5_core = cluster->r5_cores[0]; > + > + /* > + * New platforms must use device tree for TCM parsing. > + * Only ZynqMP uses hardcode TCM. > + */ > if (of_find_property(r5_core->np, "reg", NULL)) > ret = zynqmp_r5_get_tcm_node_from_dt(cluster); > - else > + else if (of_machine_is_compatible("xlnx,zynqmp")) > ret = zynqmp_r5_get_tcm_node(cluster); That's poor code. Your drivers should not depend on platform. I don't understand why you need to do this and how is even related to this patch. Best regards, Krzysztof