Message ID | 20210807080113.16020-5-peng.fan@oss.nxp.com |
---|---|
State | New |
Headers | show
Delivered-To: patch@linaro.org Received: by 2002:a05:6638:396:0:0:0:0 with SMTP id y22csp1028088jap; Sat, 7 Aug 2021 00:27:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyyQfHsYvp1Bc2Z4HvFCjmukeZVHnPBQnEDybjfXB4SN+AStV22A4H2U0Q7LZnXSMiZG0VK X-Received: by 2002:a17:906:1685:: with SMTP id s5mr13126732ejd.370.1628321252978; Sat, 07 Aug 2021 00:27:32 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1628321252; cv=pass; d=google.com; s=arc-20160816; b=y/nmBxBzUbVSSsmi9I+gH0HEviIZ5NFZjyTFgksYi9bY+kvHqZlshlmpkEsMAlh7AD 8RJ4yZ8JSEeE8anRlPFV0uzO15h0kDhCZsIWQLVITJXjYgN/bQMH6hACB90QxSDNPVP7 DxP0656q4bvF5SJnUj4ZLHVxk9mqN/h1lrFM9WOBYAACW/0ib6KCmkA+Xwte0Rfy42eB je5k9ftJtQmI+e4e+h5EuKavBJRbrjaQry1WMaStBG4ZmitJ6YSefpL9J+nTR0GISbfd MQbY9Rh0ZiqyBu859QT1RpcyGxwXC3wowb+3O9afHdOm6bpT54kn6I/ARvxYXTy8SHSg snOg== 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=BS+zwHcOKrYvpVNUjzwm9iB146AKxGPCF46m3RFQnE5ELZ+++G5JT+k1QlrdJHFP6m zodzPoYCIFCLDzlsaHQgJRcwslgfyfaaUGlybsj8LruCc0WQLRZkBo2js7iNq+5nGRuS CaONz1/iPr9W5/PRFUHh0RpBGcakt971iDMXy1BTTGLI94TtE8t51CM8IQF10avkRKq/ z1h5Vqqq9GEWd01WSF09uyRAOTOUAFbiPRqYUGX4+Q+aX3qugXKo9t2LalrBVqv15KmZ Bj3+q1nsVJ7Xw6J+AK8ESgOY+P5jsci3HkA1Ig7AJL81hX/esUY/ENeIjfSLTcO8NlHV kKXA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@NXP1.onmicrosoft.com header.s=selector2-NXP1-onmicrosoft-com header.b=QGvOUZRh; 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: <u-boot-bounces@lists.denx.de> Received: from phobos.denx.de (phobos.denx.de. [85.214.62.61]) by mx.google.com with ESMTPS id f17si10550664ejx.595.2021.08.07.00.27.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Aug 2021 00:27:32 -0700 (PDT) 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=QGvOUZRh; 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 7C77A81D48; Sat, 7 Aug 2021 09:27:16 +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="QGvOUZRh"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id B95FD831D8; Sat, 7 Aug 2021 09:27:00 +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=-0.9 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 EUR04-VI1-obe.outbound.protection.outlook.com (mail-vi1eur04on0617.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe0e::617]) (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 3314A82986 for <u-boot@lists.denx.de>; Sat, 7 Aug 2021 09:26:52 +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=Z6VLt5ylZ4EpXOiPQBD/qyJL+0QSbTgIpuilw2qqpDkx4StNwNXRKCciHadlIfA72g/dSjfoB4RPf43E4k6UgmlUrq20Klk3WY8qBVuo2caVZpJ9nrXeLw2ihwhXbQNv+o78dqql2Wpt3N6lh0XS1ZB+VTLhxYLMcGO5XIGQ9LYQrCXO/cbMNFsUoiRkWXDhZQVutWPFQMXhcboRC992a5NnLtc16adQ1es7n1ur8qXzvGRukB+XO4c1igcN3tAfwcpyagHDiISDfO6pjnesSv3AhpGA6PeM5GbsPeCbcnl8xXY3AxBD2KcBwgK5R5tsnVO8QeqyIWF0lCk+N23iKQ== 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=cjKrHxQm2s959anFarvX6NbRyK0/ixXteg9YqeW7pLUyMUJ5IDsx2C/3FRG2+XaUZ2kbJpbR2MA0wqQqQNhSsNKEJxBtMdJ+FNFWmQcyx2A0WTbMF1baQGWtLiH4ToEzGxXAdn+HvlKCjSKgIr8ld06qCPzrAKIClucFDaNUJn/ItWAD34euZ6eGsG18U/Kmmyg0Qf0Ck2RiEFhN7kZ4nL17dGb4yturtW83ufkQ6OTV/9KORVOIH/0r7Rxf9PoynL9ZNurLGLdgJ2HHHWdYQ3nBdEemrWjS4vq+Q375ujJfwaumhGEL0fnJz/9/R9mGJnJSA2yXWq6rd0l06OGkRg== 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=QGvOUZRhtvbzffX47mkA1mqEInIDZLHqt4mPi/d9HjnXpn72SgjorBIWMRaSVav0/3+HKbskYUumx8aInXM2EKyIOMslT5sjH7lDNLPfj/T6oVNf9WxY4Ydx3DSiglLJeQN5SMkx8EwqLSXEzb1H39WqZdC0ArgRQJFyq9ezzAg= 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 DB3PR0402MB3658.eurprd04.prod.outlook.com (2603:10a6:8:2::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4394.17; Sat, 7 Aug 2021 07:26:50 +0000 Received: from DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::c445:d742:eb76:86dd]) by DB6PR0402MB2760.eurprd04.prod.outlook.com ([fe80::c445:d742:eb76:86dd%9]) with mapi id 15.20.4394.019; Sat, 7 Aug 2021 07:26:50 +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 V5 04/44] arm: imx8ulp: support print cpu info Date: Sat, 7 Aug 2021 16:00:33 +0800 Message-Id: <20210807080113.16020-5-peng.fan@oss.nxp.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210807080113.16020-1-peng.fan@oss.nxp.com> References: <20210807080113.16020-1-peng.fan@oss.nxp.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SG2PR01CA0133.apcprd01.prod.exchangelabs.com (2603:1096:4:8f::13) 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 SG2PR01CA0133.apcprd01.prod.exchangelabs.com (2603:1096:4:8f::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4394.15 via Frontend Transport; Sat, 7 Aug 2021 07:26:48 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 7d34db8c-7978-4161-371e-08d95974b902 X-MS-TrafficTypeDiagnostic: DB3PR0402MB3658: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: <DB3PR0402MB365839875312DEEB6A9D5C4BC9F49@DB3PR0402MB3658.eurprd04.prod.outlook.com> X-MS-Oob-TLC-OOBClassifiers: OLM:5516; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: w7BrIJgG49NGQL6OQ/2fZaceKRkDTuNKsndrhX3L2/9IwBJAFQP9npb0PvCUXG0jyU/bk3WKJM44/357Ag4pJk/0X/+8M91Y0hPe7q5TMECv7Pa82t2AMkpjwwNpDdP+XRMGAkGsW8w8nte67ZWgn7LGJGPQr7Hbks5KyY9w52xiu/vQbdvL6tPDdkw7qEwEMyXf1bPWWA4PNiKaY3DFTs7Pv+5nxuYHBU/DIqvv2bWaDFjT/1pLbaUHcIDLMA6z6IxeFtSshHdJHWPFMhhUftALN7nBkl9WrBpyDEQF+qLbElgXXRSxTmFKaVhtw6gZF0ltuIOgRW2yd2KC0Hl4vY+ja7fEgNZgHuueDjDa3FO2rLNWMUi2Unt4aO5tnH0UkFjrKboB3DKzY1A+uU86/DQpB3UKRezqOpwrXT7uZuEKd3bZGI6noRu6rULopwgkWUp8z4ICZ6cqg/SRvotaVS0ePYSdQ7++s3fveNWgFow21FAavK/sgzNy/WjD0t7fm6LR6B50XnqKW7VnTbmXz0M1Vn2U9k74KmY5n2GIptWhJ+/dSMwRcbsjJOTzVc6IHy8m3pymuC1mNNb5ZGpKTt6AmMt+XUVSGmdJlHlb8ujLa+AqOxq380zZ6LlhAaFGp2EKO3iKC+HiVaNbmedf7Zf/14beoZDeaao8vaHo702nhGUVenSdFlvVIsDmuSkRzOuxMEW6inrgUE+ueCjk43oLkrKYawUSfB+I8k8IUog= 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)(396003)(136003)(39860400002)(346002)(376002)(478600001)(6512007)(8936002)(8676002)(38100700002)(6666004)(316002)(6486002)(6506007)(2616005)(956004)(4326008)(38350700002)(52116002)(86362001)(83380400001)(5660300002)(2906002)(1076003)(26005)(66946007)(66476007)(186003)(66556008)(32563001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Dl4zs9X/wIEjDaySmsC6as77UcunDQNtFW3j415tU3JXBJyrlDGPPl7EVjOBH7bx9gzHcF4C+O+uNdor5gMx/6wCuKtsQBSrCkeElHqyreRhYV2Tsgb78fWWT9wW6YIF60Jlmoe59i44we9WXn3Yme9uPSFxUNr2UEaUkeaSm52iFC7/dsvAx0qfe+tEJbpOlNzaD9YUoOBoD54Yn0ivyLTLmuehbfynAAIbgLJ82nJ+VaQyU9qYzCJdEdOMDCXhZbfXPVrKrX7A/wjtiPWaEoNuinKqu/rNlks8DuQgOozN86allfwhVVNcMJFBVE2rFiV8uyCIkkRda1DYJ/At6QKiDuOLbvescpKPxRhJkOwnlGRc1bPfwtWWRnDNyO1oyC8FM9uCtaqbLzETi/t15Y4YUbNNe8gTgd228eieoSiKKc9wkzeTS0Zp7xige7xm1pL5RGMZn5v1S2YF7C+hY+asuoQINQl0659EuC5q7SnyDcWOSt/s1f0eUBno+z0hmPbkzK/bH9heoG1xncA132/Xfx/d451u3TRhRtUtcAJWrlM1DRyTMThLA/mQqbjsd6KHpN4ZQcVsacCYCLvSH3a2FjXIm4ouNthYwG5sqOKXyG5lrH+tRMzodsOpMjjqYTYnPAKZMW2rxurbWHlhWfYgLgNSuGPAO+lDVrdRavgbyVGAsgLl22bNm4z9iCm/i+3sSw6ecSdc4YU+zE9sbQVqJSz9E3zNbhjDrEJ0w50wM/1/lKHNMO3jByvkMrT40RXgXxFtnrnZW2so/sDHJ3P7B8tG68LHtox86qA+ZCBgQBbMpqVd4MOlSv1NaxPw7FPMOrxkV+s6G/1co52nN8o74RZIj38CBkO/7AtO9RkpAdUhhDmPbGdjzCocEbpybtYl6bccajxVeQAZbg7LFdquV10gdGDvFWI3FjQiF55cxsZKWT5iWhP20yclmLyScvZGlfL7JuT4fv+WvE63ouxWIXljlI1VUTRvF44XIn9RRsaHgubnf21TiB9D4lwu3IT11z2qjj+w9SE9QUWjk9Xsxy3eYSp1BpOb2DgLFpoNuFsjBl8HbFwgH8VkxcnOlBAJtOmxpCofjzVoUGPH0dRXT2GdjvI0xiBUm21uCUujhhNnm8Q8lg9nXqrA5ylooHYWF7UWI7tW1hc5O2kHnIaQnaxN3JLdqo9PGczB6oFnXq3t6WD1kOi07Lu2CbIyOS2QXFcnbEAm39hvVbfrrf/+ikgGECBlroRhwPnoROmpxT2ZHkA9U+AslaPxkL2S6+Uu0vDCrbGbHyVqO38igYyPeFPmpwX9oZJ7zk83aAD0Gm5nKZG18jS07u+B9U5W X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7d34db8c-7978-4161-371e-08d95974b902 X-MS-Exchange-CrossTenant-AuthSource: DB6PR0402MB2760.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Aug 2021 07:26:50.6883 (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: xmy6FkvBbxBM/sr7iA8MUXjb+hzdgReglN3H5DqFjBzgT/Z+ull9FAH3EKx1KIAqkZpxGfVw+ebKPuQmND4pLg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB3PR0402MB3658 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.103.2 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 +