Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp3026459imw; Sun, 10 Jul 2022 23:20:13 -0700 (PDT) X-Google-Smtp-Source: AGRyM1t6sg7LojUSGHZftuOQqyoGg+Lfy/l9pvJ9Fs1zEpwgd12VqKhcpBbn73d6YqgidmfBBvSj X-Received: by 2002:aa7:92d2:0:b0:51b:4d60:6475 with SMTP id k18-20020aa792d2000000b0051b4d606475mr16761658pfa.73.1657520412793; Sun, 10 Jul 2022 23:20:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657520412; cv=none; d=google.com; s=arc-20160816; b=NlvZTEdrdqwKjzwmlaGU2G8FSRVt5uCQs/YHKQ9BcToNnYHXj29ORoaSl9UV6zRsr/ IQ1WplQdYAF9oehWDHo5NRwT0s0K54T9XnIymzkRJ347FnQ49lnEKsYTHjN1XvNLMUtw Dj/M1V7u78Uq8UnDnXkrYK6yA/y0a3OWDWFzd2HIhw7oYX4EjsYkdPuSaf5PTLbFa956 FeAHhNVPwM6H4FNeZhRdKUXdSTv4T4H9CzkUDf7h7f3Str7WBIgGcaThxLDUoK0bABHX GxgapSdfPUXYNg8IdNnstPtPCmVlN0tTu0g1q90HaMQX48P/ns5DxsGq1gPim5U2Mrwn AYTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version; bh=A8fJSCvOdgBBikRKci2IbN7AFqswizKp5J54h5iVV8o=; b=dF/N7zerjIECU6T3TJAgYuJZoVEBOfXXZzhsKvavGHE5lF+SRKYGz8IXuUznVIUslL mUnlUfVn9SK9HEb5iM4CpbCnio1CuZbLrSzpZGuFM5js8i3JtWN9H6PrwqZdYsIBmT1c 58xm2zIORWJ2ab2ibr36HUjl5NtZwcdeInTi3poi9fXMp7rsp6V6p0pmfHN1ycn8VQQm REMOhou9DHLL69zXxkanbXnNDhJkGA48P658VgS3qPN2Onpi8rSUyBpkNoCVJKKRnPu+ ILGtQl2yVDIhC8PIvLd1RPEdLJeXMNcXrqrW/JIU0Xe2HmDyknKPo3wJWWvuNERLdFsV 7+5w== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q1-20020a056a00084100b005107be11e23si10564656pfk.137.2022.07.10.23.20.00; Sun, 10 Jul 2022 23:20:12 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229637AbiGKGFY (ORCPT + 99 others); Mon, 11 Jul 2022 02:05:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47918 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229469AbiGKGFX (ORCPT ); Mon, 11 Jul 2022 02:05:23 -0400 Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.17.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4F4E311449 for ; Sun, 10 Jul 2022 23:05:21 -0700 (PDT) Received: from mail-yb1-f176.google.com ([209.85.219.176]) by mrelayeu.kundenserver.de (mreue109 [213.165.67.113]) with ESMTPSA (Nemesis) id 1Mdvyi-1nbzgn1KcA-00b0Cw for ; Mon, 11 Jul 2022 08:05:19 +0200 Received: by mail-yb1-f176.google.com with SMTP id f73so7091033yba.10 for ; Sun, 10 Jul 2022 23:05:19 -0700 (PDT) X-Gm-Message-State: AJIora+vCcNHGpa9Hu54R1RrhJuQ9ibKWWyYA4gQs0XrCN1hcTVI2B/o 00NZ3V0+1XOz+JURGmdSwfkaOEkr0RIXdLODmhI= X-Received: by 2002:a25:3b05:0:b0:66e:c216:4da3 with SMTP id i5-20020a253b05000000b0066ec2164da3mr16437619yba.550.1657519518013; Sun, 10 Jul 2022 23:05:18 -0700 (PDT) MIME-Version: 1.0 References: <20220709211549.1163327-1-shorne@gmail.com> <20220709211549.1163327-2-shorne@gmail.com> In-Reply-To: From: Arnd Bergmann Date: Mon, 11 Jul 2022 08:05:01 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 1/2] openrisc: Add pci bus support To: Stafford Horne Cc: Arnd Bergmann , LKML , Openrisc , Jonas Bonn , Stefan Kristiansson , Peter Zijlstra , Palmer Dabbelt Content-Type: text/plain; charset="UTF-8" X-Provags-ID: V03:K1:ryWmCXIoNP2HiCshAxaiFMmqRJCSx8bDSy94b7TpXnDeGNAgtxP 8aUXozGwsxZdhWQKEYIE5v7wyiPQJ+OWgH6DTNCYZdLqWJAV95Bgzvy6d5sXTMUxOmTC415 KYORE/yqAYX27hBcdWUt3UJ9Rs3zLCY7iHVED5PZEqQxRN3cMSqP4pFwdQKyR7jAPBQlw3V TTKYrIn37NWpl9iA/ApiQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:NfQssdFs/iM=:FsfmL0wsR7xSst/WdxIH7M nVolL2lREUvWKjDzVFZf0Kvi9221yz70SPJPrOo6neG24RqXeFThZZhzeqsoR7o9zX8r2DOm5 0MUMRkV1kCupU8XHUyDomBjgKmLgelHyx2E3cpKVs/C8Z8SPK/u5sNIWZRyN7VThamJkV/z1J 3VpzSUYDADvzDHraukoO5pZs8rNBRV6FyzM7MGm0HMckyzC9DnUaODJjGLSnr2iOYJepbMvL4 HXDntr/tScg7wdJomUNdLB3B0WEcvTSALgOb4kJTkOV8c0rup9NalHGJhpGX0V/pZPrk6Gz1c Qq1D3hjjkeCyud/35fhTtCr6t77tSVjgRY1srvd9kyynfxpVTDFeSmvS8/SWLcdf0vc5xbp/f it/FeinSQJv2dKS+MVvU8wD3xTTL8cn1wm1ZNN3TO0T7yeEKWU41Sl9gHzMb47y3XQn+iWsJE C/sf/p7cbJzgLXLugbXiCUjsELT6KoQgRtQ0HG9Tw4mckADw3syjWwXcgPxNhUEtyD8vDurhk hQlbfnrxsjn50NwxrxgtlCqrOdGu6XSzrns2QQ1UfwC7z9cQliKlhltgnDA9xp7QE2Y++0viR eIJKw0mLbO0GQ/VZ1Ij/yE+LrtReRrwUf990RyAqrT2rFLrMWcHA6aSVvQxc37dCLVW48PG2n QP1RSpZx9tr/S4UMdKlYjY/TYrAtNqZq7IuriavaoPiXY/6McMwu25nZTeW9/4cyzI6Sbqicg 3hmIzJdkZcs3LwKY1FNt9yfuoAQzTRsfYK9a9PLN00rzdsU8z2qzpgPfJMuy9RHAp+qwsJQ1h aOsHyMUfE0ps3LpaJgIojasT+x17NM0dUyTCTPkFBcUcmBQfQeSdXTR+rUHKoQCkX0oxMVFpL d3E/dV7Uo0GJ2pqqnlLg== X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,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 Sun, Jul 10, 2022 at 11:22 PM Stafford Horne wrote: > On Sun, Jul 10, 2022 at 05:54:22PM +0200, Arnd Bergmann wrote: > > OK, I see, but I think IO_SPACE_LIMIT needs to be defined as something other > than 0. It is used to define kernel/resource.c's ioport_resource. I think the kernel/resource.c one is fine, it just means that any attempt to register an I/O port resource below the 0-length root resource will fail, which is what you need when inb/outb cannot be used. > For example on risc-v they set it to 16MB. > > I will setup a LIMIT smaller than 4GB and add a PCI_IOBASE. Do you support multiple PCI domains? Usually you want at most 64KB per domain, as that is the traditional limit and what the normal pci_remap_iospace() will assign to a domain. The 16MB limit for riscv is way more than what one may need on a 32-bit machine, since that is enough for 4096 domains even with the largest possible I/O space, and each domain has up to 65536 PCI functions attached to it. > > Most PCI controller are however able to map I/O ports into the > > physical address space of the CPU, and in that case you can just > > define an otherwise unused address as PCI_IOBASE and map the > > ports there from the PCI host bridge driver. > > OK, understood, do you think this needs to be documented in a architecture > manual? Maybe it's fine for it to be linux specific. Of course it's Linux specific, but it's also architecture specific since there are different ways of making I/O space available: Generally you can leave it out completely, unless you have to support devices from two decades ago, some architectures that existed back then have custom instructions, some hardcode part of the virtual address space to access MMIO registers at a fixed location, some rely on an indirect method going through a particular MMIO register to access all I/O space, and some use a per hostbridge window that gets mapped using pci_remap_iospace(). Do you have a driver for your host bridge available somewhere? It should be clear from that driver which method you need. Arnd