Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp4083722rwe; Tue, 30 Aug 2022 04:29:47 -0700 (PDT) X-Google-Smtp-Source: AA6agR7DbMwyj9S6SN8P2zWxRSX3r8lTZW2SfOjsXoBnE2M3UsqC99AjBiaPzkn7mGTxHq1xFsaY X-Received: by 2002:a05:6402:2816:b0:434:ed38:16f3 with SMTP id h22-20020a056402281600b00434ed3816f3mr20001251ede.116.1661858986932; Tue, 30 Aug 2022 04:29:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661858986; cv=none; d=google.com; s=arc-20160816; b=Fkj2VXFlaQ3cWNzHzfN6Mfi2avp9q/Evz9BhVjCp5ZxrE1c/h7i8VQtXsMYJyLAY3I 7tJ++HdcSSEQbEzBL47aTAx30YjbfvTARfJ8x2SeB2QnfZ0pLw51jInsUU5DvJh1jBFC BxEDR+MSyh9Ul6P+t347B3AaEbnRsAjyxNJTrDJyvm0ELFvb8gPaO/8A7FKVNGeqorOB BMedZ5W3IlI6zx9DTU+/Xt8kMd86E06HQexWpXc0kZNgF31r7nCBm/OstFM7PxwCYpRC fPap9swiY4fF9lhq6mFzRxNOCuRi55Q9diJau78ViiBv6CQbrI0vupb4+ZsKpSB7O1m3 083Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=CgHPkgsZxsYkhwwQqBPxTbVQ7YmcqGhHjNC7diztTuU=; b=VOp+WajH8xLe2a1TqGTYwVNWjX8kwojz482yzIcuIGgEijko6tBH7tVru4ugXgHXwg r+Y80gj59gfsSPfRRzgzY+E3wsvb8vzf3s5UuaBxWt8yss+dNPPJyTXXWsueI7fSnks1 4yuGJurt3Oj4c7cpFG4ab/yRb/4nikoVP7ccZ0+kKqV5p4Msrmj/0fIfxfMcjEilHDX9 gKxZzuKojQe5sd/vjwFr60W/hKJ/LISh7WE57SgRlyUsCrU+O7Df43X1ByZEtSv2yQT6 XewWkkUIWnwoULHBLsGqH1hyd20ZPHH3U0RNLfu6u6q3f0RM/+u54qPK5NRqEVpWTV1T hOEA== ARC-Authentication-Results: i=1; mx.google.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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hv8-20020a17090760c800b007309350f2f9si1358278ejc.555.2022.08.30.04.29.20; Tue, 30 Aug 2022 04:29:46 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229766AbiH3L0D (ORCPT + 99 others); Tue, 30 Aug 2022 07:26:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51168 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229559AbiH3L0B (ORCPT ); Tue, 30 Aug 2022 07:26:01 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 525ACBB01F; Tue, 30 Aug 2022 04:26:00 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 2A4EA23A; Tue, 30 Aug 2022 04:26:06 -0700 (PDT) Received: from [10.57.13.45] (unknown [10.57.13.45]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 0A5443F71A; Tue, 30 Aug 2022 04:25:55 -0700 (PDT) Message-ID: <2db3b103-7034-6c0d-4ec8-caae7654b264@arm.com> Date: Tue, 30 Aug 2022 12:25:49 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; rv:102.0) Gecko/20100101 Thunderbird/102.2.0 Subject: Re: [RFC PATCH v2 2/6] bus/cdx: add the cdx bus driver Content-Language: en-GB To: "Gupta, Nipun" , Jason Gunthorpe Cc: Saravana Kannan , Greg KH , "robh+dt@kernel.org" , "krzysztof.kozlowski+dt@linaro.org" , "rafael@kernel.org" , "eric.auger@redhat.com" , "alex.williamson@redhat.com" , "cohuck@redhat.com" , "Gupta, Puneet (DCG-ENG)" , "song.bao.hua@hisilicon.com" , "mchehab+huawei@kernel.org" , "maz@kernel.org" , "f.fainelli@gmail.com" , "jeffrey.l.hugo@gmail.com" , "Michael.Srba@seznam.cz" , "mani@kernel.org" , "yishaih@nvidia.com" , "linux-kernel@vger.kernel.org" , "devicetree@vger.kernel.org" , "kvm@vger.kernel.org" , "okaya@kernel.org" , "Anand, Harpreet" , "Agarwal, Nikhil" , "Simek, Michal" , "git (AMD-Xilinx)" References: <20220817150542.483291-3-nipun.gupta@amd.com> <20220824233122.GA4068@nvidia.com> From: Robin Murphy In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham 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 2022-08-30 08:06, Gupta, Nipun wrote: > [AMD Official Use Only - General] > > > >> -----Original Message----- >> From: Jason Gunthorpe >> Sent: Monday, August 29, 2022 9:02 PM >> To: Gupta, Nipun >> Cc: Robin Murphy ; Saravana Kannan >> ; Greg KH ; >> robh+dt@kernel.org; krzysztof.kozlowski+dt@linaro.org; rafael@kernel.org; >> eric.auger@redhat.com; alex.williamson@redhat.com; cohuck@redhat.com; >> Gupta, Puneet (DCG-ENG) ; >> song.bao.hua@hisilicon.com; mchehab+huawei@kernel.org; >> maz@kernel.org; f.fainelli@gmail.com; jeffrey.l.hugo@gmail.com; >> Michael.Srba@seznam.cz; mani@kernel.org; yishaih@nvidia.com; linux- >> kernel@vger.kernel.org; devicetree@vger.kernel.org; kvm@vger.kernel.org; >> okaya@kernel.org; Anand, Harpreet ; Agarwal, >> Nikhil ; Simek, Michal ; >> git (AMD-Xilinx) >> Subject: Re: [RFC PATCH v2 2/6] bus/cdx: add the cdx bus driver >> >> [CAUTION: External Email] >> >> On Mon, Aug 29, 2022 at 04:49:02AM +0000, Gupta, Nipun wrote: >> >>> Devices are created in FPFGA with a CDX wrapper, and CDX >> controller(firmware) >>> reads that CDX wrapper to find out new devices. Host driver then interacts >> with >>> firmware to find newly discovered devices. This bus aligns with PCI >> infrastructure. >>> It happens to be an embedded interface as opposed to off-chip >> connection. >> >> Why do you need an FW in all of this? >> >> And why do you need DT at all? > > We need DT to describe the CDX controller only, similar to > how PCI controller is described in DT. PCI devices are > never enumerated in DT. All children are to be dynamically > discovered. > > Children devices do not require DT as they will be discovered > by the bus driver. > > Like PCI controller talks to PCI device over PCI spec defined channel, > we need CDX controller to talk to CDX device over a custom > defined (FW managed) channel. OK, thanks for clarifying - it actually sounds quite cool :) I think it's clear now that this should be a a full-fledged bus implementation. Note that if the CDX interface provides a way to query arbitrary properties beyond standard resources then you may well also want your own fwnode type to hook into the device_property APIs too. Yes, it then means a bit more work adapting individual drivers too, but that should be far cleaner in the long run, and there's already plenty of precedent for IPs which exist with multiple standard interfaces for PCI/USB/SDIO/platform MMIO/etc. Plus it means that if CDX ever makes its way into PCIe-attached FPGA cards which can be used on non-OF systems, you've not painted yourself into a corner. Thanks, Robin.