Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp2096842ybv; Fri, 21 Feb 2020 08:50:07 -0800 (PST) X-Google-Smtp-Source: APXvYqyMyvwnB1nDqUt9TQqMaAsiFilPcWgZZiSUNpH22NrqXKqj1UFCLwthgPryFNzMS5u3t6yA X-Received: by 2002:a9d:4801:: with SMTP id c1mr29911084otf.258.1582303807380; Fri, 21 Feb 2020 08:50:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582303807; cv=none; d=google.com; s=arc-20160816; b=WrDHarSnVYuXttQEqXAsM9Boe/nnsBhn8ei5Txp2KrIXfHS8fvdJO67y3zQATKNxfB LyN2oRixtR5cM7gaMwqzR/R3xymEpa/1RVi26DOfyTFlt9ASaLHtwMN3CucGvzieT9Mo 78HVa+n6fVeDYpgPjKNb1K85xdUa1BBpWgxEEFmotmeQ6Y1Q/lvzTeW0QLb1ZQMLYo0+ 4f9PSwzKyqc6oAcacmbAMKi4XxOYX425QsXLTYKcKl7N3HF40PpkVpOoCFRqdkH/DCLf l9/gPoDtqCP3jeZ893uWev7SgP4ZP7RYwTiw4Tsdt8xRPsfBImKYb4zlKWMSj8+i5J6L VnVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:from:cc:to:subject :content-transfer-encoding:mime-version:references:in-reply-to :user-agent:date:dkim-signature; bh=+5iSFkto5lD3XI8WPHwTtnFf14s4AHqOXFojmaY+UCs=; b=it/0tb2eBxEZZaVBumvTkABYuVkgCETtzBcqTWOv4gpZOwpAbXQRuliQDSZudUaQR1 hgi0To0okGne/Nsj7ABaA9JOM5vhDCCVbwDx+s3KrW6uT6DDT8WAWcDh6Y3mZtfv02vk r+sgrHVkbswhoS184Jc17E3JGysSBZp6RgR37q3ege+EPKNvzxUwg5mugqrkeXK7ZZY+ XzCwbhCa1ZkltHkLlkV9QjGSawqG/p+LX4UfsrttgbvnY4vFdtrIATkJdkaJbOqqOs13 qitPGOboFrwyFBifYlL5Fc2OcC/qFx+7y29GFagtVkuFus4WXNtIws9pv5Sh1UE6vXmM czBQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@flygoat.com header.s=mail header.b=IStQf0pT; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=flygoat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j6si1705765otp.17.2020.02.21.08.49.53; Fri, 21 Feb 2020 08:50:07 -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; dkim=fail header.i=@flygoat.com header.s=mail header.b=IStQf0pT; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=flygoat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727469AbgBUQsp (ORCPT + 99 others); Fri, 21 Feb 2020 11:48:45 -0500 Received: from sender3-op-o12.zoho.com.cn ([124.251.121.243]:17811 "EHLO sender3-op-o12.zoho.com.cn" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726387AbgBUQso (ORCPT ); Fri, 21 Feb 2020 11:48:44 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1582303665; s=mail; d=flygoat.com; i=jiaxun.yang@flygoat.com; h=Date:In-Reply-To:References:MIME-Version:Content-Type:Content-Transfer-Encoding:Subject:To:CC:From:Message-ID; bh=+5iSFkto5lD3XI8WPHwTtnFf14s4AHqOXFojmaY+UCs=; b=IStQf0pTzFKTmnXGIQfMKQurB4UDBwnC8ONX0+EZ5e3n59UCQZPEkCbp+f+jdnXY yxjgFGLFDFCs1Hb2d3bR0Rx2pB7wP/OLYaiwuc9N1iNp9VzSErv5UdaAA48ZjJ5YMgO /aqspSqhdUMpwO5t4dwcWCVzgz/Lwt4IuNWzV9RE= Received: from [26.26.26.1] (183.156.46.156 [183.156.46.156]) by mx.zoho.com.cn with SMTPS id 1582303661935135.86216680534437; Sat, 22 Feb 2020 00:47:41 +0800 (CST) Date: Sat, 22 Feb 2020 00:47:39 +0800 User-Agent: K-9 Mail for Android In-Reply-To: <65fffffa-2c74-aa09-7fdb-29a7200d7ac4@huawei.com> 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> <65fffffa-2c74-aa09-7fdb-29a7200d7ac4@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: Questions about logic_pio To: John Garry CC: "xuwei (O)" , bhelgaas , andyshevchenko , Arnd Bergmann , linux-kernel , Linux Mips From: Jiaxun Yang Message-ID: X-ZohoCNMailClient: External Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org =E4=BA=8E 2020=E5=B9=B42=E6=9C=8821=E6=97=A5 GMT+08:00 =E4=B8=8B=E5=8D=887= :49:45, John Garry =E5=86=99=E5=88=B0: >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=2E For this, we may need to reserve the first 0x4000 in >logical PIO >> > space for this sort of legacy host=2E >>=20 >> Hi, >>=20 >> 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=2E MIPS system is >emulating >> x86's behavior, while logic PIO isn't designed for such platform=2E > >It was designed for archs which define PCI_IOBASE for PCI MMIO-based or > >IndirectIO-based IO port access=2E > >>=20 >> 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=20 >into the mix=2E > >It only so happens today that for mips you have a single MMIO-based IO=20 >port region, and you have IO port base for that region conveniently @=20 >0x0=2E Then your drivers can have fixed IO port addresses=2E In MIPS, PCI Host Bridge share PIO region with legacy devices=2E Probably the better solution is to add a kind of logic pio region called F= IXED_MMIO, so we can occupy some low ioports for these fixed devices at boot time=2E A ISA bridge node in DeviceTree can be used to express this region=2E I'm going to work on this and try to make a RFC patch later=2E Thanks for your help again! > >For dealing with multiple MMIO-based IO ports regions - which is the=20 >case for PCI host bridges - then you need to map those MMIO-based IO=20 >port regions to different regions in IO port space=2E > >> but still preserving higher 0x4000 for indirect access=2E > >Then there is no space for PCI MMIO-based IO ports=2E Well, it can be higher or lower, whatever=2E > >>=20 >> Thanks a lot! >> > >> > That would not be a bad thing - see >> =20 >>https://lore=2Ekernel=2Eorg/linux-pci/1560262374-67875-1-git-send-email-= john=2Egarry@huawei=2Ecom/ >> > >> > >> > > >> > > This driver deals with legacy IO ports where we need to bitbang --=20 Jiaxun Yang