From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753333AbbL2Og2 (ORCPT ); Tue, 29 Dec 2015 09:36:28 -0500 Received: from mout.kundenserver.de ([212.227.17.13]:56054 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752690AbbL2OgZ convert rfc822-to-8bit (ORCPT ); Tue, 29 Dec 2015 09:36:25 -0500 From: Arnd Bergmann To: Rongrong Zou Cc: Rongrong Zou , minyard@acm.org, gregkh@linuxfoundation.org, catalin.marinas@arm.com, will.deacon@arm.com, linuxarm@huawei.com, linux-kernel@vger.kernel.org, benh@kernel.crashing.org, lijianhua@huawei.com Subject: Re: [PATCH v1 1/3] ARM64 LPC: indirect ISA PORT IO introduced Date: Tue, 29 Dec 2015 15:35:58 +0100 Message-ID: <12016636.UdNIMv3WjG@wuerfel> User-Agent: KMail/4.11.5 (Linux/3.16.0-10-generic; KDE/4.11.5; x86_64; ; ) In-Reply-To: <56829813.2060803@huawei.com> References: <1451396032-23708-1-git-send-email-zourongrong@gmail.com> <3232651.99Svz5pbDW@wuerfel> <56829813.2060803@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8BIT Content-Type: text/plain; charset="utf-8" X-Provags-ID: V03:K0:7eYGo7w47Ocmiz7FKMguydHQEKNeQvy6geKkP8ewkBbnjy05V6O OZV1c0MGUzJ37rZ69Ha7R+jIQFyQ78+3051xLIN08olnHigGcuP+C7qUOgv2aADNtXl1KmQ WWsoPJa6bxj7Si04AjhO2xcFbBI0o22aLnHr1D2CeOtVKzw5EwvBeNgSCO9OlI4cjXWkbdm D6212dc2kAcbPYHl/0gJA== X-UI-Out-Filterresults: notjunk:1;V01:K0:hHZrm0s9zYY=:OyHMskHluGJEYh14k/FNuP 5N0P5tB0Tyx+eVXrhrc+K2JDRGj2U6cFWqjuimDHROQXfdU4pLXIRjNsLpQWYLBsgEqvEn2Vy qYmpNUS3BE149qqj0mxKlIgMJFKiMjCeChc/7Mx9hPBLtn8kGpvR+3BFiSZGLHAHnl3dnQDDh S6of/sCwSR9+MecaXcAUVh5HwtB0lIQxdJjHUujiDvxg/LHTKhRB/OfxZsokSAaJyNr6fMYRa rlA7dhp1ek8fNFh3C50sXCNZE/JvmOXd/Ae3t02OMiTcNSY36miNQJp7AGBdXyFVgYq9LbTDq uezGSgo5Ku/0CEiOFuh1Koa0ZRciAga5/4JmunJT1+qtqYAm388lyn6R1bSRPIsV6vU8yuxK+ 2P5/UZTm3QrdRfsb+hU4u+OPriZljWUvRVCWg+cBHfwWeJGwbwDBzf4CcJi+QuQbaWCM8jJf4 2it2n4s0uGIgYFjlP4IhEyVJ0L4pkt/RZ9G0lqVK4fbl8vjwiccJZSpsbBjXvT9ydzJjPtNPU LmlSN1lbnHp2Ds9sq5l4c/X8OTt4jEu5AmcOeZX+cMZqxzN5aMyYbSfuCvBT7hIua5UXh2JSs 2J+ohhfD7fF+nXEeTz3h6mE3CxBEJXNqg5G0G7NMZXHlYv9z7e2seefBTIXTRkuH0M9/9BYTE ISVFQDlcIjsg+LGDEuYNchOa2AsvhYdBebFGuw9ruGnRgxfsJalnYkehinx+N3Hvx//tYzLF/ S5kJBlbQ/SKBBqev Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tuesday 29 December 2015 22:26:27 Rongrong Zou wrote: > 在 2015/12/29 21:47, Arnd Bergmann 写道: > > On Tuesday 29 December 2015 21:33:50 Rongrong Zou wrote: > >> Indirect ISA port I/O accessing introduced, vendors can hook > >> their own in/out function to general inb/outb. Drivers can access > >> legacy ISA I/O port by inb/outb as it is done in x86 platform. > >> > >> Signed-off-by: Rongrong Zou > > > > Looks correct to me, but I have a few style comments > > > >> --- > >> arch/arm64/Kconfig.platforms | 5 ++- > >> arch/arm64/include/asm/io.h | 78 ++++++++++++++++++++++++++++++++++++++++++++ > >> arch/arm64/kernel/setup.c | 5 +++ > >> 3 files changed, 87 insertions(+), 1 deletion(-) > >> > >> diff --git a/arch/arm64/Kconfig.platforms b/arch/arm64/Kconfig.platforms > >> index 4043c35..98ae206 100644 > >> --- a/arch/arm64/Kconfig.platforms > >> +++ b/arch/arm64/Kconfig.platforms > >> @@ -127,5 +127,8 @@ config ARCH_ZYNQMP > >> bool "Xilinx ZynqMP Family" > >> help > >> This enables support for Xilinx ZynqMP Family > >> - > >> +config ARM64_INDIRECT_PIO > >> + bool "ARM64 Indirect port I/O" > >> + help > >> + This enables support for ARM64 indirect port I/O > >> endmenu > > > > The option should probably go into arch/arm64/Kconfig. Possibly you can make > > it a silent option that just gets selected whenever a driver is enabled > > that might set the callbacks. > > I try to bind it with HISILICON platform. It should be possible to build the actual driver on all platforms, at least with COMPILE_TEST. > >> diff --git a/arch/arm64/include/asm/io.h b/arch/arm64/include/asm/io.h > >> index 44be1e0..0041f3b 100644 > >> --- a/arch/arm64/include/asm/io.h > >> +++ b/arch/arm64/include/asm/io.h > >> @@ -193,6 +193,84 @@ extern void __iomem *ioremap_cache(phys_addr_t phys_addr, size_t size); > >> */ > >> #define xlate_dev_kmem_ptr(p) p > >> > >> +#ifdef CONFIG_ARM64_INDIRECT_PIO > >> +#define DEF_PCI_HOOK_pio(x) x > >> +#else > >> +#define DEF_PCI_HOOK_pio(x) NULL > >> +#endif > > > > Maybe just put the entire definition block inside #ifdef and > > fall back to the default inb/outb definitions otherwise. > > > >> +/* > >> + * This value is equal to PCIBIOS_MIN_IO > >> + */ > >> +#define LEGACY_ISA_PORT_MAX 0x1000 > > > > I would just use PCIBIOS_MIN_IO instead of defining another macro. > > Because PCIBIOS_MIN_IO is defined in asm/pci.h, and asm/io.h > is included by asm/pci.h. so do you mean i define PCIBIOS_MIN_IO here, > and in asm/pci.h just use include asm/io.h ? Yes, I guess that would work. Arnd