Received: by 2002:ab2:620c:0:b0:1ef:ffd0:ce49 with SMTP id o12csp659474lqt; Mon, 18 Mar 2024 22:25:54 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWBmB0Brn+B4amN/taRrTN3v7gD6IRMhTfSnrQLSlnTlQal35vXrmltt+f6EwwyOVhZDEcJJM4DiXeRWZaniPJ0RljLMbVCCGa1urkF1g== X-Google-Smtp-Source: AGHT+IGPmyC+PkTcYDY/r4v0+qhViLpQJL7slP98JLTfO8B1SFAEsIhRqCVJ8+O7y1wr7CUfBCNa X-Received: by 2002:a05:6214:5017:b0:690:84d5:cfc3 with SMTP id jo23-20020a056214501700b0069084d5cfc3mr3144686qvb.1.1710825954287; Mon, 18 Mar 2024 22:25:54 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710825954; cv=pass; d=google.com; s=arc-20160816; b=Ya5LjkFvRVeKwFYMyqhD2/TgAQ6Z6fyvpNbFfNPPbQ34NMYIDyVSCHAXfAQIuniJbj GdCCgmk0UstA1ooodxwbqcu8zCm3s/SUmSGp73ktgB9piXiPhzWS9zSnl8LZhsU1Gk3a wtDA6BibWntR+dYnJGduJqp2dhUKjRD8fLWmB0VSMgaE/BCmAylc38F3G0+t2u7ZTP2r tAzmPkrrXXhPsghceZP1vB08ohiLL1BDzDLK8YWUfTtNd9WGiiUujHongypNqz9R330b eVErdl5/F0z++JHtPGuBZuXEmaJetEC/P01W2lqnFnc5PrJRL1k+4MJ/okP9F18UHB8B 0QVA== 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=q6oinwYj2RW9QvL1NsB8w5LaSXSn9PMQMxOTGnro9J0=; fh=2zcqh8K8+iRml7Hd/qzG62oGkVH01yryYHCDOpqkVFE=; b=rT/ZY7IAZliJWQHhfgEDZ2DLG09XF5hZhYHnYVMrKNnLFmY9atSKzXKsKwHY4etvrT paUa0cEf2D38J73u5B532RbxgstGeZQYKfz3/DMY6xg+qudRnD2EnUwu3/9XdGqnoUk1 sBdf+g2k3wvq4uDG2VunhZe1JW0rw6HAkcan9+zLeujYSQHsN2EuEXyLGBGrjTMeBT+i oNZyOr4nvjCMCOQuAi86AC6ez/gw+NeA4Hm0XUx4ro3PTi9QaKkYg3UK2za4D9wHOoCj 0v5f8zoihSarZ3yBLOnAMtm4qdOV3tr43kCJebjd5zj3PBukuB+wVfaYxxaqzX9wHt9f BKzQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=sZoQUJLR; 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-107008-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-107008-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id fo5-20020ad45f05000000b006846c97c980si10157607qvb.579.2024.03.18.22.25.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Mar 2024 22:25:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-107008-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=sZoQUJLR; 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-107008-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-107008-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id EE0061C21692 for ; Tue, 19 Mar 2024 05:25:53 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6D9B14439F; Tue, 19 Mar 2024 05:25:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="sZoQUJLR" Received: from mail-ej1-f46.google.com (mail-ej1-f46.google.com [209.85.218.46]) (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 8B8394085B for ; Tue, 19 Mar 2024 05:25:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.46 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710825945; cv=none; b=i3PTB0rzWWpo0uP74dIo/R/OwnC+O607f/CpkK79oDae3IqDEB544MA/6dO8T+LsfZGy3Nk82ZY6PwP1Y2TEul4BgZeH5GS8DPZhBEMF6Jfsh63iFitZthrr1gwEk0kBQgJ+CaZAT8ZX+m9RL290U7hmEhEY3U7afuIyWnScKpw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710825945; c=relaxed/simple; bh=xlJw5DDEno2UeELF7izcYnWagKR66XQtubOlkVabBik=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=bN2T13G5nhBghTY5CKTAPWkfjPaO6qsv+kcbEPnTVFGbb7T9AxNKCX9JUGp9jOmIBkJPES6D5Wc4KO7ucJVwmc2kImwbIAswzHOlH0cRzv5yNs6qZhUs3+1hLBm5KlhGfz4k/Ia5xUi2DBRf9j9WtV4OqPS70xS+azf6B5fsODA= 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=sZoQUJLR; arc=none smtp.client-ip=209.85.218.46 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-f46.google.com with SMTP id a640c23a62f3a-a46dd7b4bcbso29543266b.3 for ; Mon, 18 Mar 2024 22:25:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710825942; x=1711430742; 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=q6oinwYj2RW9QvL1NsB8w5LaSXSn9PMQMxOTGnro9J0=; b=sZoQUJLRpYcPTy4r6fDe+jfD3IalurH0WOJA39tmwoCC0tU0+BAl8Y1sBhs8PZRndY M/KbUAXm5e9lXVSJLQPNLz1zzoXZoFwD28T+ZG3NMAh9WyotXxilSnnj1abxRLpVuOSS ZPMCvLaM3Ektfn4ec8LLJemNJGfBR16keH/19apakd62KQp7WkMUBAb6fItCHk9bXJq4 DhFuqJz1KMM3JrfA0OLNJ/+UfIy7c1UJsv22qLKGpv7phYwjCUHVawYSDRkrjVa4EMUv y1HwDKpN4+97iPoU7ulcYnQQDjyeFzy8mGvuc1D2s+RMgXa2DfmlA8TE+vWeVST+Xvz/ Qalw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710825942; x=1711430742; 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=q6oinwYj2RW9QvL1NsB8w5LaSXSn9PMQMxOTGnro9J0=; b=DjHVT++E4aKYWEVsOqskumD0RN5yvWwL2rgb5i+ahpJp5G7VzR6GdXGEwIEgaCF3S7 co1varFFeYcEIl1K5b3diJHMCG6VFmeeXhfXcM3gOEE0ngVb/gVtfR0LeZWyTRwFwl5E WOHFSMNiJR89dzYMK415eYAkOlUonxhZfadAmqLdxCucFUNVID6CjZg7XxOsMiPjaa0W 33V9hTKpiI85AO77lkF5/21vSt5AmOUZTX7iDKzK5QBgvQafyKdzSSfCmJY6MyqIDPnC 6moszzZ4fhd8g5+QMV81V5VWfZkczL9hfV2ahucvihh+hsDYPin8pmV1f72v3c/ledYD d0dw== X-Forwarded-Encrypted: i=1; AJvYcCXr3h04Ivr79/lJZOIBiJpk8/GCzJLVKtOGSrl9n7HX4Qd23EZJgVaQj28Bn+lFtFDRzkM5o/RBF9948bGsX7wBhX35+WulsfrMwhSY X-Gm-Message-State: AOJu0YzsjqRLLG4/UQ0iSrVvhoC7vPhoBSe8zVy/tOmYDVIBcoYpPsD8 eA1xnEcIbmXD8SMfZC3fc46bo9Qmy/SAJGp1CVgMOOwhOohlb8pCtgIBkTEjSDY= X-Received: by 2002:a17:906:6a19:b0:a46:af3e:dedc with SMTP id qw25-20020a1709066a1900b00a46af3ededcmr5170830ejc.40.1710825941870; Mon, 18 Mar 2024 22:25:41 -0700 (PDT) Received: from [192.168.1.20] ([178.197.222.97]) by smtp.gmail.com with ESMTPSA id d10-20020a170907272a00b00a45ff890df0sm5616647ejl.35.2024.03.18.22.25.40 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 18 Mar 2024 22:25:41 -0700 (PDT) Message-ID: Date: Tue, 19 Mar 2024 06:25:39 +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/6CBVjEWqD06/RjI2AnjIq5fS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JL9F+oDm3wX47nr6jIsEB5ZftdybIzpMZ5V9v45lUwmdnMrSzZVgC4jRGXzsU EViBQt2CopXtHtYfPAO5nAkIvKSNp3jmGxZw4aTc5xoAZBLo0OV+Ezo71pg3AYvq0a3/oGRG KQ06ztUMRrj8eVtpImjsWCd0bDWRaaR4vqhCHvAG9iWXZu4qh3ipie2Y0oSJygcZT7H3UZxq fyYKiqEmRuqsvv6dcbblD8ZLkz1EVZL6djImH5zc5x8qpVxlA0A0i23v5QvN00m6G9NFF0Le D2GYIS41Kv4Isx2dEFh+/Q== In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 19/03/2024 02:06, Tanmay Shah wrote: > > > On 3/17/24 1:55 PM, Krzysztof Kozlowski wrote: >> 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. > > You are correct, ideally this shouldn't be needed. However, this driver contains > hardcode TCM addresses that were used before TCM bindings were designed and available in > device-tree. This check is provided to maintain backward compatibility with device-tree > where TCM isn't expected. > > For new platforms (Versal and Versal-NET) TCM must be provided in device-tree and for > ZynqMP if it's not in device-tree then to maintain backward compatibility hardcode > addresses are used. That does not work like this. You cannot bind to some sort of different compatible. If you disagree, please list the compatibles the driver binds to. Best regards, Krzysztof