Received: by 2002:a05:7412:8521:b0:e2:908c:2ebd with SMTP id t33csp2039704rdf; Mon, 6 Nov 2023 03:02:35 -0800 (PST) X-Google-Smtp-Source: AGHT+IErEIRu8XwZI9bklIqop9G+c3r0ksMThl0ohKH+IyAiOWNjqif/NpQTVME8SZx8wVS0xTir X-Received: by 2002:a17:902:c412:b0:1cc:c273:603 with SMTP id k18-20020a170902c41200b001ccc2730603mr3409590plk.42.1699268555364; Mon, 06 Nov 2023 03:02:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699268555; cv=none; d=google.com; s=arc-20160816; b=rDFZ6r/O2ZFGBPhMqo3y5TgWRa4/G4S5GbrSeCXHH0URSBrv38aItMltlSp0WTWM2U 0x8PxuRcBiCZKnUyt5b//MkMnmE13HL/FFDNGNHjX8Vn7inXhKiy2OgX5ZbOJInNo7SS Zaf9Kr65nZ8ZY3nUzOBdPAFdMB+qHLw91U6VxCG9g3cF91s2WpxNqlBDA7iUDa18f9KX Y1z1NA9xbH5lXulE3IGB1aFj3dxE4YP+DxHw/0gEsVKLfed1OzuzNxAIvp74FJ3exShz +7KHUkt+Y8hpjrPIGGWL7rA/Gpsup+/RN6YknHLGnP2oxGA0cG/hriGtjdmRmEAI/qD8 wsxw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :mime-version:accept-language:in-reply-to:references:message-id:date :thread-index:thread-topic:subject:cc:to:from; bh=iJJfDGy6RL7Tn0gg+HM0hVoMof7cSeH9cpO/mk1Bpdk=; fh=/0VvdSx1JaNUwDoDw0ockuIyowXioJu7p4ZKORa+2pI=; b=wR/N29WtaEFb5pu8HVQsvngY7JKMlj9d3MZxYfr/2aA3yKUMYUqUBbMjRZfeoQ3Kc3 omq5DZHXoz+swYZ7+pGkBhArq5CCeX/eTK4QOLtq17mxeU052SGQ5L/vAkwmRGoPT2gt AjAjXF/ALzXJvPivYmOdUTzok7ylAX7bSaHEJDZtLPW2uhE7S91TGupBKVvcKFrevy2s 3sbTd2l7+g1rCcl0qe9qutHhtIdJxLsm/TMSzfc3EyxCLmM1KM7DMDEIHVVhsq54xGoD nj80Ja8uoVVbcvSI5rJ4XFEHGJdW5Hp0IxeSzttyIDOyo39AasFgflrx6x5sVe3VGMNt bQUw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=aculab.com Return-Path: Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id kn3-20020a170903078300b001cc1194e9d3si7299723plb.217.2023.11.06.03.02.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Nov 2023 03:02:35 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=aculab.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id E924980A3661; Mon, 6 Nov 2023 03:02:32 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229478AbjKFLCW convert rfc822-to-8bit (ORCPT + 99 others); Mon, 6 Nov 2023 06:02:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55874 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231348AbjKFLCT (ORCPT ); Mon, 6 Nov 2023 06:02:19 -0500 Received: from eu-smtp-delivery-151.mimecast.com (eu-smtp-delivery-151.mimecast.com [185.58.85.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1F8EDCC for ; Mon, 6 Nov 2023 03:02:15 -0800 (PST) Received: from AcuMS.aculab.com (156.67.243.121 [156.67.243.121]) by relay.mimecast.com with ESMTP with both STARTTLS and AUTH (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id uk-mta-44-NNK0qxekP9KmzfnMHlHj9Q-1; Mon, 06 Nov 2023 11:02:13 +0000 X-MC-Unique: NNK0qxekP9KmzfnMHlHj9Q-1 Received: from AcuMS.Aculab.com (10.202.163.4) by AcuMS.aculab.com (10.202.163.4) with Microsoft SMTP Server (TLS) id 15.0.1497.48; Mon, 6 Nov 2023 11:02:12 +0000 Received: from AcuMS.Aculab.com ([::1]) by AcuMS.aculab.com ([::1]) with mapi id 15.00.1497.048; Mon, 6 Nov 2023 11:02:12 +0000 From: David Laight To: 'David Epping' CC: "linux-arm-kernel@lists.infradead.org" , Dinh Nguyen , Lorenzo Pieralisi , "linux-kernel@vger.kernel.org" , "linux-pci@vger.kernel.org" , Bjorn Helgaas , =?iso-8859-2?Q?Krzysztof_Wilczy=F1ski?= Subject: RE: mach-socfpga: PCIe Root IO TLP support for Cyclone V Thread-Topic: mach-socfpga: PCIe Root IO TLP support for Cyclone V Thread-Index: AQHaC+rcwX/RJWhaCEGpb3NmFV615LBrmEmQgAGENICAAApRcA== Date: Mon, 6 Nov 2023 11:02:12 +0000 Message-ID: <531d4fadcc694f9582af54f3998720b4@AcuMS.aculab.com> References: In-Reply-To: Accept-Language: en-GB, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.202.205.107] MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: aculab.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Mon, 06 Nov 2023 03:02:33 -0800 (PST) From: David Epping > Sent: 06 November 2023 10:15 > > On Sun, Nov 05, 2023 at 11:20:03AM +0000, David Laight wrote: ... > > If you are building the FPGA image then all the logic to convert the > > memory mapped slave cycles (into the fpga logic) is supplied as > > verilog source. > > The CPU subsystem and the PCIe IP are hard IP in silicon and can not be altered. If you look carefully you'll find that the 'hard IP' block stops with a streaming interface that carries the data TLP. All the logic to convert the TLP into Avalon memory cycles is verilog source. So, at least in principle, it is modifiable. With a bit of effort it is possible to trace the TLP into fpga memory. (We had to modify the verilog to expose the TX TLP.) Even allowing for development time it was probably cheaper than buying a PCIe monitor! > They are connected via the FPGA logic, though, and I agree one approach could be to intercept their > communication with custom HDL. > However, Linux uses the exact same PCIe hard IP registers required for IO TLPs to send Config TLPs. > Every TLP requires multiple accesses to multiple registers, so locking between FPGA logic and Linux > transactions would be required. > I'm not saying that this is impossible, but I don't think it can be robust without a Linux software > change. > A software only solution has the benefit of being available to all users of such an FPGA, without > access to that special logic. I saw/checked you'd added a lock, didn't see it was the same one used for config space accesses. > > I thought that all recent endpoints were required [1] to work with > > just memory BARs - even going back to the later PCI versions. > > So I'm surprised a PCIe endpoint need an IO BAR. > > The AX99100 implements a so called "Legacy Endpoint" and is thus allowed to > rely on support for IO space. > I guess this choice was made to stay driver-compatible to the PCI version, > although I don't know the ancestry if this product. A lot of PCI devices solved this by adding a memory BAR that mapped exactly the same registers. David - Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK Registration No: 1397386 (Wales)