From patchwork Mon Oct 29 00:27:24 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Machek X-Patchwork-Id: 1660351 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork1.kernel.org (Postfix) with ESMTP id 672033FCF7 for ; Mon, 29 Oct 2012 00:29:28 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TSdCY-0002Ye-Ot; Mon, 29 Oct 2012 00:27:34 +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 1TSdCT-0002YQ-EO for linux-arm-kernel@lists.infradead.org; Mon, 29 Oct 2012 00:27:32 +0000 Received: by atrey.karlin.mff.cuni.cz (Postfix, from userid 512) id 5014FF0810; Mon, 29 Oct 2012 01:27:26 +0100 (CET) Date: Mon, 29 Oct 2012 01:27:24 +0100 From: Pavel Machek To: Arnd Bergmann Subject: [PATCH for soc] socfpga: map uart into virtual address space so that early_printk() works Message-ID: <20121029002724.GA27891@elf.ucw.cz> References: <1340805007-3313-1-git-send-email-dinguyen@altera.com> <201210251458.48528.arnd@arndb.de> <20121027115615.GC5912@elf.ucw.cz> <201210271539.20156.arnd@arndb.de> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <201210271539.20156.arnd@arndb.de> 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: Olof Johansson , dinguyen@altera.com, cytan@altera.com, wd@denx.de, linux-arm-kernel@lists.infradead.org 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 Early printk code needs UART to be mapped early during boot. early_printk() is left there during the start-up; it is useful as our emulators are fairly slow. Signed-off-by: Pavel Machek Acked-by: Dinh Nguyen diff --git a/arch/arm/mach-socfpga/socfpga.c b/arch/arm/mach-socfpga/socfpga.c index ab81ea9..49fb62b 100644 --- a/arch/arm/mach-socfpga/socfpga.c +++ b/arch/arm/mach-socfpga/socfpga.c @@ -37,6 +37,15 @@ static struct map_desc scu_io_desc __initdata = { .type = MT_DEVICE, }; + + +static struct map_desc uart_io_desc __initdata = { + .virtual = 0xfec02000, + .pfn = __phys_to_pfn(0xffc02000), + .length = SZ_8K, + .type = MT_DEVICE, +}; + static void __init socfpga_scu_map_io(void) { unsigned long base; @@ -51,6 +60,8 @@ static void __init socfpga_scu_map_io(void) static void __init socfpga_map_io(void) { socfpga_scu_map_io(); + iotable_init(&uart_io_desc, 1); + early_printk("Early printk initialized\n"); } const static struct of_device_id irq_match[] = {