From patchwork Tue Jul 10 11:15:15 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Pavel Machek X-Patchwork-Id: 1177051 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork2.kernel.org (Postfix) with ESMTP id 35CCEDFF34 for ; Tue, 10 Jul 2012 11:18:45 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1SoYPc-0000Su-Vj; Tue, 10 Jul 2012 11:15:25 +0000 Received: from atrey.karlin.mff.cuni.cz ([195.113.26.193]) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1SoYPX-0000SE-Mp for linux-arm-kernel@lists.infradead.org; Tue, 10 Jul 2012 11:15:21 +0000 Received: by atrey.karlin.mff.cuni.cz (Postfix, from userid 512) id 8127FF08DA; Tue, 10 Jul 2012 13:15:18 +0200 (CEST) Date: Tue, 10 Jul 2012 13:15:15 +0200 From: Pavel Machek To: Thomas Petazzoni Subject: Re: [RFC PATCHv1 2/2] ARM: socfpga: Add board support for Altera's SOCFPGA Cyclone 5 HW Message-ID: <20120710111515.GB8701@elf.ucw.cz> References: <1340805007-3313-1-git-send-email-dinguyen@altera.com> <1340805007-3313-3-git-send-email-dinguyen@altera.com> <20120627162548.01adc769@skate> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20120627162548.01adc769@skate> X-Warning: Reading this can be dangerous to your mental health. User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Note: CRM114 invocation failed X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-1.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [195.113.26.193 listed in list.dnswl.org] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: linux-arm-kernel@lists.infradead.org, cytan@altera.com, linux@arm.linux.org.uk, wd@denx.de, dinguyen@altera.com X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Hi! > Le Wed, 27 Jun 2012 08:50:07 -0500, > a écrit : > > > +CONFIG_CMDLINE="console=ttyS0,57600 mem=256M@0x0" > > Why do you need to specify the memory map here, since it's already > passed in the device tree? Fixed. > > +const static struct of_device_id irq_match[] = { > > + { .compatible = "arm,cortex-a9-gic", .data = gic_of_init, }, > > + {} > > +}; > > + > > +static struct map_desc cyclone5_io_desc[] __initdata = { > > + { > > + .virtual = IO_ADDRESS(SOCFPGA_SPTIMER0_BASE), > > + .pfn = __phys_to_pfn(SOCFPGA_SPTIMER0_BASE), > > + .length = SZ_4K, > > + .type = MT_DEVICE, > > + }, { > > + .virtual = IO_ADDRESS(SOCFPGA_SPTIMER1_BASE), > > + .pfn = __phys_to_pfn(SOCFPGA_SPTIMER1_BASE), > > + .length = SZ_4K, > > + .type = MT_DEVICE, > > + }, { > > + .virtual = IO_ADDRESS(SOCFPGA_OSC1TIMER0_BASE), > > + .pfn = __phys_to_pfn(SOCFPGA_OSC1TIMER0_BASE), > > + .length = SZ_4K, > > + .type = MT_DEVICE, > > + }, { > > + .virtual = IO_ADDRESS(SOCFPGA_OSC1TIMER1_BASE), > > + .pfn = __phys_to_pfn(SOCFPGA_OSC1TIMER1_BASE), > > + .length = SZ_4K, > > + .type = MT_DEVICE, > > + }, { > > + .virtual = IO_ADDRESS(SOCFPGA_MPUSCU_BASE), > > + .pfn = __phys_to_pfn(SOCFPGA_MPUSCU_BASE), > > + .length = SZ_8K, > > + .type = MT_DEVICE, > > + }, { > > + .virtual = IO_ADDRESS(SOCFPGA_SYSMGR_BASE), > > + .pfn = __phys_to_pfn(SOCFPGA_SYSMGR_BASE), > > + .length = SZ_4K, > > + .type = MT_DEVICE, > > + }, { > > + .virtual = IO_ADDRESS(SOCFPGA_MPUL2_BASE), > > + .pfn = __phys_to_pfn(SOCFPGA_MPUL2_BASE), > > + .length = SZ_8K, > > + .type = MT_DEVICE, > > + }, { > > + .virtual = IO_ADDRESS(SOCFPGA_CLKMGR_BASE), > > + .pfn = __phys_to_pfn(SOCFPGA_CLKMGR_BASE), > > + .length = SZ_4K, > > + .type = MT_DEVICE, > > + }, > > +}; > > Most of those static mappings should instead be turned into dynamic > mappings created with ioremap(), at least for the timers. Now this one is interesting. I just removed these mappings, and it still works. I guess that's good. Pavel commit 5f2d9e152e170a328689e5ab0c3f42851b99a4ec Author: Pavel Date: Tue Jul 10 13:08:54 2012 +0200 cyclone5_map_io seems to be unneccessary. Remove it. Signed-off-by: Pavel Machek diff --git a/arch/arm/mach-socfpga/socfpga_cyclone5.c b/arch/arm/mach-socfpga/socfpga_cyclone5.c index 459f5a6..0bc0b8b 100644 --- a/arch/arm/mach-socfpga/socfpga_cyclone5.c +++ b/arch/arm/mach-socfpga/socfpga_cyclone5.c @@ -50,30 +50,6 @@ const static struct of_device_id irq_match[] = { {} }; -static struct map_desc cyclone5_io_desc[] __initdata = { - { - .virtual = IO_ADDRESS(SOCFPGA_MPUSCU_BASE), - .pfn = __phys_to_pfn(SOCFPGA_MPUSCU_BASE), - .length = SZ_8K, - .type = MT_DEVICE, - }, { - .virtual = IO_ADDRESS(SOCFPGA_SYSMGR_BASE), - .pfn = __phys_to_pfn(SOCFPGA_SYSMGR_BASE), - .length = SZ_4K, - .type = MT_DEVICE, - }, { - .virtual = IO_ADDRESS(SOCFPGA_CLKMGR_BASE), - .pfn = __phys_to_pfn(SOCFPGA_CLKMGR_BASE), - .length = SZ_4K, - .type = MT_DEVICE, - }, -}; - -static void __init cyclone5_map_io(void) -{ - iotable_init(cyclone5_io_desc, ARRAY_SIZE(cyclone5_io_desc)); -} - static void __init gic_init_irq(void) { of_irq_init(irq_match); @@ -100,7 +76,6 @@ static const char *altera_dt_match[] = { }; DT_MACHINE_START(SOCFPGA_CYCLONE5, "Altera SOCFPGA Cyclone V") - .map_io = cyclone5_map_io, .init_early = socfpga_init_early, .init_irq = gic_init_irq, .handle_irq = gic_handle_irq,