From patchwork Fri Aug 31 09:21:56 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthieu Castet X-Patchwork-Id: 1391811 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork2.kernel.org (Postfix) with ESMTP id D8459DF215 for ; Fri, 31 Aug 2012 09:25:57 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1T7NQZ-0004QF-6o; Fri, 31 Aug 2012 09:22:11 +0000 Received: from mail-ey0-f177.google.com ([209.85.215.177]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1T7NQV-0004Q0-JW for linux-arm-kernel@lists.infradead.org; Fri, 31 Aug 2012 09:22:08 +0000 Received: by eaai12 with SMTP id i12so790618eaa.36 for ; Fri, 31 Aug 2012 02:22:05 -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:x-mailer; bh=YY5WZq6uPMKIPRgBgNi900vu+V+GqYOksKSzBBLaHD0=; b=M+w9COVt6OSVsgGCm9xSh/2PbG0iTymxzpQU72OnowIWimqJFvyH6/CPfxrlTZlH2Y T2CxDQ/Jfqqytk+4Fj6A8NKK/FW9QzguGSHT8C1bcBwM/BZwGIAMq7fWTuUi4ASRQNO7 eLTUpeNFuXiUUPU8HHa9WSyufp551Z8M6z6fM3Fo+k52SQ3cHi7HqbRqeAUhwZ0zk0H0 EqSobJivG7qVu1moXGBGRzech7PPgf08m01tv5KzdrpsClfEG/Kvg+QgqrJ2ZuErxvWh vTaXOO4mVBoZOfnKpB3vGtcGyy1R4bWqEKYYywn752dYrpjAifz6g/ipT9CWZsX218I/ EmCg== Received: by 10.14.218.5 with SMTP id j5mr10157145eep.16.1346404924944; Fri, 31 Aug 2012 02:22:04 -0700 (PDT) Received: from perruche.Parrot.Biz ([46.218.109.82]) by mx.google.com with ESMTPS id 45sm11711980eed.17.2012.08.31.02.22.03 (version=SSLv3 cipher=OTHER); Fri, 31 Aug 2012 02:22:04 -0700 (PDT) From: Matthieu CASTET To: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, gregkh@suse.de Subject: [PATCH] hvc_dcc : add support to armv4 and armv5 core Date: Fri, 31 Aug 2012 11:21:56 +0200 Message-Id: <1346404916-27616-1-git-send-email-castet.matthieu@free.fr> X-Mailer: git-send-email 1.7.10.4 X-Spam-Note: CRM114 invocation failed X-Spam-Score: -2.6 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.215.177 listed in list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (castet.matthieu[at]free.fr) -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature Cc: Matthieu Castet , sboyd@codeaurora.org, Matthieu CASTET , arnd@arndb.de X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Signed-off-by: Matthieu Castet --- drivers/tty/hvc/hvc_dcc.c | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/drivers/tty/hvc/hvc_dcc.c b/drivers/tty/hvc/hvc_dcc.c index 44fbeba..489e9e5 100644 --- a/drivers/tty/hvc/hvc_dcc.c +++ b/drivers/tty/hvc/hvc_dcc.c @@ -26,6 +26,7 @@ #include "hvc_console.h" +#if defined(CONFIG_CPU_V6) || defined(CONFIG_CPU_V7) /* DCC Status Bits */ #define DCC_STATUS_RX (1 << 30) #define DCC_STATUS_TX (1 << 29) @@ -58,6 +59,39 @@ static inline void __dcc_putchar(char c) : "r" (c)); isb(); } +#else +/* DCC Status Bits */ +#define DCC_STATUS_RX (1 << 0) +#define DCC_STATUS_TX (1 << 1) + +/* primitive JTAG1 protocol utilities */ +static inline u32 __dcc_getstatus(void) +{ + u32 ret; + + asm __volatile__ ("mrc p14, 0, %0, c0, c0 @ read comms ctrl reg" + : "=r" (ret)); + + return ret; +} + +static inline char __dcc_getchar(void) +{ + char c; + + asm __volatile__ ("mrc p14, 0, %0, c1, c0 @ read comms data reg" + : "=r" (c)); + + return c; +} + +static inline void __dcc_putchar(unsigned char c) +{ + asm __volatile__ ("mcr p14, 0, %0, c1, c0 @ write a char" + : /* no output register */ + : "r" (c)); +} +#endif static int hvc_dcc_put_chars(uint32_t vt, const char *buf, int count) {