From patchwork Sat Mar 14 11:49:37 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jun Nie X-Patchwork-Id: 45809 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-we0-f198.google.com (mail-we0-f198.google.com [74.125.82.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 895CC214BF for ; Sat, 14 Mar 2015 11:52:33 +0000 (UTC) Received: by wesq59 with SMTP id q59sf20313071wes.1 for ; Sat, 14 Mar 2015 04:52:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:subject:date:message-id :in-reply-to:references:precedence:list-id:list-unsubscribe :list-archive:list-post:list-help:list-subscribe:mime-version :content-type:content-transfer-encoding:sender:errors-to :x-original-sender:x-original-authentication-results:mailing-list; bh=8hy9qpEFLwzfLV4oRvN8BpPNkuRYoL9w18QWowIj7bQ=; b=Ov1puDwQHoLaHfjq5grihWvHTYdni0aHf5GQ01OHTeVIqFPYj5BPukMjzegPoAa8tS xjHwtsAnhflfP2lp2ajXSgucrEG6YEXhHPU8J9q4CfStMSMJ5boJ3DWCT8dqIDFdzu78 sjnzl3rdDCoh4MHnKVHh1ImhjuunRIQ4o5xRJzO6j6k2Ri7s330ZYcx62LA6/O0RMu6r 3e4j222Y2CvKtxhDlWrVvU0Xx65lfvsaoBnRNUXNgknUvEqT+k7j/q3zvbtCPiMN9oa5 FK+XSQCSzG0Dx9D7fj7/npuOOmESGXDlzuNVvDbJpRnzlUox4JTd6H/MLpdxAiWUPmbV bHpA== X-Gm-Message-State: ALoCoQmGbRFikT7Rb5XoDuzehD35Ww7X9DHPlPL1y4DpR9q2qccPnCExJ3H/1Bk9HdClHGXa5qSq X-Received: by 10.152.6.41 with SMTP id x9mr7935806lax.10.1426333952794; Sat, 14 Mar 2015 04:52:32 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.22.65 with SMTP id b1ls516536laf.99.gmail; Sat, 14 Mar 2015 04:52:32 -0700 (PDT) X-Received: by 10.112.149.10 with SMTP id tw10mr6347403lbb.78.1426333952402; Sat, 14 Mar 2015 04:52:32 -0700 (PDT) Received: from mail-lb0-f180.google.com (mail-lb0-f180.google.com. [209.85.217.180]) by mx.google.com with ESMTPS id l2si3366127lal.97.2015.03.14.04.52.32 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 14 Mar 2015 04:52:32 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.180 as permitted sender) client-ip=209.85.217.180; Received: by lbbsy1 with SMTP id sy1so5280087lbb.1 for ; Sat, 14 Mar 2015 04:52:32 -0700 (PDT) X-Received: by 10.152.5.194 with SMTP id u2mr47242851lau.88.1426333952295; Sat, 14 Mar 2015 04:52:32 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.35.133 with SMTP id h5csp1477428lbj; Sat, 14 Mar 2015 04:52:30 -0700 (PDT) X-Received: by 10.70.94.169 with SMTP id dd9mr1961182pdb.34.1426333948937; Sat, 14 Mar 2015 04:52:28 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id hh5si9394037pac.239.2015.03.14.04.52.28 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 14 Mar 2015 04:52:28 -0700 (PDT) Received-SPF: none (google.com: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org does not designate permitted sender hosts) client-ip=2001:1868:205::9; 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 1YWkaw-0003KB-AT; Sat, 14 Mar 2015 11:51:06 +0000 Received: from mail-pa0-f50.google.com ([209.85.220.50]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YWkaR-00038w-B8 for linux-arm-kernel@lists.infradead.org; Sat, 14 Mar 2015 11:50:35 +0000 Received: by pagr17 with SMTP id r17so14746286pag.0 for ; Sat, 14 Mar 2015 04:50:14 -0700 (PDT) X-Received: by 10.70.88.68 with SMTP id be4mr36324593pdb.84.1426333813897; Sat, 14 Mar 2015 04:50:13 -0700 (PDT) Received: from localhost.localdomain ([107.6.112.156]) by mx.google.com with ESMTPSA id ov5sm7365488pdb.91.2015.03.14.04.50.09 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 14 Mar 2015 04:50:12 -0700 (PDT) From: Jun Nie To: linux-arm-kernel@lists.infradead.org, mturquette@linaro.org, linux@arm.linux.org.uk, shawn.guo@linaro.org, jun.nie@linaro.org, zte-lt@lists.linaro.org Subject: [PATCH 02/10] ARM: zx: add low level debug support Date: Sat, 14 Mar 2015 19:49:37 +0800 Message-Id: <1426333785-3952-3-git-send-email-jun.nie@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1426333785-3952-1-git-send-email-jun.nie@linaro.org> References: <1426333785-3952-1-git-send-email-jun.nie@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150314_045035_443181_6582BE03 X-CRM114-Status: GOOD ( 11.43 ) X-Spam-Score: -0.7 (/) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.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 [209.85.220.50 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [209.85.220.50 listed in wl.mailspike.net] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 RCVD_IN_MSPIKE_WL Mailspike good senders 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: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: jun.nie@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.180 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 Use the UART0 peripheral for low level debug. Only the UART port 0 is currently supported. Signed-off-by: Jun Nie --- arch/arm/Kconfig.debug | 12 ++++++++++++ arch/arm/include/debug/zx.S | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+) create mode 100644 arch/arm/include/debug/zx.S diff --git a/arch/arm/Kconfig.debug b/arch/arm/Kconfig.debug index 970de75..b2a0e9a 100644 --- a/arch/arm/Kconfig.debug +++ b/arch/arm/Kconfig.debug @@ -1169,6 +1169,17 @@ choice For more details about semihosting, please see chapter 8 of DUI0203I_rvct_developer_guide.pdf from ARM Ltd. + config DEBUG_ZTE_ZX + bool "Use ZTE ZX UART" + depends on ARCH_ZX + help + Say Y here if you are enabling ZTE ZX296702 SOC and need + debug uart support. + + This option is preferred over the platform specific + options; the platform specific options are deprecated + and will be soon removed. + config DEBUG_LL_UART_8250 bool "Kernel low-level debugging via 8250 UART" help @@ -1315,6 +1326,7 @@ config DEBUG_LL_INCLUDE default "debug/vexpress.S" if DEBUG_VEXPRESS_UART0_DETECT default "debug/vf.S" if DEBUG_VF_UART default "debug/vt8500.S" if DEBUG_VT8500_UART0 + default "debug/zx.S" if DEBUG_ZTE_ZX default "debug/zynq.S" if DEBUG_ZYNQ_UART0 || DEBUG_ZYNQ_UART1 default "debug/bcm63xx.S" if DEBUG_UART_BCM63XX default "debug/digicolor.S" if DEBUG_DIGICOLOR_UA0 diff --git a/arch/arm/include/debug/zx.S b/arch/arm/include/debug/zx.S new file mode 100644 index 0000000..aa745ac --- /dev/null +++ b/arch/arm/include/debug/zx.S @@ -0,0 +1,35 @@ +/* + * Debugging macro include header + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + */ + +#define UART01x_DR 0x04 /* Data read or write */ +#define UART01x_FR 0x14 /* Flag register (Read only) */ + +#define UART01x_FR_TXFF 0x020 + + +#define UART0_PADDR 0x09405000 +#define UART0_VADDR 0xfc705000 + + .macro addruart, rp, rv, tmp + ldr \rp, =UART0_PADDR @ physical + ldr \rv, =UART0_VADDR @ virtual + .endm + + .macro senduart,rd,rx + strb \rd, [\rx, #UART01x_DR] + .endm + + .macro waituart,rd,rx + .endm + + .macro busyuart,rd,rx +1001: ldr \rd, [\rx, #UART01x_FR] + tst \rd, #UART01x_FR_TXFF + bne 1001b + .endm