From patchwork Tue Nov 8 14:20:54 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Iurii Mykhalskyi X-Patchwork-Id: 9417573 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id A83A060459 for ; Tue, 8 Nov 2016 14:23:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 979DE289B9 for ; Tue, 8 Nov 2016 14:23:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 89A7E28A14; Tue, 8 Nov 2016 14:23:49 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.6 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RCVD_IN_SORBS_SPAM,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 09B40289B9 for ; Tue, 8 Nov 2016 14:23:48 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c47Gx-0004yc-49; Tue, 08 Nov 2016 14:21:11 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c47Gv-0004xg-Sr for xen-devel@lists.xen.org; Tue, 08 Nov 2016 14:21:10 +0000 Received: from [193.109.254.147] by server-7.bemta-6.messagelabs.com id CD/1C-21485-55FD1285; Tue, 08 Nov 2016 14:21:09 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprMIsWRWlGSWpSXmKPExsVyMfS6rm7IfcU IgwlL1SyWfFzM4sDocXT3b6YAxijWzLyk/IoE1ox5H8+wFjyQqFj3dgt7A+N14S5GLg4hgUmM EgsWr2XvYuTkYBHoYZa4uFwVJCEh8I5F4vvtPawgCQmBGImvfZeZIOxqiQ9n1wDFOYC69SX63 /FADPrLKDGjcTYzSA2bgKXE1BcXWEBsEQFpiWufLzOC2MwChhLbLp8EiwsL+EjM/n+BCWKxqs SSy6fBenkFXCWal+xgg9glL7Hw/BGmCYx8CxgZVjFqFKcWlaUW6Rpa6iUVZaZnlOQmZuboGhq Y6eWmFhcnpqfmJCYV6yXn525iBAYKAxDsYPyxLOAQoyQHk5Io7/sCxQghvqT8lMqMxOKM+KLS nNTiQ4wyHBxKErw594BygkWp6akVaZk5wJCFSUtw8CiJ8BqApHmLCxJzizPTIVKnGC05Xn148 YCJo+PDBxC56NMDJiGWvPy8VClxXnGQBgGQhozSPLhxsLi6xCgrJczLCHSgEE9BalFuZgmq/C tGcQ5GJWFeN5ApPJl5JXBbXwEdxAR0UFWMAshBJYkIKakGxhU111af0LH2n/4sbnl11azltUd 2280Ifn6o4dDZU4wmRjab3FWv5T9935ip9U5GeOXBhITq3d+Fr/5WOm+w0vj4UVZXvdTb4WLP vZum3G+w4r9v+6RqtkT954MGj12U/Xde8OFknR52zPLdickt+zw3c86MP/Be/tmdAzzdExfPW XN6u967QxeUWIozEg21mIuKEwGMLyZDpgIAAA== X-Env-Sender: iurii.mykhalskyi@globallogic.com X-Msg-Ref: server-8.tower-27.messagelabs.com!1478614868!60210202!1 X-Originating-IP: [209.85.215.45] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 9.0.13; banners=-,-,- X-VirusChecked: Checked Received: (qmail 24584 invoked from network); 8 Nov 2016 14:21:08 -0000 Received: from mail-lf0-f45.google.com (HELO mail-lf0-f45.google.com) (209.85.215.45) by server-8.tower-27.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 8 Nov 2016 14:21:08 -0000 Received: by mail-lf0-f45.google.com with SMTP id o141so68478713lff.1 for ; Tue, 08 Nov 2016 06:21:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=globallogic.com; s=google; h=from:to:cc:subject:date:message-id; bh=WeKaIIv4hrfvkn10+/BTbX4DsLBR1O6wEg/5N9+7Oyo=; b=STGnVhtFw25za/l207O3nHOlBFQoOEITsJPL33hdZW0m0H2VUa1o/jx54naF609Wd8 ry5W7MPFig72+dUlVCItggQMDfP9IvFX1JAKDGhvJr0qbK8q+QYd8xdMtReyu/rjqJMf 3Ds4mhv9dcweJ9mSV9JO8cbrH4LolBajtsZq4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=WeKaIIv4hrfvkn10+/BTbX4DsLBR1O6wEg/5N9+7Oyo=; b=LXcCU1kNPmSfZ/SQEgDny9bNHPQCkuKKNGqzQPN2+Uo/J+9dt6v96EcqFe4xdl8Ec7 F25ci2LreRBEDi3ROs80xQXtyxcPmQu+GPFFfemW5Oo0jqWSKXagR52f6JVQkZ+GNEqa nUfMUWGMAak1QcvroVCee/1a/EvN27dWXOLe3gUXySxOUx1/SgHOEVbYvV8CU8uXhX3v GQMYoi51qULJd/cZoLVRJ57bP48NkIebXOAa74xyj+4753i4iHAHOQchgJrbXeJ/9D9X g9Esx4nFAaR32GlrswWJlysqxMDv5PCbt2XekpUqAH15+YEtoe8qQnfZuF9rvGBvbrtk FD6Q== X-Gm-Message-State: ABUngvdpF/6xrG/As5XG55DQ/lGeRJE2zb8EaVoRSIkAtBKZzfZ1zWiCi0uoJNXRD9ibN/Tj X-Received: by 10.25.129.148 with SMTP id c142mr7271746lfd.136.1478614865891; Tue, 08 Nov 2016 06:21:05 -0800 (PST) Received: from kbp1-lhp-f55441.synapse.com ([195.238.93.38]) by smtp.gmail.com with ESMTPSA id 29sm6178773lft.43.2016.11.08.06.21.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 08 Nov 2016 06:21:05 -0800 (PST) From: Iurii Mykhalskyi To: xen-devel@lists.xen.org Date: Tue, 8 Nov 2016 16:20:54 +0200 Message-Id: <20161108142054.23017-1-iurii.mykhalskyi@globallogic.com> X-Mailer: git-send-email 2.10.2 Cc: julien.grall@arm.com, sstabellini@kernel.org Subject: [Xen-devel] [PATCH] arm64:renesas: Introduce early console for Salvator-X board X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Iurii Konovalenko Add support for the "Salvator-X" development board based on R-Car H3 SoC which has SCIF compatible UART. Signed-off-by: Iurii Konovalenko Signed-off-by: Iurii Mykhalskyi --- xen/arch/arm/Rules.mk | 1 + xen/arch/arm/arm64/debug-scif.inc | 51 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+) create mode 100644 xen/arch/arm/arm64/debug-scif.inc diff --git a/xen/arch/arm/Rules.mk b/xen/arch/arm/Rules.mk index 569a0ba..7989634 100644 --- a/xen/arch/arm/Rules.mk +++ b/xen/arch/arm/Rules.mk @@ -34,6 +34,7 @@ EARLY_PRINTK_fastmodel := pl011,0x1c090000,115200 EARLY_PRINTK_exynos5250 := exynos4210,0x12c20000 EARLY_PRINTK_juno := pl011,0x7ff80000 EARLY_PRINTK_lager := scif,0xe6e60000 +EARLY_PRINTK_salvator := scif,0xe6e88000 EARLY_PRINTK_midway := pl011,0xfff36000 EARLY_PRINTK_omap5432 := 8250,0x48020000,2 EARLY_PRINTK_seattle := pl011,0xe1010000 diff --git a/xen/arch/arm/arm64/debug-scif.inc b/xen/arch/arm/arm64/debug-scif.inc new file mode 100644 index 0000000..1f4d657 --- /dev/null +++ b/xen/arch/arm/arm64/debug-scif.inc @@ -0,0 +1,51 @@ +/* + * xen/arch/arm/arm64/debug-scif.inc + * + * SCIF specific debug code + * + * Oleksandr Tyshchenko + * Iurii Konovalenko + * Iurii Mykhalskyi + * Copyright (C) 2014-2016, Globallogic. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +#include + +/* SCIF UART wait UART to be ready to transmit + * rb: register which contains the UART base address + * rc: scratch register + */ +.macro early_uart_ready xb c +1: + ldrh w\c, [\xb, #SCIF_SCFSR] /* <- SCFSR (status register) */ + tst w\c, #SCFSR_TDFE /* Check TDFE bit */ + beq 1b /* Wait for the UART to be ready */ +.endm + +/* SCIF UART transmit character + * rb: register which contains the UART base address + * rt: register which contains the character to transmit + */ +.macro early_uart_transmit xb wt + strb \wt, [\xb, #SCIF_SCFTDR] /* -> SCFTDR (data register) */ + ldrh \wt, [\xb, #SCIF_SCFSR] /* <- SCFSR (status register) */ + and \wt, \wt, #(~(SCFSR_TEND | SCFSR_TDFE)) /* Clear TEND and TDFE bits */ + strh \wt, [\xb, #SCIF_SCFSR] /* -> SCFSR (status register) */ +.endm + +/* + * Local variables: + * mode: ASM + * indent-tabs-mode: nil + * End: + */