From patchwork Mon Mar 16 02:37:42 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shawn Guo X-Patchwork-Id: 6014991 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id B8EABBF90F for ; Mon, 16 Mar 2015 02:41:03 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id F107C2037B for ; Mon, 16 Mar 2015 02:41:02 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E9FFC2037A for ; Mon, 16 Mar 2015 02:41:01 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1YXKvX-0003Yy-GG; Mon, 16 Mar 2015 02:38:47 +0000 Received: from mail-pa0-f41.google.com ([209.85.220.41]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YXKvU-0003G1-Gt for linux-arm-kernel@lists.infradead.org; Mon, 16 Mar 2015 02:38:45 +0000 Received: by pacwe9 with SMTP id we9so50276413pac.1 for ; Sun, 15 Mar 2015 19:38:23 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-type:content-disposition:in-reply-to :user-agent; bh=I46DUCCNng40GFy/jxfADqb3i2Co0xnL2v7xo7zTeRY=; b=QYU7wXaMXHHYF7C1SZmtv5MubV7kTn5ttg/uey4TidGx0nUm/MO/RTs9wM8CnqoD46 /6OvgqX62NhqWnbN/UOEdD5Z11J3w0RQt1FrmDyGXGZpuy7W3B56w6+RF3G5z8VYRt97 X94LgiZTBsJKLnTP5BQL5T3//nM/0K5dXrPTNmcyLXQFAO6KIXRGDf60emnqHDqyM/Kp qL4XuPKFlA9P4HA+mO7oXFvPoSnMS0NyzPm3Y48SfIEcUG/tcpbTJ6TOC8sr3Tvnuzun Vyz9J9ON4KNpl8MjpJvwsVb7eNs+PgIDBK4Gl0bUWJLw4uQ1TBDfFZJ5PCbENWCY2ys3 PW3g== X-Gm-Message-State: ALoCoQlUV1/om+CpWXyVpo9KQOx+Yem/BoqLJvwBAw1BnZHxlc6JPhiNGAFaXUyLBWfZPUU/17wH X-Received: by 10.70.33.3 with SMTP id n3mr98468753pdi.132.1426473502985; Sun, 15 Mar 2015 19:38:22 -0700 (PDT) Received: from dragon (119.81.160.152-static.reverse.softlayer.com. [119.81.160.152]) by mx.google.com with ESMTPSA id tr8sm14401655pab.4.2015.03.15.19.38.18 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Sun, 15 Mar 2015 19:38:22 -0700 (PDT) Date: Mon, 16 Mar 2015 10:37:42 +0800 From: Shawn Guo To: Russell King - ARM Linux Subject: Re: [PATCH 02/10] ARM: zx: add low level debug support Message-ID: <20150316023740.GH20455@dragon> References: <1426333785-3952-1-git-send-email-jun.nie@linaro.org> <1426333785-3952-3-git-send-email-jun.nie@linaro.org> <20150315224817.GC8656@n2100.arm.linux.org.uk> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20150315224817.GC8656@n2100.arm.linux.org.uk> User-Agent: Mutt/1.5.21 (2010-09-15) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150315_193844_604892_ECD85854 X-CRM114-Status: GOOD ( 15.74 ) X-Spam-Score: -0.7 (/) Cc: Jun Nie , mturquette@linaro.org, linux-arm-kernel@lists.infradead.org, zte-lt@lists.linaro.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Sun, Mar 15, 2015 at 10:48:18PM +0000, Russell King - ARM Linux wrote: > On Sat, Mar 14, 2015 at 07:49:37PM +0800, Jun Nie wrote: > > Use the UART0 peripheral for low level debug. Only the UART port 0 is > > currently supported. > > None of this code is necessary - in fact, you don't have to add one line > of assembly code what so ever. > > We have generic PL011 debug support. Please use that, you only need to > ensure that the phys and virtual addresses are properly configured in > arch/arm/Kconfig.debug and that the appropriate symbol is selected. For some reason we never understood, ZTE designers chose to use a different offset on Data and Flag register, which make it difficult to reuse pl01x.S. /* Data read or written from the interface. */ #define UART01x_DR 0x00 #define ZX_UART01x_DR 0x04 /* Flag register (Read only). */ #define ZX_UART01x_FR 0x14 #define UART01x_FR 0x18 We chose to duplicate the file to avoid churning generic pl01x.S. Would something like below be acceptable? Or any better idea? Shawn diff --git a/arch/arm/include/debug/pl01x.S b/arch/arm/include/debug/pl01x.S index 92ef808a2337..da83512c4788 100644 --- a/arch/arm/include/debug/pl01x.S +++ b/arch/arm/include/debug/pl01x.S @@ -12,6 +12,13 @@ */ #include +#ifdef CONFIG_ARCH_ZX +#undef UART01x_DR +#undef UART01x_FR +#define UART01x_DR 0x04 +#define UART01x_FR 0x14 +#endif + #ifdef CONFIG_DEBUG_UART_PHYS .macro addruart, rp, rv, tmp ldr \rp, =CONFIG_DEBUG_UART_PHYS