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: 6011361 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 82E1CBF90F for ; Sat, 14 Mar 2015 11:53:07 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A40EA201B9 for ; Sat, 14 Mar 2015 11:53:06 +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 856702017E for ; Sat, 14 Mar 2015 11:53:05 +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 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-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=GUa9WpdKwlGiik8fGfhPlGcuhToy79wbpnTWGUoQwus=; b=kxzsevB45ihcC6UtppoJZC1LkdbrDd6MX4CavLqs8kRt5NZ5On12ciOi1uYqQltJlG +B1WHwLNkwtijwS4Cy5xN6ESWT2t6p2/rsVd8i5YxPQrmNheLqkDayWA9wWTlUmoXeXp DXTTZV0mj8MZU7T2QrTj3Gw8m7RG+T1BrUVukO/WvICiBGPjdDVwJdSzyCPUu4jsNZ0H K4hZnIkZx1rsUigtUJ7DRN+8Y1xBN9kpAtH6cInIQsj3JwtHV3qtELCwmJqE+oflr+6a VTmQMXJnKZEkvD+BcTOCRyunlWqhLiDKOSWMk9Y58I6Nd29sdHzsKH+dwTxEZQDzcpLW IrOw== X-Gm-Message-State: ALoCoQmFzprmudubnQScdNCETFr3zNPTgDmhhLFJIrLekFCirnrxbJeI8Zdll/f7JvNUetgPW4Rs 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-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+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-5.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, 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 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