From patchwork Wed Jan 31 11:50:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Ernberg X-Patchwork-Id: 13539349 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E4803C47258 for ; Wed, 31 Jan 2024 11:51:30 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.673957.1048563 (Exim 4.92) (envelope-from ) id 1rV97Y-0007d2-Lg; Wed, 31 Jan 2024 11:51:12 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 673957.1048563; Wed, 31 Jan 2024 11:51:12 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1rV97Y-0007cf-FL; Wed, 31 Jan 2024 11:51:12 +0000 Received: by outflank-mailman (input) for mailman id 673957; Wed, 31 Jan 2024 11:50:23 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1rV96l-0007Xr-E3 for xen-devel@lists.xenproject.org; Wed, 31 Jan 2024 11:50:23 +0000 Received: from mail.actia.se (mail.actia.se [212.181.117.226]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id e968e46c-c02e-11ee-98f5-efadbce2ee36; Wed, 31 Jan 2024 12:50:21 +0100 (CET) Received: from S036ANL.actianordic.se (10.12.31.117) by S036ANL.actianordic.se (10.12.31.117) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Wed, 31 Jan 2024 12:50:20 +0100 Received: from S036ANL.actianordic.se ([fe80::e13e:1feb:4ea6:ec69]) by S036ANL.actianordic.se ([fe80::e13e:1feb:4ea6:ec69%4]) with mapi id 15.01.2507.035; Wed, 31 Jan 2024 12:50:20 +0100 X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: e968e46c-c02e-11ee-98f5-efadbce2ee36 From: John Ernberg To: Stefano Stabellini , Julien Grall , Bertrand Marquis , Michal Orzel , Volodymyr Babchuk CC: Peng Fan , Jonas Blixt , "xen-devel@lists.xenproject.org" , "John Ernberg" Subject: [PATCH 1/2] xen/arm: Add imx8q{m,x} platform glue Thread-Topic: [PATCH 1/2] xen/arm: Add imx8q{m,x} platform glue Thread-Index: AQHaVDuqVQ/kgxLZgUK/m8/hE0ez5Q== Date: Wed, 31 Jan 2024 11:50:20 +0000 Message-ID: <20240131114952.305805-2-john.ernberg@actia.se> References: <20240131114952.305805-1-john.ernberg@actia.se> In-Reply-To: <20240131114952.305805-1-john.ernberg@actia.se> Accept-Language: en-US, sv-SE Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mailer: git-send-email 2.43.0 x-originating-ip: [10.12.12.30] x-esetresult: clean, is OK x-esetid: 37303A2958D72955667360 MIME-Version: 1.0 When using Linux for dom0 there are a bunch of drivers that need to do SMC SIP calls into the PSCI provider to enable certain hardware bits like the watchdog. Provide a basic platform glue that implements the needed SMC forwarding. Signed-off-by: John Ernberg --- NOTE: This is based on code found in NXP Xen tree located here: https://github.com/nxp-imx/imx-xen/blob/lf-5.10.y_4.13/xen/arch/arm/platforms/imx8qm.c xen/arch/arm/platforms/Makefile | 1 + xen/arch/arm/platforms/imx8qm.c | 65 +++++++++++++++++++++++++++++++++ 2 files changed, 66 insertions(+) create mode 100644 xen/arch/arm/platforms/imx8qm.c diff --git a/xen/arch/arm/platforms/Makefile b/xen/arch/arm/platforms/Makefile index 8632f4115f..bec6e55d1f 100644 --- a/xen/arch/arm/platforms/Makefile +++ b/xen/arch/arm/platforms/Makefile @@ -9,5 +9,6 @@ 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_ALL64_PLAT) += imx8qm.o obj-$(CONFIG_MPSOC_PLATFORM) += xilinx-zynqmp.o obj-$(CONFIG_MPSOC_PLATFORM) += xilinx-zynqmp-eemi.o diff --git a/xen/arch/arm/platforms/imx8qm.c b/xen/arch/arm/platforms/imx8qm.c new file mode 100644 index 0000000000..a9cd9c3615 --- /dev/null +++ b/xen/arch/arm/platforms/imx8qm.c @@ -0,0 +1,65 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ +/* + * xen/arch/arm/platforms/imx8qm.c + * + * i.MX 8QM setup + * + * Copyright (c) 2016 Freescale Inc. + * Copyright 2018-2019 NXP + * + * + * Peng Fan + */ + +#include +#include + +static const char * const imx8qm_dt_compat[] __initconst = +{ + "fsl,imx8qm", + "fsl,imx8qxp", + NULL +}; + +static bool imx8qm_smc(struct cpu_user_regs *regs) +{ + struct arm_smccc_res res; + + if ( !cpus_have_const_cap(ARM_SMCCC_1_1) ) + { + printk_once(XENLOG_WARNING "no SMCCC 1.1 support. Disabling firmware calls\n"); + + return false; + } + + arm_smccc_1_1_smc(get_user_reg(regs, 0), + get_user_reg(regs, 1), + get_user_reg(regs, 2), + get_user_reg(regs, 3), + get_user_reg(regs, 4), + get_user_reg(regs, 5), + get_user_reg(regs, 6), + get_user_reg(regs, 7), + &res); + + set_user_reg(regs, 0, res.a0); + set_user_reg(regs, 1, res.a1); + set_user_reg(regs, 2, res.a2); + set_user_reg(regs, 3, res.a3); + + return true; +} + +PLATFORM_START(imx8qm, "i.MX 8") + .compatible = imx8qm_dt_compat, + .smc = imx8qm_smc, +PLATFORM_END + +/* + * Local variables: + * mode: C + * c-file-style: "BSD" + * c-basic-offset: 4 + * indent-tabs-mode: nil + * End: + */ From patchwork Wed Jan 31 11:50:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Ernberg X-Patchwork-Id: 13539350 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 53F0CC47DDF for ; Wed, 31 Jan 2024 11:51:31 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.673958.1048566 (Exim 4.92) (envelope-from ) id 1rV97Y-0007ic-Rp; Wed, 31 Jan 2024 11:51:12 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 673958.1048566; Wed, 31 Jan 2024 11:51:12 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1rV97Y-0007h2-Nx; Wed, 31 Jan 2024 11:51:12 +0000 Received: by outflank-mailman (input) for mailman id 673958; Wed, 31 Jan 2024 11:50:24 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1rV96m-0007Xr-A9 for xen-devel@lists.xenproject.org; Wed, 31 Jan 2024 11:50:24 +0000 Received: from mail.actia.se (mail.actia.se [212.181.117.226]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id ea699cf4-c02e-11ee-98f5-efadbce2ee36; Wed, 31 Jan 2024 12:50:22 +0100 (CET) Received: from S036ANL.actianordic.se (10.12.31.117) by S036ANL.actianordic.se (10.12.31.117) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Wed, 31 Jan 2024 12:50:20 +0100 Received: from S036ANL.actianordic.se ([fe80::e13e:1feb:4ea6:ec69]) by S036ANL.actianordic.se ([fe80::e13e:1feb:4ea6:ec69%4]) with mapi id 15.01.2507.035; Wed, 31 Jan 2024 12:50:20 +0100 X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: ea699cf4-c02e-11ee-98f5-efadbce2ee36 From: John Ernberg To: Stefano Stabellini , Julien Grall , Bertrand Marquis , Michal Orzel , Volodymyr Babchuk CC: Peng Fan , Jonas Blixt , "xen-devel@lists.xenproject.org" , "John Ernberg" Subject: [PATCH 2/2] xen/drivers: imx-lpuart: Add iMX8QXP compatible Thread-Topic: [PATCH 2/2] xen/drivers: imx-lpuart: Add iMX8QXP compatible Thread-Index: AQHaVDuqVZ6MA3Rd4EaFO4eTM5QUaw== Date: Wed, 31 Jan 2024 11:50:20 +0000 Message-ID: <20240131114952.305805-3-john.ernberg@actia.se> References: <20240131114952.305805-1-john.ernberg@actia.se> In-Reply-To: <20240131114952.305805-1-john.ernberg@actia.se> Accept-Language: en-US, sv-SE Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mailer: git-send-email 2.43.0 x-originating-ip: [10.12.12.30] x-esetresult: clean, is OK x-esetid: 37303A2958D72955667360 MIME-Version: 1.0 Allow the uart to probe also with iMX8QXP. The ip-block is the same as in the QM, only the compatible is needed. Signed-off-by: John Ernberg Acked-by: Julien Grall --- xen/drivers/char/imx-lpuart.c | 1 + 1 file changed, 1 insertion(+) diff --git a/xen/drivers/char/imx-lpuart.c b/xen/drivers/char/imx-lpuart.c index 77f70c2719..c85e81109a 100644 --- a/xen/drivers/char/imx-lpuart.c +++ b/xen/drivers/char/imx-lpuart.c @@ -257,6 +257,7 @@ static int __init imx_lpuart_init(struct dt_device_node *dev, static const struct dt_device_match imx_lpuart_dt_compat[] __initconst = { DT_MATCH_COMPATIBLE("fsl,imx8qm-lpuart"), + DT_MATCH_COMPATIBLE("fsl,imx8qxp-lpuart"), { /* sentinel */ }, };