From patchwork Tue Oct 29 15:23:11 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 3108691 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.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 7B145BF924 for ; Tue, 29 Oct 2013 15:23:30 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4C3A72034A for ; Tue, 29 Oct 2013 15:23:29 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0623E20253 for ; Tue, 29 Oct 2013 15:23:28 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VbB8Y-000246-Ts; Tue, 29 Oct 2013 15:23:19 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VbB8W-0003gs-JN; Tue, 29 Oct 2013 15:23:16 +0000 Received: from perceval.ideasonboard.com ([95.142.166.194]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VbB8T-0003fv-B6 for linux-arm-kernel@lists.infradead.org; Tue, 29 Oct 2013 15:23:13 +0000 Received: from avalon.ideasonboard.com (unknown [91.178.173.243]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 1822F35A67; Tue, 29 Oct 2013 16:22:14 +0100 (CET) From: Laurent Pinchart To: linux-sh@vger.kernel.org Subject: [PATCH 1/3] ARM: shmobile: r8a7790: Add early debugging support Date: Tue, 29 Oct 2013 16:23:11 +0100 Message-Id: <1383060193-1505-2-git-send-email-laurent.pinchart+renesas@ideasonboard.com> X-Mailer: git-send-email 1.8.1.5 In-Reply-To: <1383060193-1505-1-git-send-email-laurent.pinchart+renesas@ideasonboard.com> References: <1383060193-1505-1-git-send-email-laurent.pinchart+renesas@ideasonboard.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20131029_112313_507276_00508FD2 X-CRM114-Status: GOOD ( 11.56 ) X-Spam-Score: -2.4 (--) Cc: linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 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=-4.7 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 Add serial port debug macros for the SCIF0 serial port on R8A7790. Support for other serial ports can easily be added if needed. Signed-off-by: Laurent Pinchart --- arch/arm/Kconfig.debug | 8 ++++++++ arch/arm/include/debug/r8a7790.S | 43 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+) create mode 100644 arch/arm/include/debug/r8a7790.S diff --git a/arch/arm/Kconfig.debug b/arch/arm/Kconfig.debug index 9762c84..f1b765a 100644 --- a/arch/arm/Kconfig.debug +++ b/arch/arm/Kconfig.debug @@ -493,6 +493,13 @@ choice Say Y here if you want kernel low-level debugging support on PXA UART1. + config DEBUG_R8A7790 + bool "Kernel low-level debugging messages via SCIF0 on R8A7790 SoCs" + depends on ARCH_R8A7790 + help + Say Y here if you want kernel low-level debugging support + on Renesas R8A7790 based platforms. + config DEBUG_REALVIEW_STD_PORT bool "RealView Default UART" depends on ARCH_REALVIEW @@ -901,6 +908,7 @@ config DEBUG_LL_INCLUDE DEBUG_MSM8660_UART || \ DEBUG_MSM8960_UART default "debug/omap2plus.S" if DEBUG_OMAP2PLUS_UART + default "debug/r8a7790.S" if DEBUG_R8A7790 default "debug/sirf.S" if DEBUG_SIRFPRIMA2_UART1 || DEBUG_SIRFMARCO_UART1 default "debug/sti.S" if DEBUG_STI_UART default "debug/tegra.S" if DEBUG_TEGRA_UART diff --git a/arch/arm/include/debug/r8a7790.S b/arch/arm/include/debug/r8a7790.S new file mode 100644 index 0000000..4f1feb8 --- /dev/null +++ b/arch/arm/include/debug/r8a7790.S @@ -0,0 +1,43 @@ +/* + * Renesas R8A7790 debugging macro include header + * + * Copyright (C) 2012-2013 Renesas Electronics Corporation + * Copyright (C) 1994-1999 Russell King + * + * 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 FTDR 0x0c +#define FSR 0x10 + +#define TDFE (1 << 5) +#define TEND (1 << 6) + +#define SCIF_PHYS 0xe6e60000 +#define SCIF_VIRT 0xffe60000 + + .macro addruart, rp, rv, tmp + ldr \rp, =SCIF_PHYS + ldr \rv, =SCIF_VIRT + .endm + + .macro waituart, rd, rx +1001: ldrh \rd, [\rx, #FSR] + tst \rd, #TDFE + beq 1001b + .endm + + .macro senduart, rd, rx + strb \rd, [\rx, #FTDR] + ldrh \rd, [\rx, #FSR] + bic \rd, \rd, #TEND + strh \rd, [\rx, #FSR] + .endm + + .macro busyuart, rd, rx +1001: ldrh \rd, [\rx, #FSR] + tst \rd, #TEND + beq 1001b + .endm