From patchwork Mon Jul 29 13:19:20 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stewart Hildebrand X-Patchwork-Id: 11063827 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3008A13B1 for ; Mon, 29 Jul 2019 13:20:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2157820121 for ; Mon, 29 Jul 2019 13:20:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 15AD82624D; Mon, 29 Jul 2019 13:20:46 +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=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 9B62027C2D for ; Mon, 29 Jul 2019 13:20:45 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hs5Yt-0004Wy-61; Mon, 29 Jul 2019 13:19:35 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hs5Yr-0004WR-OM for xen-devel@lists.xenproject.org; Mon, 29 Jul 2019 13:19:33 +0000 X-Inumbo-ID: 7f8d9030-b203-11e9-8980-bc764e045a96 Received: from webmail.dornerworks.com (unknown [12.207.209.150]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTP id 7f8d9030-b203-11e9-8980-bc764e045a96; Mon, 29 Jul 2019 13:19:32 +0000 (UTC) From: Stewart Hildebrand To: Date: Mon, 29 Jul 2019 09:19:20 -0400 Message-ID: <2473fc46a8229bb2434a90a510136202e7479177.1564371527.git.stewart.hildebrand@dornerworks.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: References: MIME-Version: 1.0 X-Originating-IP: [172.27.12.5] X-ClientProxiedBy: Mcbain.dw.local (172.27.1.45) To Mcbain.dw.local (172.27.1.45) Subject: [Xen-devel] [PATCH v2 2/2] xen/arm: platform: Add Raspberry Pi platform X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Andre Przywara , Julien Grall , Stefano Stabellini , Volodymyr Babchuk Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP The aux peripherals (uart1, spi1, and spi2) share an IRQ and a page of memory. For debugging, it is helpful to use the aux UART in Xen. In this case, Xen would try to assign spi1 and spi2 to dom0, but this results in an error since the shared IRQ was already assigned to Xen. Blacklist aux devices other than the UART to prevent mapping the shared IRQ and memory range to dom0. Signed-off-by: Stewart Hildebrand Acked-by: Julien Grall --- xen/arch/arm/platforms/Makefile | 1 + xen/arch/arm/platforms/brcm-raspberry-pi.c | 55 ++++++++++++++++++++++ 2 files changed, 56 insertions(+) create mode 100644 xen/arch/arm/platforms/brcm-raspberry-pi.c diff --git a/xen/arch/arm/platforms/Makefile b/xen/arch/arm/platforms/Makefile index 01608f89ee..8632f4115f 100644 --- a/xen/arch/arm/platforms/Makefile +++ b/xen/arch/arm/platforms/Makefile @@ -8,5 +8,6 @@ obj-$(CONFIG_ALL64_PLAT) += seattle.o obj-$(CONFIG_ALL_PLAT) += sunxi.o obj-$(CONFIG_ALL64_PLAT) += thunderx.o obj-$(CONFIG_ALL64_PLAT) += xgene-storm.o +obj-$(CONFIG_ALL64_PLAT) += brcm-raspberry-pi.o obj-$(CONFIG_MPSOC_PLATFORM) += xilinx-zynqmp.o obj-$(CONFIG_MPSOC_PLATFORM) += xilinx-zynqmp-eemi.o diff --git a/xen/arch/arm/platforms/brcm-raspberry-pi.c b/xen/arch/arm/platforms/brcm-raspberry-pi.c new file mode 100644 index 0000000000..e22d2b3184 --- /dev/null +++ b/xen/arch/arm/platforms/brcm-raspberry-pi.c @@ -0,0 +1,55 @@ +/* + * xen/arch/arm/platforms/brcm-raspberry-pi.c + * + * Raspberry Pi 4 Platform specific settings. + * + * Stewart Hildebrand + * Copyright (c) 2019 DornerWorks, Ltd + * + * 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 brcm_bcm2838_dt_compat[] __initconst = +{ + "brcm,bcm2838", + NULL +}; + +static const struct dt_device_match brcm_bcm2838_blacklist_dev[] __initconst = +{ + /* + * The aux SPIs share an IRQ and a page with the aux UART. + * If the same page gets mapped to dom0 and Xen, there is risk of + * dom0 writing to the UART that Xen controls. + */ + DT_MATCH_COMPATIBLE("brcm,bcm2835-aux-spi"), + /* + * The aux peripheral also shares a page with the aux UART. + */ + DT_MATCH_COMPATIBLE("brcm,bcm2835-aux"), + { /* sentinel */ }, +}; + +PLATFORM_START(brcm_bcm2838, "Raspberry Pi 4") + .compatible = brcm_bcm2838_dt_compat, + .blacklist_dev = brcm_bcm2838_blacklist_dev, +PLATFORM_END + +/* + * Local variables: + * mode: C + * c-file-style: "BSD" + * c-basic-offset: 4 + * indent-tabs-mode: nil + * End: + */