From patchwork Mon Jul 4 06:51:53 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dirk Behme X-Patchwork-Id: 9211687 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 7A19D60571 for ; Mon, 4 Jul 2016 06:54:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6A62B284FA for ; Mon, 4 Jul 2016 06:54:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5F3332860D; Mon, 4 Jul 2016 06:54:35 +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=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,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 9ACFF28608 for ; Mon, 4 Jul 2016 06:54:33 +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 1bJxjp-0007OG-Kh; Mon, 04 Jul 2016 06:52:13 +0000 Received: from mail6.bemta6.messagelabs.com ([85.158.143.247]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bJxjn-0007OA-IC for xen-devel@lists.xenproject.org; Mon, 04 Jul 2016 06:52:12 +0000 Received: from [85.158.143.35] by server-2.bemta-6.messagelabs.com id 6E/C5-11548-A970A775; Mon, 04 Jul 2016 06:52:10 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrCIsWRWlGSWpSXmKPExsXSzf+WW3cWe1W 4Qe8HAYvvWyYzOTB6HP5whSWAMYo1My8pvyKBNWPhvFaWgl96FV+a1zE1ME5R62Lk4hASOMMo cX33EUYQh0XgLZPEhHuT2CEyzxglbl9cwwzhrGaUeNi0CCjDCeSsZJRY9KwIxGYT0JLYOaEDL C4iUC6xat8j1i5GDg5mAQ2JDdvAwsICoRKXlm1gArFZBFQkDr16BGbzCrhLnLw+iwXElhCQk1 g3+Ts7RFxQ4uTMJ2BxZgEJiYMvXjBD1IhITPz7ng3CtpRoef0B7DYJgUMsEg8ObWKdwCg4C0n /LCT9CxiZVjGqF6cWlaUW6RrpJRVlpmeU5CZm5ugaGpjp5aYWFyemp+YkJhXrJefnbmIEhigD EOxgXPbX6RCjJAeTkigvl3N5uBBfUn5KZUZicUZ8UWlOavEhRhkODiUJ3uesVeFCgkWp6akVa Zk5wGiBSUtw8CiJ8D4GSfMWFyTmFmemQ6ROMepyzJu06xiTEEtefl6qlDjvG5AiAZCijNI8uB GwyL3EKCslzMsIdJQQT0FqUW5mCar8K0ZxDkYlYd7vIFN4MvNK4Da9AjqCCegI1thykCNKEhF SUg2Mghxl/xbYHZnZzrbs3Y/qNTxFrhVNE3/pNKa1LpJ++KYvf8OR10IZd+z+zYq8KNbSLcb2 ZfOeeU+EOMzEPvyJ2aQ8/3Rh+uEklVrVW00lEsKyW/33X9nGJzrr+AVXy2tZKjmxfG8Oes63E Z8mMNX1//Nw7YCW2pQz9UpfnSSL5tsV9WvJKvkosRRnJBpqMRcVJwIA/YxcdNcCAAA= X-Env-Sender: Dirk.Behme@de.bosch.com X-Msg-Ref: server-3.tower-21.messagelabs.com!1467615130!21589318!1 X-Originating-IP: [139.15.237.11] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogMTM5LjE1LjIzNy4xMSA9PiAxNTMwMzA=\n X-StarScan-Received: X-StarScan-Version: 8.46; banners=-,-,- X-VirusChecked: Checked Received: (qmail 817 invoked from network); 4 Jul 2016 06:52:10 -0000 Received: from smtp6-v.fe.bosch.de (HELO smtp6-v.fe.bosch.de) (139.15.237.11) by server-3.tower-21.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 4 Jul 2016 06:52:10 -0000 Received: from vsmta14.fe.internet.bosch.com (unknown [10.4.98.54]) by imta24.fe.bosch.de (Postfix) with ESMTP id BB9EED8009E for ; Mon, 4 Jul 2016 08:52:09 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=de.bosch.com; s=2015-01-21; t=1467615129; bh=yk/x1z8Bbau2wx6fKtW2+GKoo4GQya7St2fzUA2BlyE=; l=10; h=From:From:Reply-To:Sender; b=jWyY7lUdm7ZZfdv5E7jCDRo40MIwvT3hj/DU7iAU1afKvLm3W8f/Ajk0Iom0lTJid tm93A63MEPfumauO+NPYsDBohs9KZRQA5tSMuljuxOJI9SPUTkbjpMCJSclca9R0sJ 2sIU+kCqWOX341C3rZS2OZnQmcWWDyyb/6bF373o= Received: from SI-HUB1001.de.bosch.com (vsgw23.fe.internet.bosch.com [10.4.98.23]) by vsmta14.fe.internet.bosch.com (Postfix) with ESMTP id 62239A406F6 for ; Mon, 4 Jul 2016 08:52:09 +0200 (CEST) Received: from hi-z08if.hi.de.bosch.com (10.34.209.31) by SI-HUB1001.de.bosch.com (10.4.103.108) with Microsoft SMTP Server id 14.3.195.1; Mon, 4 Jul 2016 08:52:09 +0200 Received: from hi-z08if.hi.de.bosch.com (localhost [127.0.0.1]) by hi-z08if.hi.de.bosch.com (Postfix) with ESMTP id 6D8E2625EB1; Mon, 4 Jul 2016 08:51:55 +0200 (CEST) From: Dirk Behme To: , Julien Grall , Stefano Stabellini Date: Mon, 4 Jul 2016 08:51:53 +0200 Message-ID: <1467615113-31790-1-git-send-email-dirk.behme@de.bosch.com> X-Mailer: git-send-email 2.8.0 MIME-Version: 1.0 X-TM-AS-MML: disable X-TM-AS-Product-Ver: IMSS-7.1.0.1679-8.0.0.1202-22428.006 X-TMASE-MatchedRID: 6+aEHrCLaIPMH3UUlIWGIAKDWtq/hHcNqRJADL2kfSmwucNx4BfFIqSd 3wubgak2t+ki9vYAWeZw0iJseba5ZEamqpascKYdy5W47xashgPDHSNFHFxB801KG1YrOQW/XW+ E/iiUt3HsJbnEUDpZMnybR4oj90UAlh+IkeJQ88aZroPNdqiG873gm8md8Wse/ZNsWvQIY4MRxF rdczkl5Gm1Iwo+7wiOhEl83roP9JxYQsNwrAY7bkhwlOfYeSqxPgfiGiot4kmrzPs85fwUk5SDT 5+O4bTj2B9o2LuaY2fXi72MrDF+OmgAguu6mUCq82YZTB0b+K/KSSY85EbkdTgU38Ed8RQ6o8WM kQWv6iXBcIE78YqRWo6HM5rqDwqtwJzSQL97XIeh62JgryY6ZwyROxcz84B6U5vSRSVdI6PGQKu 0uZyeM7q8dCh0Kn+vSSW1LbsxM4fxRmvQUIm05KBVgqkLioI0o/G+4k9fsa9mNZ8xUDzC8x8CMV sKypBZfuHvzFCR4y9AE5jBDrz5qWcjFnImzvyS Cc: Dirk Behme Subject: [Xen-devel] [PATCH] xen: arm64: Add support for Renesas RCar Gen3 H3 Salvator-X platform 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: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Dirk Behme --- docs/misc/arm/early-printk.txt | 1 + xen/arch/arm/Rules.mk | 1 + xen/arch/arm/arm64/debug-scif.inc | 54 +++++++++++++++++++++++++++++++++++++++ xen/arch/arm/platforms/Makefile | 1 + xen/arch/arm/platforms/rcar3.c | 41 +++++++++++++++++++++++++++++ xen/drivers/char/Kconfig | 2 +- 6 files changed, 99 insertions(+), 1 deletion(-) create mode 100644 xen/arch/arm/arm64/debug-scif.inc create mode 100644 xen/arch/arm/platforms/rcar3.c diff --git a/docs/misc/arm/early-printk.txt b/docs/misc/arm/early-printk.txt index 41b528b..20acbc7 100644 --- a/docs/misc/arm/early-printk.txt +++ b/docs/misc/arm/early-printk.txt @@ -41,6 +41,7 @@ the name of the machine: - lager: printk with SCIF0 on Renesas R-Car H2 processors - midway: printk with the pl011 on Calxeda Midway processors - omap5432: printk with UART3 on TI OMAP5432 processors + - salvator-x: printk with SCIF2 on Renesas R-Car H3 processors - seattle: printk with pl011 for AMD Seattle processor - sun6i: printk with 8250 on Allwinner A31 processors - sun7i: printk with 8250 on Allwinner A20 processors diff --git a/xen/arch/arm/Rules.mk b/xen/arch/arm/Rules.mk index 93304be..3003e7b 100644 --- a/xen/arch/arm/Rules.mk +++ b/xen/arch/arm/Rules.mk @@ -36,6 +36,7 @@ EARLY_PRINTK_juno := pl011,0x7ff80000 EARLY_PRINTK_lager := scif,0xe6e60000 EARLY_PRINTK_midway := pl011,0xfff36000 EARLY_PRINTK_omap5432 := 8250,0x48020000,2 +EARLY_PRINTK_salvator-x := scif,0xe6e88000 EARLY_PRINTK_seattle := pl011,0xe1010000 EARLY_PRINTK_sun6i := 8250,0x01c28000,2 EARLY_PRINTK_sun7i := 8250,0x01c28000,2 diff --git a/xen/arch/arm/arm64/debug-scif.inc b/xen/arch/arm/arm64/debug-scif.inc new file mode 100644 index 0000000..ff91c32 --- /dev/null +++ b/xen/arch/arm/arm64/debug-scif.inc @@ -0,0 +1,54 @@ +/* + * xen/arch/arm/arm64/debug-scif.inc + * + * SCIF specific debug code + * + * Based on xen/arch/arm/arm32/debug-scif.inc by + * Oleksandr Tyshchenko + * Copyright (C) 2014, Globallogic. + * + * Port to AARCH64 by + * Dirk Behme + * Copyright (C) 2016, Robert Bosch Car Multimedia + * + * 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: + */ diff --git a/xen/arch/arm/platforms/Makefile b/xen/arch/arm/platforms/Makefile index 3689eec..01c8ebc 100644 --- a/xen/arch/arm/platforms/Makefile +++ b/xen/arch/arm/platforms/Makefile @@ -5,6 +5,7 @@ obj-$(CONFIG_ARM_32) += midway.o obj-$(CONFIG_ARM_32) += omap5.o obj-$(CONFIG_ARM_32) += sunxi.o obj-$(CONFIG_ARM_32) += rcar2.o +obj-$(CONFIG_ARM_64) += rcar3.o obj-$(CONFIG_ARM_64) += seattle.o obj-$(CONFIG_ARM_64) += xgene-storm.o obj-$(CONFIG_ARM_64) += xilinx-zynqmp.o diff --git a/xen/arch/arm/platforms/rcar3.c b/xen/arch/arm/platforms/rcar3.c new file mode 100644 index 0000000..5a53f15 --- /dev/null +++ b/xen/arch/arm/platforms/rcar3.c @@ -0,0 +1,41 @@ +/* + * xen/arch/arm/platforms/rcar3.c + * + * Renesas R-Car Gen3 specific settings + * + * Dirk Behme + * + * based on Renesas R-Car Gen2 specific settings + * Iurii Konovalenko + * + * 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 + +static const char const *rcar3_dt_compat[] __initdata = +{ + "renesas,salvator-x", + NULL +}; + +PLATFORM_START(rcar3, "Renesas R-Car Gen3") + .compatible = rcar3_dt_compat, +PLATFORM_END + +/* + * Local variables: + * mode: C + * c-file-style: "BSD" + * c-basic-offset: 4 + * indent-tabs-mode: nil + * End: + */ diff --git a/xen/drivers/char/Kconfig b/xen/drivers/char/Kconfig index 08973cf..703a311 100644 --- a/xen/drivers/char/Kconfig +++ b/xen/drivers/char/Kconfig @@ -45,7 +45,7 @@ config HAS_OMAP config HAS_SCIF bool default y - depends on ARM_32 + depends on ARM help This selects the SuperH SCI(F) UART. If you have a SuperH based board, say Y.