Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp6806481rwp; Tue, 18 Jul 2023 06:14:41 -0700 (PDT) X-Google-Smtp-Source: APBJJlEGxY5dzWQCJ6vv1NOy6FN0rmXEfYRLQ1YDoyelJS+5w3ZvUwRYMjOx8tSm6zZtVdKzLC3l X-Received: by 2002:a05:6a20:549a:b0:133:f5c1:57b7 with SMTP id i26-20020a056a20549a00b00133f5c157b7mr2386401pzk.51.1689686081704; Tue, 18 Jul 2023 06:14:41 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1689686081; cv=pass; d=google.com; s=arc-20160816; b=rPnfIrCMc3mBaOnXA+Zyu4cFPt6g7U2gSUqBhR1nIui3qt4J0/lAs1+KBsMLdu77O1 gDSk40vzbN9hE0tEJB8jGs7yKp/zwhTenweZNMExbuhG4sfbM6x2kvGQ70ULArbl5YEn IXM6zJcQjUKPfgZI/CI2GTTQKGxwI6kW6fmDdvRNmtiBZ9ug/0padookr77uq4LTGjcw Y+rtMSEe0wghEYPhOocFbOWFCqeZk2n6juYaq4LtdoJrO934fHYOUNtEMjyoTHzBSJOV QBlMJJ/DoWquSSKatwIA9U+VgpH5jph2By9bcx69By/9QlZNhJV+7fJX6VIkdCZ6B9fl cbCA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :in-reply-to:subject:from:references:cc:to:content-language :user-agent:date:message-id:dkim-signature; bh=seJcjzM7h0zn2L96IjJnhDMgSFAxegxaAjYzbW1ut9c=; fh=aviYD9xE1isYt1zt8bHXXccWLNaVqbQ9ABSGsinM2dg=; b=qSO+aXxB0sNEkZG42GkbPORp2aQ4Jcl6lKwA4g9dY1G+3aXbXsHLZftAWZ6kS6h0OW eFfXcO3Clf6SEwZHSOaPg1CXpwGcoJZrhVL23HcOicIqpY2wqTNIfz+ZKiqupZaktZc/ EJIDvZfREvxlQ3lOerg8A5wlAyjOHZXJ7/YPIEnen2/ezoLRSp+S+JRjDjdR6NILZhX5 Te9M1HJ4yk6kDybr0NR7yTgW+duA9dn8THNY+iWGul1dCyFm65/vw9KpzpZ/uiH3jwv9 QiO7XsC0wPOJWvODiKq000VeOHrMbOQdatLhAWSMFEIfu3gXywfAw+xKEh67zVPqhlJN Qbuw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=rRkNpwwu; arc=pass (i=1 spf=pass spfdomain=amd.com dkim=pass dkdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d4-20020a056a0010c400b00666892d1ec3si1566038pfu.360.2023.07.18.06.14.29; Tue, 18 Jul 2023 06:14:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=rRkNpwwu; arc=pass (i=1 spf=pass spfdomain=amd.com dkim=pass dkdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232637AbjGRNLe (ORCPT + 99 others); Tue, 18 Jul 2023 09:11:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48982 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230284AbjGRNLU (ORCPT ); Tue, 18 Jul 2023 09:11:20 -0400 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2068.outbound.protection.outlook.com [40.107.220.68]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4F14BEE; Tue, 18 Jul 2023 06:11:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OSWDw7m4Dx2yQPmhUw2TplaXUtt7NILii4t2fr6f+3jZohW4uMrHtxegOfsIGm2+fbt4nN5NRk+5kSsJ4PciIpvAOHQBGYGEFQysPEs9ljE7tNITeAy1BXjjn9XgrGdUyUNlFlGPzUjYydUNI4ZCQVjouGzoS2Bg/eSW9v9/uOdecHohuf+eHizPWdToQOUzsZvkQVRz0gVL1+pv/9EdwYzxCmw+kt3heP0/jg7wYyzTQxnk0rx6x4l0r8ppP+yPwql/CBgGu2OCaVCEW+FjNJCHzJfPzf9R8MtAHUwtEvWy4CFjVkDzZ7UJHg7yVBrnRBlgzoT4geVVjuGUsb3Tbw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=seJcjzM7h0zn2L96IjJnhDMgSFAxegxaAjYzbW1ut9c=; b=dh1aVtG+G5iNiO5fI6OSAsPCw2nDw3DLg7Ureml2ViB0mLZ7yGxycthaAO3HFxb8mG1jNwzNGg1qcAE2sZWpM8vPYaAZ343NPbQHVVW5fRR/iHEMso552ItK7PhAiqSLojUPXIzwhx3dWaC5xygbvLLti53aI+DEpZ3jstS0MpISmFEUtlDAx666N0G5NmbuVt/O5Rp9g5ZBnCKn2m90NanQCWwJVPL8D/z/+J14ZDvScyn7mnPhDyPyTESMClliqg2+HA3b8SP2vDU5zpuqS+VUaL/oEXUt7UH6dFYR3zh86ll4xrsz/TK3Qv4NYsrxNDLhBFqXhtDkQf9cTA90wQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=seJcjzM7h0zn2L96IjJnhDMgSFAxegxaAjYzbW1ut9c=; b=rRkNpwwuS1L6TmoNhYblBHbK3U2GU0smhI0SXmZwzNIRluYg+rJ6X2Q9kR8WPUUy5tO6K35FGd+le/WOk/k5Ab0XaCL/JKYFpHmSUQ0Ir0/kyDQc5Tt7zg4GMmwgucl/ar3NFDX13n0CB1gpP1FeXXly16l/J8CzQtthiGMMK9c= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from BYAPR12MB4758.namprd12.prod.outlook.com (2603:10b6:a03:a5::28) by CH0PR12MB5251.namprd12.prod.outlook.com (2603:10b6:610:d2::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.32; Tue, 18 Jul 2023 13:11:14 +0000 Received: from BYAPR12MB4758.namprd12.prod.outlook.com ([fe80::be39:45a4:cd9b:4684]) by BYAPR12MB4758.namprd12.prod.outlook.com ([fe80::be39:45a4:cd9b:4684%3]) with mapi id 15.20.6588.031; Tue, 18 Jul 2023 13:11:14 +0000 Message-ID: Date: Tue, 18 Jul 2023 15:11:08 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Content-Language: en-US To: Krzysztof Kozlowski , Conor Dooley , Piyush Mehta Cc: robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, p.zabel@pengutronix.de, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, git@amd.com References: <20230717112348.1381367-1-piyush.mehta@amd.com> <20230717112348.1381367-2-piyush.mehta@amd.com> <20230717-explode-caucus-82c12e340e39@spud> <694a1314-0b25-ff5e-b19f-5a0efe07bf64@linaro.org> From: Michal Simek Subject: Re: [PATCH 1/2] dt-bindings: reset: Updated binding for Versal-NET reset driver In-Reply-To: <694a1314-0b25-ff5e-b19f-5a0efe07bf64@linaro.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: FR2P281CA0015.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:a::25) To BYAPR12MB4758.namprd12.prod.outlook.com (2603:10b6:a03:a5::28) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BYAPR12MB4758:EE_|CH0PR12MB5251:EE_ X-MS-Office365-Filtering-Correlation-Id: 9059bd37-9d02-4614-c383-08db879076e2 X-LD-Processed: 3dd8961f-e488-4e60-8e11-a82d994e183d,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: dxKy2axj+DM4A1kQNsNB1Mbbq8A6CjRLapCxJftI7PozBOpIht4NjPBHHjxzWNJ6CNrWV2m5Hb7tG/adEHbaHWmDwIgLI9lGXAgdVbwW2M/J5e2RGuD7MA/o9VkKIZxyLY50ugXDrmmT4PJjUgtmzu4PWI7SNWE4vz+up3/OjkpaxJorKUTC1vF7+Ti6XDd9+bRaezTFC/DMxzmhpnAWSxujI6pX2zyqmaIGBjl7gGUWh3La58YXhTq1Z9qjfGbxrqe3dGq5zlvyqM71grm9ldaiRjkZWZ5yagnZa2bA9IuomgaU7Ehc+eSf8KGtZcJkr9TyLOgMX1N3zgUtX6wzKB2wWTPTKbQ/hK7ipKPVJTgcDDVVH06bQACWXncmdiZOtZUciyw9B4jd9+dNO2rbWPq5gqyeyyQm6+p9sq/kxpR9/C9ZUKLkCyUDQs7ekCFgGLU0HPra0nEUny58ok47YtwW6WLBbQVT9qENYA5kF3gyg10wrMTM9Lwu7/2hVWTd5HQO27s7c19484ZXjE+uEa6Zjr2C1runx6vQ0sWk3w35vgpZLTTpgsDjCJIV/LEolNTI36btJfVunONHlWQcTqybDoh1kB2/iGSCVzX3WUEPlHJlgEJaH7RSWhhfZc7xMCBcgyIaLgPW5z5Ub1Hg0DgDMVN0BtaIVHzbXQM8qQev1uNvVUKg4CpoZg2eVS7U X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BYAPR12MB4758.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(396003)(346002)(366004)(39860400002)(136003)(376002)(451199021)(6486002)(38100700002)(6666004)(110136005)(41300700001)(8676002)(8936002)(478600001)(316002)(66946007)(66476007)(5660300002)(66556008)(6636002)(4326008)(186003)(83380400001)(6512007)(966005)(2616005)(6506007)(26005)(53546011)(86362001)(31696002)(36756003)(44832011)(15650500001)(2906002)(31686004)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?dE8rdmxzbmZYb0xlNkFaUnhwdDF2cWZkSXRieVVrOXdjbmpXYTNiWURmNC8r?= =?utf-8?B?QjdCTk0xVE5NT0cvY1ZSS0t4eis0SXFockE2aDdBcWI1UUNDdFhpeS9qSEc3?= =?utf-8?B?aTNlblNGMTlCNm9XNFppMkJxZ3dUOVVtbjZzQlQyZEFDVnZLZU1vRCswNXY5?= =?utf-8?B?cXp2RGlBU2hNL3cza1ErSXkxTGc0L2lnbVo0YzVEOE00eDhNMHBibENpUURx?= =?utf-8?B?dDdWdkdTbmxzNGtlaDcrdmdvOUtYTVJwTWhYd0p4S0ZuSHB2WlBFa21ZN3U5?= =?utf-8?B?OWxzd1IyR1I3NXJueWdqMHFKamp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?utf-8?Q?1HoO+T6P4yPRdavpuwEwKl6IS?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9059bd37-9d02-4614-c383-08db879076e2 X-MS-Exchange-CrossTenant-AuthSource: BYAPR12MB4758.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jul 2023 13:11:14.6209 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: /CT+FKWLWziaMUV+7OTV521m/8o7WC/QR4j7MWOPN6Il3D5WhX2UaHHHKrbfyz+w X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR12MB5251 X-Spam-Status: No, score=-1.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_SPF_HELO,NICE_REPLY_A, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 7/18/23 09:39, Krzysztof Kozlowski wrote: > On 18/07/2023 09:10, Michal Simek wrote: >> >> >> On 7/17/23 22:47, Krzysztof Kozlowski wrote: >>> On 17/07/2023 20:40, Conor Dooley wrote: >>>> On Mon, Jul 17, 2023 at 04:53:47PM +0530, Piyush Mehta wrote: >>>>> Added documentation and Versal-NET reset indices to describe about >>>>> Versal-Net reset driver bindings. >>>>> >>>>> In Versal-NET all reset indices includes Class, SubClass, Type, Index >>>>> information whereas class refers to clock, reset, power etc., >>>>> Underlying firmware in Versal have such classification and expects >>>>> the ID to be this way. >>>>> [13:0] - Index bits >>>>> [19:14] - Type bits >>>>> [25:20] - SubClass bits >>>>> [31:26] - Class bits. >>>> >>>> Riight.. I'm not sure that describing these as "indices" is really all >>>> that valid, given only 13:0 are actually the index. >>>> I'd be inclined to say that the type/class/subclass stuff should not be >>>> part of the dt-bindings, and instead looked up inside the driver >>>> depending on the index. >>>> >>>> Hopefully Rob or Krzysztof can comment further. >>> >>> This confuses me as well. I don't understand why do you need it in the >>> bindings. Nothing uses these values, so storing them as bindings seems >>> pointless. >> >> Power Management team wants to use these NodeID with format describe above to >> identify that elements. And I already told them that ID (0-max) translation to >> internal NodeID format should be done in firmware but they don't pretty much >> agree with it. > > Too bad for them. They can join the discussion, though :) > >> >> From DT binding perspective I think it doesn't really matter if numbers are >> from 0 to max or they are from random high number to another random number >> without step equal to 1. >> And it is driver implementation detail if driver itself is checking that >> requested ID is bigger than number of pins passed. >> >> In connection to reset driver in Linux. >> >> Core has: >> static int of_reset_simple_xlate(struct reset_controller_dev *rcdev, >> const struct of_phandle_args *reset_spec) >> { >> if (reset_spec->args[0] >= rcdev->nr_resets) >> return -EINVAL; >> >> return reset_spec->args[0]; >> } >> >> /** >> * reset_controller_register - register a reset controller device >> * @rcdev: a pointer to the initialized reset controller device >> */ >> int reset_controller_register(struct reset_controller_dev *rcdev) >> { >> if (!rcdev->of_xlate) { >> rcdev->of_reset_n_cells = 1; >> rcdev->of_xlate = of_reset_simple_xlate; >> } >> ... > > If you use both, it means you don't need bindings. > >> >> And zynqmp reset driver already defines of_xlate function that's why checking >> against nr_resets is not done as is visible from code below. >> >> >> static int zynqmp_reset_of_xlate(struct reset_controller_dev *rcdev, >> const struct of_phandle_args *reset_spec) >> { >> return reset_spec->args[0]; >> } > > Exactly, there is no xlate. These IDs are not suitable nor needed for > bindings. > >> >> >> And actually Xilinx Versal platform is using this for a while and you can find >> IDs description here. >> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/include/dt-bindings/reset/xlnx-versal-resets.h?h=v6.5-rc2 > > We cannot fix existing bindings, but we can fix future ones. > >> >> Xilinx ZynqMP is using IDs from 0 to 119 >> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/include/dt-bindings/reset/xlnx-zynqmp-resets.h?h=v6.5-rc2 >> >> >> but IDs itself are shifted by 1000: >> include/linux/firmware/xlnx-zynqmp.h:217: ZYNQMP_PM_RESET_START = 1000, >> #define ZYNQMP_RESET_ID ZYNQMP_PM_RESET_START >> >> static const struct zynqmp_reset_soc_data zynqmp_reset_data = { >> .reset_id = ZYNQMP_RESET_ID, >> .num_resets = ZYNQMP_NR_RESETS, >> }; >> >> static int zynqmp_reset_assert(struct reset_controller_dev *rcdev, >> unsigned long id) >> { >> struct zynqmp_reset_data *priv = to_zynqmp_reset_data(rcdev); >> >> return zynqmp_pm_reset_assert(priv->data->reset_id + id, >> PM_RESET_ACTION_ASSERT); >> } >> >> >> That numbers in DT are virtual no matter if you use ID from 0 to max or random >> values it is up to code to handle them. Checking nr_pins against ID is done in >> core but it is up to drivers. > > No, you confuse "virtual" and "ID". IDs are not virtual. IDs are real > and have representation in Linux driver. You do not need to define > anything virtual in the bindings. Not sure how you define ID itself. But HW doesn't know ID. HW knows only register which you can use to perform the reset. It is not really 128bit register where every bit targets to different IP. And this is SW-firmware interface like SCMI reset driver. Firmware is saying that ID 0 is QSPI, ID 1 is MMC. Their Linux driver is asking for nr_reset via firmware call which can be different for different SOC and that's fine and I have no problem with it. But only SCMI server is dictating that ID 0 is QSPI and ID 1 is MMC. Different SCMI server implementation can map it differently. >> In our case that IDs are coming from firmware and driver itself is just matching >> them. > > So they are the same as if coming from hardware - no need for IDs. It is hard to say what hardware here exactly is. From my perspective and I am not advocating not using IDs from 0 to max, it is just a number. If my firmware knows that QSPI reset is 0xc10402dU then I will just pass it to reach my goal which is reset QSPI IP. If you think that we should use IDs from 0 to max NR I am happy to pass this message to PM team and we should extend any SW to do translation between. Thanks, Michal