Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp1806464ybv; Fri, 21 Feb 2020 03:51:16 -0800 (PST) X-Google-Smtp-Source: APXvYqwmcO5TERA2edgy/7MOvBFuMOwW77AIi+uyrCnudrEcAYMATelPn+R3zi4Tx7/g02HG8MqY X-Received: by 2002:aca:5083:: with SMTP id e125mr1699230oib.96.1582285876268; Fri, 21 Feb 2020 03:51:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582285876; cv=none; d=google.com; s=arc-20160816; b=zZj805qu1ydSJQRsjn8iZwho3syGyz6EX7dGZA9ILc+OBm2TD+GewAJ5hAbNEXdGUz hmvCdHJYfwwCpSol8m/q1YDyOBnuIUvl1KBEXL4jLqDFCWVUGnf6GI2fG/uVWJgmcG/5 NtTLcCke1KH4oxNvifoeVQD54Q7tfN9rhkwzoS6txzrbdsOvRkvS9p69A/u3eQ9QfQ5i 01FKLgKWUW33oSrNcZRXs5w4BsWuWp9hAK8aFY8lsE+CuFzOhmYUNiH6Sz/DN3gMy62b l0prpP4JQhstCWI/tVvIkBvYnwhWpMQ9wY4PCYWGUjNR7/PI16K43aRSvhd+xImuCPDY bEKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:references:cc:to:subject:from; bh=ctUBs1ljjLPZnsUND67wTOa9ZB1Zsk0v0qfJ9vbb0zk=; b=PsAuxTZCXZje3k+o6SWWplt52JQwNZ2ZRhxT3KXZvV91vDybW5MVNHBbBolONEQvAx nst5vbBp+HMUjgXqb0kpQ4EQgKq/suRWhAKja79Oy/iSWXbojUfqcPeottUJGfkXmavu GED/CrRIBRvNoC9vp23qV7VAhpINPyq2Sftn7s1GrAhvO8FZ7mtNXVP9rqJ8qLijCsjt UWgjq40E/IR7a3McLLB+uMGb+eLjjAonLqed0sFTYLqb0lo7KToDrAKm1oKaxEg7nGQ/ +pvXjuROm96nkHyCxA1j4SduV/kbifzRzbwvEfLVlSY+AbbwAwO7dDT4zHZVf7KiLmTT f6zA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q65si710332oic.123.2020.02.21.03.51.02; Fri, 21 Feb 2020 03:51:16 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727277AbgBULtz (ORCPT + 99 others); Fri, 21 Feb 2020 06:49:55 -0500 Received: from lhrrgout.huawei.com ([185.176.76.210]:2454 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726934AbgBULtz (ORCPT ); Fri, 21 Feb 2020 06:49:55 -0500 Received: from lhreml709-cah.china.huawei.com (unknown [172.18.7.108]) by Forcepoint Email with ESMTP id 07C42219BF6427A28D49; Fri, 21 Feb 2020 11:49:53 +0000 (GMT) Received: from lhreml724-chm.china.huawei.com (10.201.108.75) by lhreml709-cah.china.huawei.com (10.201.108.32) with Microsoft SMTP Server (TLS) id 14.3.408.0; Fri, 21 Feb 2020 11:49:52 +0000 Received: from [127.0.0.1] (10.202.226.45) by lhreml724-chm.china.huawei.com (10.201.108.75) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Fri, 21 Feb 2020 11:49:51 +0000 From: John Garry Subject: Re: Questions about logic_pio To: Jiaxun Yang CC: "xuwei (O)" , bhelgaas , andyshevchenko , Arnd Bergmann , linux-kernel , Linux Mips References: <1705dbe62ce.10ae800394772.9222265269135747883@flygoat.com> <5E4E55F7.70800@hisilicon.com> <17062738bc0.c380503c6222.6801557833645076299@flygoat.com> <1ebf4461-eb37-ff58-1faf-dd24d83f85cf@huawei.com> <170632822e1.12fede49a6919.5706082545515934736@flygoat.com> <6c49e5e0-b6f2-fe23-caec-4742c3d1d3a0@huawei.com> <1706531b3a8.108e582396993.7792774458896054798@flygoat.com> Message-ID: <65fffffa-2c74-aa09-7fdb-29a7200d7ac4@huawei.com> Date: Fri, 21 Feb 2020 11:49:45 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.1.2 MIME-Version: 1.0 In-Reply-To: <1706531b3a8.108e582396993.7792774458896054798@flygoat.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.202.226.45] X-ClientProxiedBy: lhreml712-chm.china.huawei.com (10.201.108.63) To lhreml724-chm.china.huawei.com (10.201.108.75) X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 21/02/2020 00:42, Jiaxun Yang wrote: > > > > I will add this may not cover your need, as you probably cannot deal > > with any logical PIO <-> ISA translation without modifying the device > > driver. For this, we may need to reserve the first 0x4000 in logical PIO > > space for this sort of legacy host. > > Hi, > > After thinking twice, I realized that the most convenient way for me is > adding an option to get rid of the mess of logic PIO. MIPS system is emulating > x86's behavior, while logic PIO isn't designed for such platform. It was designed for archs which define PCI_IOBASE for PCI MMIO-based or IndirectIO-based IO port access. > > Or probably I need a variation of Logic PIO, which leave MMIO space AS-IS > (not try to reallocate it) That does not work if add a PCI host with MMIO-based IO port regions into the mix. It only so happens today that for mips you have a single MMIO-based IO port region, and you have IO port base for that region conveniently @ 0x0. Then your drivers can have fixed IO port addresses. For dealing with multiple MMIO-based IO ports regions - which is the case for PCI host bridges - then you need to map those MMIO-based IO port regions to different regions in IO port space. > but still preserving higher 0x4000 for indirect access. Then there is no space for PCI MMIO-based IO ports. > > Thanks a lot! > > > > That would not be a bad thing - see > >https://lore.kernel.org/linux-pci/1560262374-67875-1-git-send-email-john.garry@huawei.com/ > > > > > > > > > > This driver deals with legacy IO ports where we need to bitbang