Received: by 2002:ab2:6203:0:b0:1f5:f2ab:c469 with SMTP id o3csp2100386lqt; Mon, 22 Apr 2024 01:03:07 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUYJxe0uJpDdPjFl8zACPga2V0HaWYQdYo3NArPdFCGGrbIOFjxJUGiFu5ONaTJL4sgWX0k+z/fM78X6pmA0bzz5LZw7C3zCikNh+YBeA== X-Google-Smtp-Source: AGHT+IEbr+wEV9y3HgoP40Uweu2jfYwSGprvTwjkPVwyn1FjUG7vUFKN/PbVLe+XoixNMGPa617m X-Received: by 2002:a17:90a:4412:b0:2ac:dbec:2d6f with SMTP id s18-20020a17090a441200b002acdbec2d6fmr6090989pjg.39.1713772987612; Mon, 22 Apr 2024 01:03:07 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713772987; cv=pass; d=google.com; s=arc-20160816; b=dVE8SaUk95MXV3WyPtnxGZRz/FIDnx8cKZQWHrLCz5KalgfOwfc1hobjbuI+nMs9wV pgN8jctcCvzLW0WGlHgoDQAhKGmiInTr1CnW/faA/Pnicv69RWKbdB7V7cSOxe2p+FwF 6dG/JjEB+fWvmC5sooxtEFl6Wc9bu5Uq+tWAgwUgWhNjI9bFD9m0vyjkDT4bWvWzn15g 5Kcb1zW1keuT6HvzkV8EmnzvZ3rtXQp3I46XU7ElaAQb1tVgIv0LipDjgdLsjWcXoHoj PHWzlqcNTd4R2jWNW2sG6whs6v4paby/mjEzzRna/m/vOyq1cSkvZTxafvEWMyxUe3QV iPvg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:subject:cc:to:date:from; bh=M02SKfLeZBvwZU4EAMWNSJqt1SSThyaurEET5OhNlqM=; fh=qnST5YBg4hQXEfc8DEK6gnXtZy35OA5ILFVd4WUdRBY=; b=yUhty0UbA5ji8/Zeo5P+FzYtbxdIEYZ/hrn9Y0fAgLDX42+UAXsmVHU3IkwxeRXaNr dvTt8DekUk4NDCyaiYH2ICHaFn7RQ0DS9KuHl7ToTCmK6/fMcZvsDB+EMc8Kav600Oes KkoJXuYbbbKSPSSlvpDbn8aOIrOVQwaKi1sDMdOlFxJeYSCDQun00H+fP9i74g14J2pC 7WPppLy1lXTsOaPdhyVFAIG20MTd/uTihLEZkDsk0jF9VmJLQ8TpFSVwa1S3jh1T1yU6 /EG5/GSoI9EpE2hwWTFWO3olgy7X+ZQI/t6KGSWdTBYRMFkJcfNYXdm8xU/xH+15ypYe vpnQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-152924-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-152924-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id d17-20020a634f11000000b005dcbb6a2cccsi7286504pgb.44.2024.04.22.01.03.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Apr 2024 01:03:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-152924-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-152924-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-152924-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com 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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 6C841B21124 for ; Mon, 22 Apr 2024 08:00:56 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A14114D58A; Mon, 22 Apr 2024 08:00:48 +0000 (UTC) Received: from fgw20-7.mail.saunalahti.fi (fgw20-7.mail.saunalahti.fi [62.142.5.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A8FA94D131 for ; Mon, 22 Apr 2024 08:00:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=62.142.5.81 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713772848; cv=none; b=kwZVYjf3reTjudKm/9uoJGUbW+NLn/1qxVBC3vgD3qupoudkSz3Ie0XyNYv9uo4oBP94f27KF7SDewQUTXIYEBFmqh2v1/cQDJCCDQ+0R03CFvU/Clx7N7U+VLXajdDv/gtcaDz6Bm4jBXbnrj1K8+baeeBPL7pusF1s1h7nD5U= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713772848; c=relaxed/simple; bh=f0yd3qigJhx90p0yxgPbw6HH1vaR/nNVChrBqreGcLg=; h=From:Date:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=h5RP5Y/MYao7d8+QcCxQHiZtU1BXPPNptV6lHxlk4vNPSa4exUKCNV2zs2qg0EvZD6sKw4ZlcNBdQytatEmXUOV0x1WKyRGCDu/K484JpDR9uI5N/dSFrNXZ/+hoYGBZ0uswfy4UKoORJVkAgaP9Gj2hHrYLUzCPPCSSUmPIxAc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com; spf=fail smtp.mailfrom=gmail.com; arc=none smtp.client-ip=62.142.5.81 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=gmail.com Received: from localhost (88-113-25-208.elisa-laajakaista.fi [88.113.25.208]) by fgw21.mail.saunalahti.fi (Halon) with ESMTP id 6b0fe1b6-007e-11ef-abf4-005056bdd08f; Mon, 22 Apr 2024 11:00:43 +0300 (EEST) From: Andy Shevchenko Date: Mon, 22 Apr 2024 11:00:43 +0300 To: Bjorn Helgaas Cc: Chris Packham , "linux-kernel@vger.kernel.org" , "linux-pci@vger.kernel.org" , "linux-acpi@vger.kernel.org" , Herve Codina Subject: Re: local bus enumeration beyond a PCI device Message-ID: References: <20240418184531.GA245970@bhelgaas> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20240418184531.GA245970@bhelgaas> Thu, Apr 18, 2024 at 01:45:31PM -0500, Bjorn Helgaas kirjoitti: > On Thu, Apr 18, 2024 at 12:24:06AM +0000, Chris Packham wrote: > > We've got a custom x86_64 based design that is using an ASIX9100 to > > provide a PCI to local bus bridge. Attached to that local bus is an FPGA > > which mostly provides some GPIOs accessed via registers on the local > > bus. Right now we've got a custom driver that bundles everything > > together so effectively we've got a PCI device that provides GPIOs. > > What's the local bus? The ASIX9100 (for which Google doesn't find any > details) would have a PCI interface on the primary (upstream) side. > What's the local bus on the secondary (downstream) side? Below you > mention "PCI bridge", which normally means both the primary and > secondary sides are PCI buses. > > If the local bus is not PCI, I guess the ASIX9100 would look to the OS > like an endpoint, i.e., PCI_HEADER_TYPE_NORMAL, and the ASIX9100 > driver would handle any "bridge" functionality completely internally? > > Maybe Herve's work at > https://lore.kernel.org/r/20240325153919.199337-1-herve.codina@bootlin.com > would be relevant? +1 here. Thought the same when seeing the original message from Chris. > > But as things can change based on the FPGA program I'd like some > > flexibility to treat it separately from the PCI bridge. So really I'd > > like to have a PCI device driver for the ASIX9100 that provides a local > > bus controller and a (platform?) driver for the FPGA that provides the > > GPIOs where I can have different compatibles for the different > > implementations. > > > > Then in the ACPI overlay I'd have something like > > > > ??? Scope (\_SB.PCI0.D0B0) > > ??? { > > ??????? Device (ASIX) > > ??????? { > > ??????????? Name (_ADR, 0x0000) > > > > ??? ??? ??? Device (FPGA) > > ??? ??? ??? { > > ??? ??? ??? ??? ??? ??? Name (_HID, "PRP0001") > > ??? ??? ??? ??? ??? ??? Name (_DSD, Package () > > ??? ??? ??? ??? ??? ??? { > > ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), > > ??? ??? ??? ??? ??? ??? ??? ??? ??? Package () > > ??? ??? ??? ??? ??? ??? ??? ??? ??? { > > ??? ??? ??? ??? ??? ??? ??? ??? ??? ??? ??? ??? Package () { > > "compatible", "my-platform-driver-for-fpga" }, > > ??? ??? ??? ??? ??? ??? ??? ??? ??? } > > ??? ??? ??? ??? ??? ??? }) > > ??? ??? ??? } > > ??????? } > > ??? } > > > > ?? Scope(\_SB) > > ?? { > > ??? ??? Device(OTHR) > > ??? ??? { > > ??? ??? ??? GpioIo (Exclusive, PullUp, 0, 0, IoRestrictionInputOnly, > > "\\_SB.PCI0.D0B0.ASIX.FPGA",) { 0 } > > ??? ??? } > > ?? } > > > > Is it even possible to register a host controller for another platform bus? -- With Best Regards, Andy Shevchenko