From patchwork Sun Aug 17 10:49:48 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Carlo Caione X-Patchwork-Id: 4730981 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 57BED9F377 for ; Sun, 17 Aug 2014 10:55:01 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6DF3A2010F for ; Sun, 17 Aug 2014 10:55:00 +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 73CC3200E5 for ; Sun, 17 Aug 2014 10:54:59 +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 1XIy33-0002su-Lm; Sun, 17 Aug 2014 10:50:53 +0000 Received: from mail-wi0-x22d.google.com ([2a00:1450:400c:c05::22d]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1XIy2x-0002qX-WB for linux-arm-kernel@lists.infradead.org; Sun, 17 Aug 2014 10:50:48 +0000 Received: by mail-wi0-f173.google.com with SMTP id f8so2479995wiw.12 for ; Sun, 17 Aug 2014 03:50:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=dB5gEW3J6blUO+kD89QCJfsrlBtURVCGULi3f2IjCoY=; b=rnHafoF1zxTgHoK3Vsjz3t4ti+OpENBL52IZg//f6FmCV+/Zro4jy7G7rMkJaUdye+ +6V/RsvrnoVrNLhheoHW9M89E7cuHhcb/WMU8DK7qIIauflwklhkUq5RSWlNjcFcc37h D7DWa2/g9va7fyNDk8KOckQ8za5cAKuT5ya9j1xSTEmu4ph/Lw4u+DSi15UkuR3+tlHc VDMsNYeeV4qkJ1VqjAtKK81FfgJw+pt4so7WVodKMOOwxWGEsstrxzbogPn+mISVQ+DI u0m0hmXn6mWt85qPbvD6rXhCv9gBeH3TqaCnlLU59+XJBd1fYQvpUDtJ0ltmkRBKmYSv j/Zw== X-Received: by 10.180.37.77 with SMTP id w13mr33112004wij.78.1408272625037; Sun, 17 Aug 2014 03:50:25 -0700 (PDT) Received: from localhost.localdomain (host20-19-dynamic.47-79-r.retail.telecomitalia.it. [79.47.19.20]) by mx.google.com with ESMTPSA id jo10sm18523539wjc.41.2014.08.17.03.50.22 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 17 Aug 2014 03:50:24 -0700 (PDT) From: Carlo Caione To: linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-serial@vger.kernel.org, linux@arm.linux.org.uk, robh+dt@kernel.org, mark.rutland@arm.com, ijc+devicetree@hellion.org.uk, daniel.lezcano@linaro.org, tglx@linutronix.de, gregkh@linuxfoundation.org, jslaby@suse.cz, grant.likely@linaro.org, b.galvani@gmail.com Subject: [PATCH 1/7] ARM: meson: debug: add debug UART for earlyprintk support Date: Sun, 17 Aug 2014 12:49:48 +0200 Message-Id: <1408272594-10814-2-git-send-email-carlo@caione.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1408272594-10814-1-git-send-email-carlo@caione.org> References: <1408272594-10814-1-git-send-email-carlo@caione.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140817_035048_186929_F499595D X-CRM114-Status: GOOD ( 14.67 ) X-Spam-Score: 0.0 (/) Cc: Carlo Caione 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=-2.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_NONE,RP_MATCHES_RCVD,T_DKIM_INVALID,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 the UART definitions needed to support earlyprintk for MesonX SoCs on UARTAO. Signed-off-by: Carlo Caione --- arch/arm/Kconfig.debug | 14 ++++++++++++-- arch/arm/include/debug/meson.S | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+), 2 deletions(-) create mode 100644 arch/arm/include/debug/meson.S diff --git a/arch/arm/Kconfig.debug b/arch/arm/Kconfig.debug index b11ad54..16079c5 100644 --- a/arch/arm/Kconfig.debug +++ b/arch/arm/Kconfig.debug @@ -348,6 +348,13 @@ choice Say Y here if you want the debug print routines to direct their output to UART1 serial port on KEYSTONE2 devices. + config DEBUG_MESON_UARTAO + bool "Kernel low-level debugging via Meson6 UARTAO" + depends on ARCH_MESON + help + Say Y here if you want kernel low-lever debugging support + on Amlogic Meson6 based platforms on the UARTAO. + config DEBUG_MMP_UART2 bool "Kernel low-level debugging message via MMP UART2" depends on ARCH_MMP @@ -1011,6 +1018,7 @@ config DEBUG_LL_INCLUDE string default "debug/8250.S" if DEBUG_LL_UART_8250 || DEBUG_UART_8250 default "debug/clps711x.S" if DEBUG_CLPS711X_UART1 || DEBUG_CLPS711X_UART2 + default "debug/meson.S" if DEBUG_MESON_UARTAO default "debug/pl01x.S" if DEBUG_LL_UART_PL01X || DEBUG_UART_PL01X default "debug/exynos.S" if DEBUG_EXYNOS_UART default "debug/efm32.S" if DEBUG_LL_UART_EFM32 @@ -1106,6 +1114,7 @@ config DEBUG_UART_PHYS default 0xc8000003 if ARCH_IXP4XX && CPU_BIG_ENDIAN default 0xd0000000 if ARCH_SPEAR3XX || ARCH_SPEAR6XX default 0xd0012000 if DEBUG_MVEBU_UART + default 0xc81004c0 if DEBUG_MESON_UARTAO default 0xd4017000 if DEBUG_MMP_UART2 default 0xd4018000 if DEBUG_MMP_UART3 default 0xe0000000 if ARCH_SPEAR13XX @@ -1125,7 +1134,7 @@ config DEBUG_UART_PHYS default 0xfffff700 if ARCH_IOP33X depends on DEBUG_LL_UART_8250 || DEBUG_LL_UART_PL01X || \ DEBUG_LL_UART_EFM32 || \ - DEBUG_UART_8250 || DEBUG_UART_PL01X || \ + DEBUG_UART_8250 || DEBUG_UART_PL01X || DEBUG_MESON_UARTAO || \ DEBUG_MSM_UART || DEBUG_QCOM_UARTDM || DEBUG_S3C24XX_UART config DEBUG_UART_VIRT @@ -1162,6 +1171,7 @@ config DEBUG_UART_VIRT default 0xfd012000 if ARCH_MV78XX0 default 0xfde12000 if ARCH_DOVE default 0xfe012000 if ARCH_ORION5X + default 0xf31004c0 if DEBUG_MESON_UARTAO default 0xfe017000 if DEBUG_MMP_UART2 default 0xfe018000 if DEBUG_MMP_UART3 default 0xfe100000 if DEBUG_IMX23_UART || DEBUG_IMX28_UART @@ -1193,7 +1203,7 @@ config DEBUG_UART_VIRT default 0xff003000 if DEBUG_U300_UART default DEBUG_UART_PHYS if !MMU depends on DEBUG_LL_UART_8250 || DEBUG_LL_UART_PL01X || \ - DEBUG_UART_8250 || DEBUG_UART_PL01X || \ + DEBUG_UART_8250 || DEBUG_UART_PL01X || DEBUG_MESON_UARTAO || \ DEBUG_MSM_UART || DEBUG_QCOM_UARTDM || DEBUG_S3C24XX_UART config DEBUG_UART_8250_SHIFT diff --git a/arch/arm/include/debug/meson.S b/arch/arm/include/debug/meson.S new file mode 100644 index 0000000..1bae99b --- /dev/null +++ b/arch/arm/include/debug/meson.S @@ -0,0 +1,35 @@ +/* + * Copyright (C) 2014 Carlo Caione + * Carlo Caione + * + * 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 MESON_AO_UART_WFIFO 0x0 +#define MESON_AO_UART_STATUS 0xc + +#define MESON_AO_UART_TX_FIFO_EMPTY (1 << 22) +#define MESON_AO_UART_TX_FIFO_FULL (1 << 21) + + .macro addruart, rp, rv, tmp + ldr \rp, =(CONFIG_DEBUG_UART_PHYS) @ physical + ldr \rv, =(CONFIG_DEBUG_UART_VIRT) @ virtual + .endm + + .macro senduart,rd,rx + str \rd, [\rx, #MESON_AO_UART_WFIFO] + .endm + + .macro busyuart,rd,rx +1002: ldr \rd, [\rx, #MESON_AO_UART_STATUS] + tst \rd, #MESON_AO_UART_TX_FIFO_EMPTY + beq 1002b + .endm + + .macro waituart,rd,rx +1001: ldr \rd, [\rx, #MESON_AO_UART_STATUS] + tst \rd, #MESON_AO_UART_TX_FIFO_FULL + bne 1001b + .endm