From patchwork Thu Jul 7 06:36:55 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Barry Song X-Patchwork-Id: 952162 Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p676cRkn019617 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 7 Jul 2011 06:38:48 GMT Received: from canuck.infradead.org ([2001:4978:20e::1]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1QeiE2-0004p5-UK; Thu, 07 Jul 2011 06:38:15 +0000 Received: from localhost ([127.0.0.1] helo=canuck.infradead.org) by canuck.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1QeiE2-0005SC-GP; Thu, 07 Jul 2011 06:38:14 +0000 Received: from cluster-d.mailcontrol.com ([85.115.60.190]) by canuck.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1QeiDy-0005Rs-I5 for linux-arm-kernel@lists.infradead.org; Thu, 07 Jul 2011 06:38:11 +0000 Received: from rly01d.srv.mailcontrol.com (localhost.localdomain [127.0.0.1]) by rly01d.srv.mailcontrol.com (MailControl) with ESMTP id p676c3J0015902 for ; Thu, 7 Jul 2011 07:38:07 +0100 Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by rly01d.srv.mailcontrol.com (MailControl) id p676bvFw015090 for ; Thu, 7 Jul 2011 07:37:57 +0100 Received: from banasiexc02.ASIA.ROOT.PRI ([202.80.51.114]) by rly01d-eth0.srv.mailcontrol.com (envelope-sender ) (MIMEDefang) with ESMTP id p676bi8S013911 (TLS bits=128 verify=FAIL); Thu, 07 Jul 2011 07:37:57 +0100 (BST) Received: from SHAASIEXC02.ASIA.ROOT.PRI (10.125.12.85) by banasiexc02.ASIA.ROOT.PRI (10.190.12.22) with Microsoft SMTP Server (TLS) id 14.1.270.1; Thu, 7 Jul 2011 12:07:51 +0530 Received: from localhost.localdomain (10.125.4.148) by asimail.csr.com (10.125.12.88) with Microsoft SMTP Server (TLS) id 14.1.270.1; Thu, 7 Jul 2011 14:37:49 +0800 From: Barry Song To: , , , Subject: [PATCH v4 2/3] ARM: CSR: mapping early DEBUG_LL uart Date: Wed, 6 Jul 2011 23:36:55 -0700 Message-ID: <1310020616-27856-3-git-send-email-bs14@csr.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1310020616-27856-1-git-send-email-bs14@csr.com> References: <1310020616-27856-1-git-send-email-bs14@csr.com> MIME-Version: 1.0 X-Originating-IP: [10.125.4.148] X-Scanned-By: MailControl A-12-00-01 (www.mailcontrol.com) on 10.68.1.111 X-CRM114-Version: 20090807-BlameThorstenAndJenny ( TRE 0.7.6 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20110707_023810_847306_90789E71 X-CRM114-Status: GOOD ( 16.05 ) X-Spam-Score: -0.7 (/) X-Spam-Report: SpamAssassin version 3.3.1 on canuck.infradead.org summary: Content analysis details: (-0.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [85.115.60.190 listed in list.dnswl.org] Cc: Barry Song , devicetree-discuss@lists.ozlabs.org, workgroup.linux@csr.com, grant.likely@secretlab.ca, Barry Song , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.12 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 X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Thu, 07 Jul 2011 06:38:48 +0000 (UTC) Signed-off-by: Barry Song --- arch/arm/mach-prima2/Makefile | 1 + arch/arm/mach-prima2/common.h | 6 ++++++ arch/arm/mach-prima2/lluart.c | 25 +++++++++++++++++++++++++ arch/arm/mach-prima2/prima2.c | 1 + 4 files changed, 33 insertions(+), 0 deletions(-) create mode 100644 arch/arm/mach-prima2/lluart.c diff --git a/arch/arm/mach-prima2/Makefile b/arch/arm/mach-prima2/Makefile index d44f7ae..f2fba66 100644 --- a/arch/arm/mach-prima2/Makefile +++ b/arch/arm/mach-prima2/Makefile @@ -3,3 +3,4 @@ obj-y += irq.o obj-y += clock.o obj-y += rstc.o obj-y += prima2.o +obj-$(CONFIG_DEBUG_LL) += lluart.o diff --git a/arch/arm/mach-prima2/common.h b/arch/arm/mach-prima2/common.h index fa4a3b5..83e5d21 100644 --- a/arch/arm/mach-prima2/common.h +++ b/arch/arm/mach-prima2/common.h @@ -17,4 +17,10 @@ extern struct sys_timer sirfsoc_timer; extern void __init sirfsoc_of_irq_init(void); extern void __init sirfsoc_of_clk_init(void); +#ifndef CONFIG_DEBUG_LL +static inline void sirfsoc_map_lluart(void) {} +#else +extern void __init sirfsoc_map_lluart(void); +#endif + #endif diff --git a/arch/arm/mach-prima2/lluart.c b/arch/arm/mach-prima2/lluart.c new file mode 100644 index 0000000..a89f9b3 --- /dev/null +++ b/arch/arm/mach-prima2/lluart.c @@ -0,0 +1,25 @@ +/* + * Static memory mapping for DEBUG_LL + * + * Copyright (c) 2011 Cambridge Silicon Radio Limited, a CSR plc group company. + * + * Licensed under GPLv2 or later. + */ + +#include +#include +#include +#include +#include + +void __init sirfsoc_map_lluart(void) +{ + struct map_desc sirfsoc_lluart_map = { + .virtual = SIRFSOC_UART1_VA_BASE, + .pfn = __phys_to_pfn(SIRFSOC_UART1_PA_BASE), + .length = SIRFSOC_UART1_SIZE, + .type = MT_DEVICE, + }; + + iotable_init(&sirfsoc_lluart_map, 1); +} diff --git a/arch/arm/mach-prima2/prima2.c b/arch/arm/mach-prima2/prima2.c index c26947d..f57124b 100644 --- a/arch/arm/mach-prima2/prima2.c +++ b/arch/arm/mach-prima2/prima2.c @@ -33,6 +33,7 @@ MACHINE_START(PRIMA2_EVB, "prima2cb") /* Maintainer: Barry Song */ .boot_params = 0x00000100, .init_early = sirfsoc_of_clk_init, + .map_io = sirfsoc_map_lluart, .init_irq = sirfsoc_of_irq_init, .timer = &sirfsoc_timer, .init_machine = sirfsoc_mach_init,