From nobody Sat May 18 00:59:49 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1706701900646598.3357357615654; Wed, 31 Jan 2024 03:51:40 -0800 (PST) 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 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-Outflank-Mailman: Message body and most headers restored to incoming version 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 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-ZM-MESSAGEID: 1706701901568100005 Content-Type: text/plain; charset="utf-8" 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/platfor= ms/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/Makef= ile index 8632f4115f..bec6e55d1f 100644 --- a/xen/arch/arm/platforms/Makefile +++ b/xen/arch/arm/platforms/Makefile @@ -9,5 +9,6 @@ obj-$(CONFIG_ALL_PLAT) +=3D sunxi.o obj-$(CONFIG_ALL64_PLAT) +=3D thunderx.o obj-$(CONFIG_ALL64_PLAT) +=3D xgene-storm.o obj-$(CONFIG_ALL64_PLAT) +=3D brcm-raspberry-pi.o +obj-$(CONFIG_ALL64_PLAT) +=3D imx8qm.o obj-$(CONFIG_MPSOC_PLATFORM) +=3D xilinx-zynqmp.o obj-$(CONFIG_MPSOC_PLATFORM) +=3D xilinx-zynqmp-eemi.o diff --git a/xen/arch/arm/platforms/imx8qm.c b/xen/arch/arm/platforms/imx8q= m.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 =3D +{ + "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 firmwa= re 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 =3D imx8qm_dt_compat, + .smc =3D imx8qm_smc, +PLATFORM_END + +/* + * Local variables: + * mode: C + * c-file-style: "BSD" + * c-basic-offset: 4 + * indent-tabs-mode: nil + * End: + */ --=20 2.43.0 From nobody Sat May 18 00:59:49 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1706701897998708.0552806891184; Wed, 31 Jan 2024 03:51:37 -0800 (PST) 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 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-Outflank-Mailman: Message body and most headers restored to incoming version 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 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-ZM-MESSAGEID: 1706701899878100001 Content-Type: text/plain; charset="utf-8" Allow the uart to probe also with iMX8QXP. The ip-block is the same as in t= he 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 =3D { DT_MATCH_COMPATIBLE("fsl,imx8qm-lpuart"), + DT_MATCH_COMPATIBLE("fsl,imx8qxp-lpuart"), { /* sentinel */ }, }; =20 --=20 2.43.0