Message ID | 20210412121306.11484-5-peng.fan@oss.nxp.com |
---|---|
State | Superseded |
Headers | show
Delivered-To: patch@linaro.org Received: by 2002:a02:c4d2:0:0:0:0:0 with SMTP id h18csp1659128jaj; Mon, 12 Apr 2021 04:42:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzur4V/gzfAtUuwSqI/QsBNr8ZRh4iaFR2/uaGqvFyaUOMMx7glC4WfeFxE5pJpLDYPlax1 X-Received: by 2002:a17:906:a286:: with SMTP id i6mr11344320ejz.135.1618227753408; Mon, 12 Apr 2021 04:42:33 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1618227753; cv=pass; d=google.com; s=arc-20160816; b=nrH7ypUx6PPgVpT1Ok1q+THoEJu8MFUlLikmR5cIOXpLqWII8PWzKxxkzvmhahkrLW i/mdHkBG5uo60BeTxcYdrGYp96LzZ8K0X9V5CS1TdlI17GYqsmGHdaRJizfVPu3TdP+P XeQAq94QwY9R4w+beTpohwwCUdVSkOuzhCtIu4oQIYCZEabAUSqIOeOsL9A+QTVDJWTW TAui60BFrIyio16rxYiduohguJGIWOo5nAuvQyrqsTX2AQogc8jv1+QytfGh1KetEMps 2H4MIswmWQQmo8PChZTqGLkRZ1Ci2P6/c4q2Cjb0ebLScbF56lt5+VeOPK0W1nxPXenV pWmw== 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=kwM/VFGliySbjojaIhmHRZrB+Fn+jSbCK0ooRc0id4w=; b=cb58yeQHWBv7/xwbrIy3Ez2X0RwLZmq7m2ZeUwAtxi367mRHB+izgpq2BIWjLBLSwd QWX4xwOkWL9Mv7w+btWOBZ8isbRwyQxtYPDGMMU2IY1YYcdB8B+AOnlGCnmGTaYlQmdi aHv7KwulkOuPISnlxO9rQr93S+7aYvDwNpKD+hQFwMch63IcyDl5egcNc/DzoJ8zXNZ6 a6bSYSFRA5RgmBX01dbke9c2TqAtxknjEcnyJpJFWOD981NnWZSXl/hI3DBPS/jHwlZP x4AD5mbMQUVI6nImbLD61FFFSyWSbqKlJQe4kWJ4pwMZLtqlw88y+DBHPiEcAjlE5Ghr LyYQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@NXP1.onmicrosoft.com header.s=selector2-NXP1-onmicrosoft-com header.b=JesuKFyr; 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: <u-boot-bounces@lists.denx.de> Received: from phobos.denx.de (phobos.denx.de. [2a01:238:438b:c500:173d:9f52:ddab:ee01]) by mx.google.com with ESMTPS id k7si7000356edx.440.2021.04.12.04.42.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Apr 2021 04:42:33 -0700 (PDT) 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=JesuKFyr; 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 6212381ED0; Mon, 12 Apr 2021 13:42:18 +0200 (CEST) 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="JesuKFyr"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 29CDB81E6D; Mon, 12 Apr 2021 13:41:47 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=1.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,FORGED_SPF_HELO,MSGID_FROM_MTA_HEADER,SPF_HELO_PASS autolearn=no autolearn_force=no version=3.4.2 Received: from EUR03-AM5-obe.outbound.protection.outlook.com (mail-am5eur03on061b.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe08::61b]) (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 B8AEB81F63 for <u-boot@lists.denx.de>; Mon, 12 Apr 2021 13:41:37 +0200 (CEST) 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=Qgr9tlo8sgYtHPWzAXP5JxZTvy5yFzb6wNk/qX6hGWRyUdRBtwF3XDOYY0cpMz7DZKRhZp6Rv+Rksyu2LMEXVLKTAiRFWC/Vm54KsdQsMg5bDXju2M9F/HiINpHtXVZJrDP2dQMilLy5DWMfFJT88BEeWBPpTsjJJK0P1y0ddD/nyq2h5dsw1kA7i9ZnX6fJvc23Qn7zVm22pH78VSpbLbWLE7h4peBj5DqxhHuLtiIiuvcc8pGxme+IXzrvAYNebvcIqwf7A2SHiU8igiqk2LRJ6Vex69/wFWGqb2XAwaOMXZdHvwd8s85d3nQgC4snZ7qb96MXccL4Ht5z8iXyIA== 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=kwM/VFGliySbjojaIhmHRZrB+Fn+jSbCK0ooRc0id4w=; b=lxrrUgACt+3iibMDxFsdzr1cJorFX7BHodaBxoOTDAm45F+vNvfQDDfGtrMR/0hXfX7tlAdKIxIxkH1QONd6UzGaGliC8tmld8aEgojaqm0mNpxyZRdat7Fprk4NNBgA4WjJ+MYptH/95Lm+J8kPmoOs3JEWPPWhAn6YZJtuoTFWHdYf+V3mPwyHw+pMCkHgYmyTZRciNc+vMU1duojmvkGEF59J2OJWREnDwsXjfUzX86XtgQrgxydi6NfaI2hLuQLgvUbNNCYgxzeel+sCcBaoZIeT3neaRDdhuBqOeVAVNLn43NwyjA6TruSiQ+yC2HK5v/+YXyhw7XzAF1uf4Q== 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=kwM/VFGliySbjojaIhmHRZrB+Fn+jSbCK0ooRc0id4w=; b=JesuKFyrxEEmrirTyCLSwtA+tuKZsCKShbXvAU7HgZt8YVCk9gdfKBRpd7BALzOBoeoH+bfrkg23aML717G5lwgma866k9El4/RqtHUt5wu7hTdrfi7CO3SC0Ee68ZwDvpMCF03CEAu89Bsxm4cJV28glUhGl+v2p70r3XweusM= 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 DBAPR04MB7223.eurprd04.prod.outlook.com (2603:10a6:10:1b0::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4020.17; Mon, 12 Apr 2021 11:41:36 +0000 Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::c57a:6964:f72c:21cf]) by DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::c57a:6964:f72c:21cf%11]) with mapi id 15.20.3999.032; Mon, 12 Apr 2021 11:41:36 +0000 From: "Peng Fan (OSS)" <peng.fan@oss.nxp.com> To: sbabic@denx.de, festevam@gmail.com Cc: u-boot@lists.denx.de, uboot-imx@nxp.com, Peng Fan <peng.fan@nxp.com> Subject: [PATCH 04/37] arm: imx8ulp: support print cpu info Date: Mon, 12 Apr 2021 20:12:33 +0800 Message-Id: <20210412121306.11484-5-peng.fan@oss.nxp.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210412121306.11484-1-peng.fan@oss.nxp.com> References: <20210412121306.11484-1-peng.fan@oss.nxp.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [119.31.174.71] X-ClientProxiedBy: HK2PR0401CA0009.apcprd04.prod.outlook.com (2603:1096:202:2::19) 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 HK2PR0401CA0009.apcprd04.prod.outlook.com (2603:1096:202:2::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4020.16 via Frontend Transport; Mon, 12 Apr 2021 11:41:34 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 46dab2a8-6aef-4181-2c2f-08d8fda7edbd X-MS-TrafficTypeDiagnostic: DBAPR04MB7223: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: <DBAPR04MB72235BF1DBAEE224B32D28BDC9709@DBAPR04MB7223.eurprd04.prod.outlook.com> X-MS-Oob-TLC-OOBClassifiers: OLM:5516; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 8d86/7Ar8YQ+jOGtY5om/BmFVmDjoslNB08+eHFR19RNnoIFKG7hsEnLhuerQyAHtFljViMJPpxjNOrkYd5WzFZZOyAVIv4UpXWSFjC8YRAbZSFjzJ46ngC8FrTOj0vQBK7XnLX24vw9fa2x1NCEDRbmk81GhytDrYFVIHofI2yMNkeMXoxuhLvGYuqWv1daeOxeahbJ0r2MQJHWFBXVRKEJl3DWaTxGhwgpd0+4WsgJYpQKp7R7IfutjgMqN5tDcs15dkmcFAdoiGT0Oz3FBxWvyfGuM0RGx3E3ZLcbezAOoCwHknrCF1vK/xpIyuqqj4G2RghBwlZCL11aHVkIv+JbduhU3iILPgca2QxhNqxu5fD4hGi9ClGXePdCoL2sY/K8JatAWnuqzgtKTR6Lz6yrUcTX4u5+NcPzz3rbTUOGQF9RPUmBEPMtzEDlJR7sAVUzLawPRlDTbAAcAdh/3nbf7Yy0VY7gYBr3mFJMV6afVb/cPSeilIRQswl7lEPU40AWUJ7X/Cf+M4EQlHSpedFAh3OhsjHvOsGWUuz+3RISRql0xKfWjaT48QSv6hdSzdnpJcZCqGpCkix9VxJAx/6dWmPmyms2CqX5zwZBrJ4Gq1aPIz1s5rlqz6NaQpJxTlm5l3ctGNcIwYa8+CtM5gWqIyz0/gM9YYtNPOReD/Oy8fbuwq1OhxJBpfXKfeVE 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)(346002)(396003)(376002)(136003)(366004)(39860400002)(2616005)(26005)(1076003)(956004)(4326008)(38100700002)(2906002)(5660300002)(8676002)(16526019)(83380400001)(186003)(86362001)(66556008)(478600001)(66946007)(66476007)(8936002)(316002)(6486002)(6512007)(38350700002)(52116002)(6506007)(32563001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: SQFDwxGwjkMN3NlJ3iNARqQHr1NxRV2mTr6+UGGcMrOcjMeFG25rT1k2F0oydTN3vt4kumdw3PDcMox5ilse4n2aCHbcsqc0QOb/fwssjwDwa64/GxOUBI8HaL3X6nze/uH/yGhYN/RmLf17XTghcO+dWVn+YQ7uh4XqLmkLxDpT5AoMa0RAe9fiihgXQ/y5ETUtqEPik3JRnpiax/0WcLtPXu40scuO4f7qMXvQ2WUUg42BO71/xRQDUG8ME3ezZMsatlKCF8569lmTtkNx2qAk2u4WnOwp0y8WX6oiwvHBQSbFeAuBn1yhC4/Zr6Uz2tTg35wwd6Uxol6Ijkn1fJimccI6lErq9cPbp5fH2QZFhR1VbiRNe9P6NBJtiAJ768KC0MRW/oLwhJfA1yAxV7Tl2RoAYo6bWb1KwB/2trYaTiwEjOzkFYt01PSoUzN0mE8HUMpyuq+HRRH4g4mSOgLbZ257k/qlHxVia8DpxvBlkllCSc5Md3mMq1z65dKZmZOlj7GQbBjb9YvpnE8h64YriAjKc4nSVNr0u7/5jpHYE73A6mo9kQnyIgwOew4uZz7nqgUt4UMibW64TiVppJVv0J0yeeVuSaDh6soAu12nPjlz5V49gMF0zp28YBLoYC7YRgxiPjUoj5Z1GslgFGi3wiSHScKef/2j9l2dldkrN9bvAUFgsyCwyXJMo19O85xz0eJ7tXqn+YnkAGj3U2EBUdqbo7TTlrO5mi+YvMjrbJG/vxDrhTZ9/LJckkeKuwQFfKynCBYtwzlTr0uWLg2PITpSucfAVfRpdr8LW1L5FFd7e8npFUhEiD8TsUW6jPHCAyVQDOffqVDNMbgi1BgbqweIEhxL6csBJnhiWpLktVr9PnQbnON8yZHnUZaO1RfwqT9tW/2hvVHtA7eQ4l8EJ2yICM5pjcRY1k1IOfFcfUcaaJbhPTcZnflBsfoh4x4tlxYavZv/8xZXWsUmCJPcZwElmKk9CX3W55QYBarFGQCVR5xW69O+tb72jeBmpHzcpGTBWzvcak+zNgKXe/Ve6NCC8tcnyZmFPiUX7rSQG+PtNFGudoZQOOb8f0L65PSs41c1tx0737LRqmTHHgiN4biBItj4DEl0DqhzSlNXAyo5yQYLo4JwU85EdPBMM7R6S21o/v06+dOG3F3qGvNWfK42SkkTjLUYMuc0MpYUK86ks0A5s0n5DkXsvsWh6TxHXieAN5pzgX2ovEM0Rbypv1pgX+fwgX24h0wVy3CM9OXUa/Rk3zRsRWmVy4iLMseUV6xp69Uzv3JkdaBybHclyMqhljpJ11jP1aLBQwZkcf4pFbfB1EvaTNu4f3Tp X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 46dab2a8-6aef-4181-2c2f-08d8fda7edbd X-MS-Exchange-CrossTenant-AuthSource: DB6PR0402MB2760.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Apr 2021 11:41:36.4408 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: fbzoTJtVAM3JyIPjZIstoxUfQrtRRi3caxqpAvPd54fwkqoJ5cf3gP//wQGj3NXMuuy3GvB9/GJpzGuZUzE58A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBAPR04MB7223 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion <u-boot.lists.denx.de> List-Unsubscribe: <https://lists.denx.de/options/u-boot>, <mailto:u-boot-request@lists.denx.de?subject=unsubscribe> List-Archive: <https://lists.denx.de/pipermail/u-boot/> List-Post: <mailto:u-boot@lists.denx.de> List-Help: <mailto:u-boot-request@lists.denx.de?subject=help> List-Subscribe: <https://lists.denx.de/listinfo/u-boot>, <mailto:u-boot-request@lists.denx.de?subject=subscribe> Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" <u-boot-bounces@lists.denx.de> X-Virus-Scanned: clamav-milter 0.102.4 at phobos.denx.de X-Virus-Status: Clean |
Series |
imx: add i.MX8ULP support
|
expand
|
diff --git a/arch/arm/include/asm/arch-imx8ulp/sys_proto.h b/arch/arm/include/asm/arch-imx8ulp/sys_proto.h index cab12c218e..8894611a0f 100644 --- a/arch/arm/include/asm/arch-imx8ulp/sys_proto.h +++ b/arch/arm/include/asm/arch-imx8ulp/sys_proto.h @@ -8,4 +8,7 @@ #include <asm/mach-imx/sys_proto.h> +extern unsigned long rom_pointer[]; + +enum bt_mode get_boot_mode(void); #endif diff --git a/arch/arm/mach-imx/imx8ulp/soc.c b/arch/arm/mach-imx/imx8ulp/soc.c index b3679aefcb..e6ac5f8d25 100644 --- a/arch/arm/mach-imx/imx8ulp/soc.c +++ b/arch/arm/mach-imx/imx8ulp/soc.c @@ -3,9 +3,68 @@ * Copyright 2021 NXP */ +#include <asm/io.h> +#include <asm/arch/clock.h> +#include <asm/arch/imx-regs.h> #include <asm/arch/sys_proto.h> +#include <asm/mach-imx/boot_mode.h> u32 get_cpu_rev(void) { return (MXC_CPU_IMX8ULP << 12) | CHIP_REV_1_0; } + +enum bt_mode get_boot_mode(void) +{ + u32 bt0_cfg = 0; + + bt0_cfg = readl(CMC0_RBASE + 0x80); + bt0_cfg &= (BT0CFG_LPBOOT_MASK | BT0CFG_DUALBOOT_MASK); + + if (!(bt0_cfg & BT0CFG_LPBOOT_MASK)) { + /* No low power boot */ + if (bt0_cfg & BT0CFG_DUALBOOT_MASK) + return DUAL_BOOT; + else + return SINGLE_BOOT; + } + + return LOW_POWER_BOOT; +} + +#if defined(CONFIG_DISPLAY_CPUINFO) +const char *get_imx_type(u32 imxtype) +{ + return "8ULP"; +} + +int print_cpuinfo(void) +{ + u32 cpurev; + char cause[18]; + + cpurev = get_cpu_rev(); + + printf("CPU: Freescale i.MX%s rev%d.%d at %d MHz\n", + get_imx_type((cpurev & 0xFF000) >> 12), + (cpurev & 0x000F0) >> 4, (cpurev & 0x0000F) >> 0, + mxc_get_clock(MXC_ARM_CLK) / 1000000); + + printf("Boot mode: "); + switch (get_boot_mode()) { + case LOW_POWER_BOOT: + printf("Low power boot\n"); + break; + case DUAL_BOOT: + printf("Dual boot\n"); + break; + case SINGLE_BOOT: + default: + printf("Single boot\n"); + break; + } + + return 0; +} +#endif +