From patchwork Thu Jan 14 07:27:58 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Peng Fan \(OSS\)" X-Patchwork-Id: 362851 Delivered-To: patch@linaro.org Received: by 2002:a02:ccad:0:0:0:0:0 with SMTP id t13csp447873jap; Thu, 14 Jan 2021 04:25:40 -0800 (PST) X-Google-Smtp-Source: ABdhPJyoZaLjqGHJYlsXBryhf/qNbd8ALBHir2/I7dJ2fUhJ9WCoN6d885XCjpwWRZSS82hB8GUM X-Received: by 2002:a17:907:961d:: with SMTP id gb29mr5117465ejc.460.1610627139987; Thu, 14 Jan 2021 04:25:39 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1610627139; cv=pass; d=google.com; s=arc-20160816; b=OD39lP4mzRrAVAefUEJH1D1eCn5AoMWdr/AEVvilvEv5LSjdsnPi7D1nvud8N96zXh aV6TWh+tUHy5Oxa1UnmP2SYZsGRHMk550M/7RSmqOXr1zQth4K7PF6CEaE03fzcFUZge dLiWZd1zIxPMNoeg3JDPKdxOXKA05X/LJg4GXZP0P9VTlArE93LnDjRSD8XWvNhScVlH kDf57vw9h04DkHfufK08Wkqxl72DXWh+Hfd44wsek0gfFZAyoVmbB5Io64gex+B0WGfa qOaiSQ28++InUkrH4zwv3Y9zgTdOlIee6fQ6zKFIkbU5Hzz1pSRxXvbSB3VqrHh501Hj Eu6Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:mime-version :content-transfer-encoding:message-id:date:subject:cc:to:from :dkim-signature; bh=5/l97LVeFZSELvy55SjZwXvP3aVUYukzeUoVVGS1VSY=; b=JSYXixBPs9BSuJwLR01MCoIp+G/xoeWM5WzNWJcXnJv8XKrXeKK/EZ2W0OvprNxNzT 7NwLossLqYsnYWfMLduGv4w9DYri80Jsb1FHaCj6LYlP3Kir6eGmUz6X2eL9ieiyH3bv gonb+exU+nYLT6n0KxyjaHspPave4APFydLztYww+8aOHrxISbc7c8Y5JBerxsgAxx+V hBXzGWk+CKnzUE1lEMjX03WrJxA92VWFl4VL2Ojw1sGMyFUlnsUqW+TwvpIxlyIBIhvP EEhxxP+vbXw1FGuiZzNVbY4sUSskkDrkvln62x3tw9cY0atgP1X7q2Av2Q2GNlx2meDx AqRA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@NXP1.onmicrosoft.com header.s=selector2-NXP1-onmicrosoft-com header.b=JsjCyHWf; arc=pass (i=1 spf=pass spfdomain=oss.nxp.com dkim=pass dkdomain=oss.nxp.com dmarc=pass fromdomain=oss.nxp.com); spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from phobos.denx.de (phobos.denx.de. [85.214.62.61]) by mx.google.com with ESMTPS id y36si1781934ede.158.2021.01.14.04.25.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Jan 2021 04:25:39 -0800 (PST) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; dkim=pass header.i=@NXP1.onmicrosoft.com header.s=selector2-NXP1-onmicrosoft-com header.b=JsjCyHWf; arc=pass (i=1 spf=pass spfdomain=oss.nxp.com dkim=pass dkdomain=oss.nxp.com dmarc=pass fromdomain=oss.nxp.com); spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 26D1B8271C; Thu, 14 Jan 2021 13:25:36 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=oss.nxp.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=NXP1.onmicrosoft.com header.i=@NXP1.onmicrosoft.com header.b="JsjCyHWf"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 1D12D8271A; Thu, 14 Jan 2021 07:59:09 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,FORGED_SPF_HELO,MSGID_FROM_MTA_HEADER,RCVD_IN_DNSWL_LOW, SPF_HELO_PASS autolearn=no autolearn_force=no version=3.4.2 Received: from EUR02-HE1-obe.outbound.protection.outlook.com (mail-he1eur02on060b.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe05::60b]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 2B633826F5 for ; Thu, 14 Jan 2021 07:59:06 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=oss.nxp.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=peng.fan@oss.nxp.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=A/ffcONq9lPwExSihooUV1LbwH8Pa3gzu47CWOrkn97CTO1Q9aBxD4BXDK/eEjSIOqDlerxiRovOUgOtTFCwEpAsC/MMAPrBmqpLux9dWLTkTb6VKYHuglvsj/XtNeKqDErfTAuFE2QWShTWBoPLajzNq4HjKBdJ6vnBEGpB2l2qGPGSou3YJ3qkNEC3efg7Q8BU+22thcYMSexcNkGfuA+roMFHsqVBRYScNjtMXL2FtkWiCWuaGpiBcM2zjdMbyBK62f3wrbOlHxyirm7QH73YVJtP9jSKXMe62DiwvlwUS7FagFPIqHdBw8pPlaA4N2NXeU2XHkZWRyNz0k92Jg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=5/l97LVeFZSELvy55SjZwXvP3aVUYukzeUoVVGS1VSY=; b=Kus4qGqWVeP/tEalvkvO4ipRDaCOdCRpgqpfXmny1H7XfTNBemMXjZDA9I9/J9SsPKuYppiHUNyJn9P+wtsP9jrNCVUZ1ix3jI746kWE+sgVftDBA3JjK1+onDyGnlo2mZQwNJWgA0GEC5RGvRrYvfoBj2vn72WYsynO/8Y/8rEvxwNVwpIu2JorPSmQgoWMHA/No7qCobA4kV+ud5EpWl9Wy85FPD1EJtCA6djdLCPfK2MCpUXdxVTi38dlpCryxYH/DeoJ5uuRFoHXmNlW9I3Hd+hwTmiPNMhrCY8bXxtziZTjFf42DKUJRJT723B/11Ps8hDCv59A89AZRmVdvw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com; s=selector2-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=5/l97LVeFZSELvy55SjZwXvP3aVUYukzeUoVVGS1VSY=; b=JsjCyHWfcZmTVHSthLPFVoJmTpNvUj002/uni1UF5PPZ1e155OhnXSnZyn76xCCi7SAOnL1MlI2a9+YsLhZc70KE328JdrWk6Uag3encKL5uhyGI+WyL/i2fIarsB7eHjG56m9OVf6Jvlls3zNGD4Pld0Dlid8FgrjTCD4uzNnk= Authentication-Results: denx.de; dkim=none (message not signed) header.d=none; denx.de; dmarc=none action=none header.from=oss.nxp.com; Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) by DB7PR04MB4634.eurprd04.prod.outlook.com (2603:10a6:5:39::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3742.12; Thu, 14 Jan 2021 06:59:03 +0000 Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::c964:9:850a:fc5]) by DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::c964:9:850a:fc5%10]) with mapi id 15.20.3742.012; Thu, 14 Jan 2021 06:59:03 +0000 From: "Peng Fan (OSS)" To: sbabic@denx.de, festevam@gmail.com Cc: uboot-imx@nxp.com, u-boot@lists.denx.de, Peng Fan Subject: [PATCH 01/13] imx: lowlevel: implement armv8_el2_to_aarch32 Date: Thu, 14 Jan 2021 15:27:58 +0800 Message-Id: <20210114072810.11873-1-peng.fan@oss.nxp.com> X-Mailer: git-send-email 2.28.0 X-Originating-IP: [119.31.174.71] X-ClientProxiedBy: SG2PR03CA0144.apcprd03.prod.outlook.com (2603:1096:4:c8::17) To DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from linux-1xn6.ap.freescale.net (119.31.174.71) by SG2PR03CA0144.apcprd03.prod.outlook.com (2603:1096:4:c8::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3784.6 via Frontend Transport; Thu, 14 Jan 2021 06:59:00 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 8b7ccbec-20e5-4be4-9b2f-08d8b859e08e X-MS-TrafficTypeDiagnostic: DB7PR04MB4634: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:389; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: v1PginEEjg+fpKSfK0hphvsmAJWdF878WpeAp6BFmT+5q+ja5YcvpPsg5YJwB67MURyrrOshkWl0MyFNCzi+u1LCnnzFqRjfYOdcmZKiMHGdGufLnuQZQ5Y7IBeh6Ao9w8U3FbV1h9UGCSt4UgsUXZ6N0oi7JAkO/yqXR3q0oOnQInZEwNNlwHRrDZlcojap63nLOTdZvo1YQDp82auh9b6f36T9Uukijg/BFytWvC4TMUZ+CRM3Z4XwmhnLtMExFWgTsQDoScysnl4LJSsAMoPk8/uY1AXSUFT3gM5AT3xn8aOGTqr12UZyotqw+KyVz4Gg4c4wG5SiXGlaYTiZ2rba+hIH8+YKCnpVB/lma2zdSylZ5KHvhWRYntK+884unBIBrFBAn6AaFZ1r9t1jxQ== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB6PR0402MB2760.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(136003)(396003)(39860400002)(376002)(346002)(6506007)(66556008)(86362001)(4326008)(8676002)(2906002)(316002)(6486002)(5660300002)(66476007)(66946007)(8936002)(478600001)(52116002)(956004)(16526019)(26005)(1076003)(2616005)(6512007)(186003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: YwokVbtDOxlhgSJF/OglAy77zbuYcFQxDJuYxiQ5h8LsyijnkRqMz9KmgKVlx4fB7fk5zByWib2yfgKkDDj78QIbLVjO3YbVuq79vkT84LeTshbs1gTiIrpUbrJSZWc35dJhbFS9XdwOOXSAf3tKje2Q2QLCUK4HAYro6NKnJ5lN7CdQ9FVz8H4AbiQ0RSvw/xgV4QsHiGtesAneDa47CWR79BEYB5EubdHT1xxcyfNz9ueLTG3MSRz3MnNM4ZczZxe5HkMzT26pQEcDhdzoyJv4NxycpyoEDK2c4eLbnxN/vN0WNYJHeZXyQpoGSkJcpRrBF5+2aCAockZ9ZAhaOFozqYEH+ELUFYfUUeCKFkTRphkS8ZdgvDdiTE+WvZGsy4Zy3uzEP+sxEgf4y2tWvCUogu8NPHtwtZHmyEMSk7uFcsrA7I2vbzxSDetS5ELsWaiTx222n8Zwm1HjTlMBEf1pCwtRuQ5GxXmKPHkuL/HMsV/atpLfyoqpUDn17E0Lw5mLMehiG15KrO/oxpxvR/Lwt8cY9tCV8+OuHZUwf3QTEj7vCK2CkCUcpxsiMlUBx+MBylyD+EPMcDYhi3b/enhbUaZ0xa+Jy2VEFLT6IXBmSzV+WZ4gnG+DIOd3fd+XL5E6sWSMa3Or4OGpaSHSXX6wpjBfS8psqff/rTjmi1DHJ2RfHsPKNOB4Geus+pHnzuBSoAdoSNio5exxmnweiaCEaVyNSwWeXboulgQ7oA71e2fUJQYe84eASAt3j1I/g11TzAju3rq9vtNqGb3O1fwXo95u5rq/4s2HGE3f6T0NCt++PyqyDoKat5d4fA0UHk2ELT0yZ5VXT5dYqffQuSVY96zNf30QnlLgNi9kG+oj/OXeSJUSTVw+kRc6GbZSkU8ZBqfxTLcsrOJILrRToHjK9szCTRjYIx0b0YcZD5SOf5TUug6stuwPwibXKq/xnye7gsR9qqWWp2zLlEV63YBS/LLjSGnmKJkiySyMOpb1e4YFU5RGoMQy5gnvCYu+ X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-AuthSource: DB6PR0402MB2760.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Jan 2021 06:59:03.0398 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-Network-Message-Id: 8b7ccbec-20e5-4be4-9b2f-08d8b859e08e X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: qeSXcPOPCICDCwBl844bHQSzZTol32Z4wrN7SWqRBVivhNSrSIXxUMCLBrwXjYsowylAXI2TBdSpXyMX91BTwA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR04MB4634 X-Mailman-Approved-At: Thu, 14 Jan 2021 13:25:35 +0100 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.3 at phobos.denx.de X-Virus-Status: Clean From: Peng Fan Implement armv8_el2_to_aarch32 for aarch64 U-Boot booting aarch32 SMP linux. It will trap to ATF to let ATF handle the mode switching. Signed-off-by: Peng Fan --- arch/arm/mach-imx/lowlevel.S | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) -- 2.28.0 diff --git a/arch/arm/mach-imx/lowlevel.S b/arch/arm/mach-imx/lowlevel.S index 158fdb7d87..c500aa8123 100644 --- a/arch/arm/mach-imx/lowlevel.S +++ b/arch/arm/mach-imx/lowlevel.S @@ -20,3 +20,26 @@ ENTRY(lowlevel_init) isb ret ENDPROC(lowlevel_init) + +/* + * Switch from AArch64 EL2 to AArch32 EL2 + * @param inputs: + * x0: argument, zero + * x1: machine nr + * x2: fdt address + * x3: input argument + * x4: kernel entry point + * @param outputs for secure firmware: + * x0: function id + * x1: kernel entry point + * x2: machine nr + * x3: fdt address +*/ +.global armv8_el2_to_aarch32 +armv8_el2_to_aarch32: + mov x3, x2 + mov x2, x1 + mov x1, x4 + ldr x0, =0xc20000fd + smc #0 + ret From patchwork Thu Jan 14 07:28:07 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Peng Fan \(OSS\)" X-Patchwork-Id: 362852 Delivered-To: patch@linaro.org Received: by 2002:a02:ccad:0:0:0:0:0 with SMTP id t13csp448970jap; Thu, 14 Jan 2021 04:27:23 -0800 (PST) X-Google-Smtp-Source: ABdhPJxWWSr1YsMvP82vDZgcLrO4rDKI6yJecK1rrj0HRScr0Hz+8f3rgP3QOC0XZQOoPWxy1lRc X-Received: by 2002:a50:d685:: with SMTP id r5mr5708597edi.248.1610627243377; Thu, 14 Jan 2021 04:27:23 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1610627243; cv=pass; d=google.com; s=arc-20160816; b=pzraEPQSQdJFkrJmnMN/g0b0hNw6g691Hhs9nVo4Ox6lQh5lQt6TFfxKSfX576/cuc MRUxeewnm+X2hZbFxne16QAjTwEyeIPjDr5xAVEUSbPef9rzMMveIanVUkLY1NjfJbfd nMLbsr/jGQU+DqMtMudAG35P/QxJ2clWByqgex2IQ/ar5AFBY9gntfeHPUjAXcO2yxAm rovN0ha2Q3NZvMHUqWgDI8vFXv1vn73IuL542S+HpkW/FXuLlO4/apiM/lDTN2Qtqdpc Mu91LTHmfgLUfUVIzH14ckI7F+qF5jZW2B7AE7nshjGpsYPA0SXJmkDEhowhZv24rzst b0XQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:mime-version :content-transfer-encoding:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=DtSZ95K+OQl3W7FIG+7AiTbgy+Zj5SVCj6NXkSqrTns=; b=iLgVkIBHCbloclTB9SDVorbOLgmBp9lqT1Sa1FMUlsthwf1aogZ5YVQjJOpDXUEFHi x5TuHjs8qSxfq/lBWnj39fIDVTEwktXFRofjBMIe4pXqZ/kVTRSVVS5z/X/o/CvVUuGW AFZHfnkq3cpxWfcgU5Q7iuflKtUSSJASJbgzNao4knya2BRZdDGYijTOOjVBm98nar37 olmnohMFNJRHDajbJw0ddOmp8xRvM4G3jbWRj1adIyMzIDgWl5dsVw8wgtMASZDmuHME ABt5zR3B5AuzpbIqB9162vcy1ldyc5rWbVwAdBCDIEPtCFlIusPz96ZuhfgJT0IxNuRt oDOA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@NXP1.onmicrosoft.com header.s=selector2-NXP1-onmicrosoft-com header.b=SWYy5fIf; arc=pass (i=1 spf=pass spfdomain=oss.nxp.com dkim=pass dkdomain=oss.nxp.com dmarc=pass fromdomain=oss.nxp.com); spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from phobos.denx.de (phobos.denx.de. [2a01:238:438b:c500:173d:9f52:ddab:ee01]) by mx.google.com with ESMTPS id h24si2508725ejk.426.2021.01.14.04.27.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Jan 2021 04:27:23 -0800 (PST) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; Authentication-Results: mx.google.com; dkim=pass header.i=@NXP1.onmicrosoft.com header.s=selector2-NXP1-onmicrosoft-com header.b=SWYy5fIf; arc=pass (i=1 spf=pass spfdomain=oss.nxp.com dkim=pass dkdomain=oss.nxp.com dmarc=pass fromdomain=oss.nxp.com); spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 63637827A3; Thu, 14 Jan 2021 13:26:05 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=oss.nxp.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=NXP1.onmicrosoft.com header.i=@NXP1.onmicrosoft.com header.b="SWYy5fIf"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 698F3826F5; Thu, 14 Jan 2021 07:59:33 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,FORGED_SPF_HELO,MSGID_FROM_MTA_HEADER,RCVD_IN_DNSWL_LOW, SPF_HELO_PASS autolearn=no autolearn_force=no version=3.4.2 Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-vi1eur04on0630.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe0e::630]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 99BE88268C for ; Thu, 14 Jan 2021 07:59:30 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=oss.nxp.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=peng.fan@oss.nxp.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SkjDRJr7ysDSHFflJE/wX3JdgJZcR//STAIRHiAu3CZG7KcQb8tm3KIKP1wXSkUxJIqKyjpxwTzLI2ezP/e5q+J2Cw/12gioQjAJefxPTsKOidwm0RBiLAALy3jPYO4N1s/XGKQ1VSY+ZOlXAuC+R0UgkvsiTowXmE6y59woqSJeWf4mw7l1DciS+As8+rSzz9zFjSXnJalakAtZ6lh3YqgNiYMfhTcR3I95kLbl9ZBbCR/H581tcnOiwzR/gaXZHCbPDTu+fMjeOldMDSpis75+EjKxc0V40OEHjLpKrLMcwmRAqdg669MxukWWhRMDu/cxVR06rX7NBclP1eN4sA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=DtSZ95K+OQl3W7FIG+7AiTbgy+Zj5SVCj6NXkSqrTns=; b=Lnm+SetDMEKuo8e4G99VyBl7borB3Lbvb2Rk2FYjpC5/CpcaKq826QCalhFqU0H9oOnpzsgxph9wv66CIr+LwEmnYy1BijEXin0Qb7Qp3IPUmZOSDyBWvLd5P3bRKwXSeYICjeW0TISfUzK2jS4xWQSi2lG1gWOn57cIsCTzbQ817OoF3xtecuKc36bGHgb8XnN+xBBX2M/adDczbLTxIbAf0wKCyW/ISCL7eHrl/PDB+YA4ER4dF8m/KeZmKfehYlTA9VhrQQY3u/Tub1oevJBv2naPCmeXm30PwLSt/9KXi/E+dGw6ot8WfOS/1wtne+0vIBrAyaoPYt1DeNexLQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com; s=selector2-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=DtSZ95K+OQl3W7FIG+7AiTbgy+Zj5SVCj6NXkSqrTns=; b=SWYy5fIfoDz+6N4JPIyUa0CJeXMfi/+8n7DXFRXUfa9m/vtbTuIP83z2xTiD0sJsW8Z5x9cvf8Xp793PRE326pH827SHOW5Ik4KpypNbTfDZDi4rFTpSM4ZmAj1BFIIQNGBdPoJSpjh5CrQLAvnW1/8hfQFhUFqxmUTtfW3KtYQ= Authentication-Results: denx.de; dkim=none (message not signed) header.d=none; denx.de; dmarc=none action=none header.from=oss.nxp.com; Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) by DB7PR04MB4634.eurprd04.prod.outlook.com (2603:10a6:5:39::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3742.12; Thu, 14 Jan 2021 06:59:29 +0000 Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::c964:9:850a:fc5]) by DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::c964:9:850a:fc5%10]) with mapi id 15.20.3742.012; Thu, 14 Jan 2021 06:59:29 +0000 From: "Peng Fan (OSS)" To: sbabic@denx.de, festevam@gmail.com Cc: uboot-imx@nxp.com, u-boot@lists.denx.de, Peng Fan Subject: [PATCH 10/13] imx8m: add QSPI boot dev Date: Thu, 14 Jan 2021 15:28:07 +0800 Message-Id: <20210114072810.11873-10-peng.fan@oss.nxp.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20210114072810.11873-1-peng.fan@oss.nxp.com> References: <20210114072810.11873-1-peng.fan@oss.nxp.com> X-Originating-IP: [119.31.174.71] X-ClientProxiedBy: SG2PR03CA0144.apcprd03.prod.outlook.com (2603:1096:4:c8::17) To DB6PR0402MB2760.eurprd04.prod.outlook.com (2603:10a6:4:a1::14) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from linux-1xn6.ap.freescale.net (119.31.174.71) by SG2PR03CA0144.apcprd03.prod.outlook.com (2603:1096:4:c8::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3784.6 via Frontend Transport; Thu, 14 Jan 2021 06:59:26 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: f0dd2664-fde4-4ea6-b4a8-08d8b859effa X-MS-TrafficTypeDiagnostic: DB7PR04MB4634: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6108; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: uUiQNokUyh5K5IOVU5erSNP4vMkfQxImZKxwAMvKVlIJRSW20iWJllBGrcCYI4Le61Fskt5Uw2QV+o66Zb01YyoQ0gy83a6azyfBXg2EChm0HEWJ5FSxsB7dXPBZaz9zTbnwmp/Zljs7IyUoZNznqApd7kg0MatSwz9STvEKDuyH1R6lwXcVO/zTS+7N60udY/cIjOUGs5bd8XU9c/P9py6EhJkKt15zITW3Qjg3zik3GxrRO+RTkxE2EwLOCq8oJ/WEin6bvZtfw42XUccyUVxL+C0+GJp3b3EbrsJTGflG0VBI1E9sCFnA0D6wnV72cCtY8S8czybYo0D12CyNCFAsaai94+dksU3cQhe14sRFIOi/23UPR1HNavpxk7iQYyPOr5Dvf4hCGYcs7z+joF8hxi5KcDn1UGpKMB1hIEt1Mga97By4TfgwICydkfvt X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB6PR0402MB2760.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(136003)(396003)(39860400002)(376002)(346002)(6506007)(66556008)(86362001)(4326008)(8676002)(2906002)(316002)(6486002)(5660300002)(66476007)(66946007)(8936002)(478600001)(6666004)(83380400001)(52116002)(956004)(16526019)(26005)(1076003)(2616005)(6512007)(186003)(32563001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: GDQS8crztdx5Cp9oAy+M/O1mJ7jDhrA2eCr6yntAVgLklmoG9B+jMQWCor26ufQ8z+vi2n622bhNkVPPSFmC7cnN/sSZYXxRTg5sj9WZq2Ijg/shgb73t/PgrNhgiqVxkWTdSh/l5n5x4aLLHuxuBUxq/B1iNnwg0K3tYwjO8jCsBhel1DmCFZ97RT3HRDadcbI1ay74jZwy4fBCkaNlywxLAvp/CY6huj6W2elwHxaZJm+P6N1W2pJQgvSnE8CteZk3VxyqCfmUGpaEFVT9qaip5S9Jb+F8z8on2kIU2aFfymRxN05t8r62MUwZZeuRrhK7UZcdBc3FeUhWqRMzehqldzNQvDRnMhe6BBweB14QoIXO8D59JACbh+AuP+1NRj5huBLf9MVginhxoSmbf3FX1ObRVcVsd49TANRNnBNNuq8SPBvL9veoNfSVPx4tWzoTjzXkkpI5j0LRKUCJd4/2RMd6XhKurkP2M+UmscuJzkKbSjiskS3AhelMnpUpoUL+C6vYogVWSXh64G2VhoGX+uWp+/QLhPXFj8BJh48N+r3+gAtTCs/dSErzz62nd4sMTVjMTNtYBOmSz+5XJiHIzX3+Ji4JoDEcySRJTelHCxM2+vlV61ZJkiDN64yqMOpPHmuWMiRLm8oOUsHJZuQe+TL2iJngJKDLaBvS2NNY9gGpE9WV8zw5vOhXRSui6tGeSdMBmx5/TtNYnuwzRY5lo5xPe4+PfWq2sn2PH9HazezPpGgzn8nXjDULGdLVd/uHdGlSey7KV+3/XQL7Ccvdo7FFsjkfZ7NFjkVexwsx0jJBxfl3WbeYmep3rcP1Xt9jwL5+8poI5xJAzyU8AsOcZYYWWmhsQE/JDUxE2qyghw1iXdL5M3osCIYlytH7tmLxnMNk8ubuFxMWnoMqTGq/+c7oKyDRVQdYsjiLu51PlOmdignX7d2i/TcQGAavHQU7Pt/7ISbKgf6qJTpKti5+c5CjSabS5pter1zWWqS/OQ4Y1zmatH9w00UJUrip X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-AuthSource: DB6PR0402MB2760.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Jan 2021 06:59:29.0350 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-Network-Message-Id: f0dd2664-fde4-4ea6-b4a8-08d8b859effa X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: EtyFYo8PGSr7rkeIW2XKFluK8XMXVO4UuITNBxaZYOlvgeGxHjSxWXAteIcDydm3oJRjwpTzIRtMvesANmLBaA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR04MB4634 X-Mailman-Approved-At: Thu, 14 Jan 2021 13:25:35 +0100 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.3 at phobos.denx.de X-Virus-Status: Clean From: Peng Fan When boot type could not be detected from rom sw info, read sbmr1 to detect, here we only use it to detect FLEXSPI boot, because ROM not update it in rom sw info. Signed-off-by: Peng Fan --- arch/arm/mach-imx/cpu.c | 6 ++++-- arch/arm/mach-imx/spl.c | 2 ++ 2 files changed, 6 insertions(+), 2 deletions(-) -- 2.28.0 diff --git a/arch/arm/mach-imx/cpu.c b/arch/arm/mach-imx/cpu.c index af0b7fbf7b..38b87ed5c3 100644 --- a/arch/arm/mach-imx/cpu.c +++ b/arch/arm/mach-imx/cpu.c @@ -467,12 +467,14 @@ enum boot_device get_boot_device(void) case BOOT_TYPE_SPINOR: boot_dev = SPI_NOR_BOOT; break; -#ifdef CONFIG_IMX8M case BOOT_TYPE_USB: boot_dev = USB_BOOT; break; -#endif default: +#ifdef CONFIG_IMX8M + if (((readl(SRC_BASE_ADDR + 0x58) & 0x00007FFF) >> 12) == 0x4) + boot_dev = QSPI_BOOT; +#endif break; } diff --git a/arch/arm/mach-imx/spl.c b/arch/arm/mach-imx/spl.c index aa2686bb92..2d15f62445 100644 --- a/arch/arm/mach-imx/spl.c +++ b/arch/arm/mach-imx/spl.c @@ -172,6 +172,8 @@ u32 spl_boot_device(void) return BOOT_DEVICE_NAND; case SPI_NOR_BOOT: return BOOT_DEVICE_SPI; + case QSPI_BOOT: + return BOOT_DEVICE_NOR; case USB_BOOT: return BOOT_DEVICE_USB; default: