Received: by 2002:a05:6359:6284:b0:131:369:b2a3 with SMTP id se4csp2951509rwb; Mon, 7 Aug 2023 06:12:05 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFW3ZkiJKsNr5hmDW+MMn1dOC71Y3mC+OyYrvel/zlvCLgASHuR5y+XftjmDQYya3SmbDLm X-Received: by 2002:a05:6e02:1a84:b0:345:fae5:666c with SMTP id k4-20020a056e021a8400b00345fae5666cmr12399172ilv.4.1691413925437; Mon, 07 Aug 2023 06:12:05 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1691413925; cv=pass; d=google.com; s=arc-20160816; b=fO7EAS6z0+hJ/W+QqgYl+fyT32G2ze41Ko2rw1PDyfFB4XgORPO1jLnwF9O+Nr9Bf7 4A9cNoQ5bMqGw/Fb4oFdMtV53UUzT00jYZUe6QKpUXey/y8x8TIdNRDcq2+9Swi6C1D/ SH6YqWKEHKNiQVS4sW5BvADzx3h31wDUsmS6Q742uFuCP2WS6PYrcvkYGWzV6BuiGAoV Mq1uNd4xa7Kw4qqXHAJgrjc66bNRnz7mVoHttxVi0kjutcT2Q8F2K7DHPHiZcO6sDDst Y3647nvAKqInhawAgZSS0O8+ZoIifjfxTLpSs5buDDgycjsfxwdyTcoizGQyzHmwb0Nl cn5w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=owtlCSHE0pv7sJqAQSFA622fQZA5HRdQPwaW4Xv/N3I=; fh=lMFpnJZCjkSvetl9tpFZk4oM1K582D2CBXvvYFGhgSk=; b=j8tm3CtDmyqnELD551ZM64iNdQtspR39FLUNd27qzmmZLOM4eZwMY7VNIhwkq3L/lT B1/hbqgvpXRjW1V6Sw3GYCKe455OBYVv0XColHhclMWyl5GJ2gAycQiOAXZHnTt/cRPx tw6o8sXV5cQDUjKrZKl3P1GJh02J+bwetHhgOgkyHWHHfE8K/iXjTmI44bTIG20fvWld xXCkB1+i5xuvcscgI1iNu4E3Ug6Hp8dRjMbRMoebgsfd5bhZl9gQujVWZC1hFBnJORox S0XaWQe4YDkRv5gkJ42RcxNDjzzj84lbDxTRtCmAdo4fqZ/aKzcyC0VlMnhcR116tHNA b7JQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@NXP1.onmicrosoft.com header.s=selector2-NXP1-onmicrosoft-com header.b=FKzhg3+w; 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 linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id lt14-20020a17090b354e00b0026811da0fafsi5795246pjb.65.2023.08.07.06.11.53; Mon, 07 Aug 2023 06:12:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@NXP1.onmicrosoft.com header.s=selector2-NXP1-onmicrosoft-com header.b=FKzhg3+w; 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 linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233256AbjHGMKR (ORCPT + 99 others); Mon, 7 Aug 2023 08:10:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44036 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233271AbjHGMKN (ORCPT ); Mon, 7 Aug 2023 08:10:13 -0400 Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01on2085.outbound.protection.outlook.com [40.107.13.85]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0EF57E40 for ; Mon, 7 Aug 2023 05:10:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=c7PZQ0kJsM+U5tydS8ITpxYbrUs6Ix7+kCemnmmdA/z5FX/c5p0Q8mf6HaHeIV7lBQoqx9qqVvuMDp4mmaZO2qOhedovw0yNUy9sKoPKOJ5jggRR8/oKJSH1vK7BBVRwVT/zy7P/VkXl+2AQLoz7qPq4I3KSV0Jrzmw8HX4NF/4NqilRcxqZ5Tw+pjcO3EQfVJOSY139UEdSUDnqxYR30HtawDqnrMPSlgAgmBadLHQtaUvJY6XbFtncYmpK8Gns9AfF//cOWnoaANn44Q/TwVbUmtTMhzo/vA0zFd7NNGhEqyglmGVUXR/VfHhIQtO+tma/KLXiTJBvX4nlx27xcQ== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=owtlCSHE0pv7sJqAQSFA622fQZA5HRdQPwaW4Xv/N3I=; b=irQjASHHxNgRlTm0hPSvz+xwOV6ejmLCDxy23BC26vyhy06ZepVDak6HOL0wKTQ2whOPZ8fHgYrvpXlz8SpLSOJIA130oecByZkMi3XoEwgP3ZJzi6dH8h4LzdV0AMOq7dz9G2BH/P0mYToiPcyi3PzVkfnz+PKar/DuZ+6SGLX7EwDMMtmDkwe0uU7WBF7BIyzqQ6t+ogKF8QM1gPKSdAxvN5Wukauwad4IYybg76zPngA+tGQaNvfUkuHjH/GdV5GuzXaCoMyU0hv4ZM8j8HqU/YJxAHK3/pdoNpn0w7DXW3C9muuXPqGldKz8rn6nXmhs8qWoh5RmWBxsmWHX7Q== 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=owtlCSHE0pv7sJqAQSFA622fQZA5HRdQPwaW4Xv/N3I=; b=FKzhg3+w/iiQgCC84yXO3Idrnb7gY4Tu/T7FZ1DMtQfjrJnomLu8r33QzkHs9DdluK2Q099HXx4BuR69yXQErF0sCjbOh21E8mtY8Eppk2l2h4ZzVpixI+HoJ9s0fXJ/rSr+fxulPsjM6hjmNYsQiSeKbcLSjJBZQLXYp1sVlNg= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oss.nxp.com; Received: from DU0PR04MB9417.eurprd04.prod.outlook.com (2603:10a6:10:358::11) by VE1PR04MB7261.eurprd04.prod.outlook.com (2603:10a6:800:1a3::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6652.26; Mon, 7 Aug 2023 12:10:04 +0000 Received: from DU0PR04MB9417.eurprd04.prod.outlook.com ([fe80::5d6a:ec53:f2a8:5b97]) by DU0PR04MB9417.eurprd04.prod.outlook.com ([fe80::5d6a:ec53:f2a8:5b97%6]) with mapi id 15.20.6652.025; Mon, 7 Aug 2023 12:10:04 +0000 From: "Peng Fan (OSS)" To: shawnguo@kernel.org, s.hauer@pengutronix.de Cc: kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, aisheng.dong@nxp.com, alexander.stein@ew.tq-group.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Peng Fan Subject: [PATCH V6 3/8] firmware: imx: scu: use soc name for soc_id Date: Mon, 7 Aug 2023 20:14:27 +0800 Message-Id: <20230807121432.3970610-4-peng.fan@oss.nxp.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20230807121432.3970610-1-peng.fan@oss.nxp.com> References: <20230807121432.3970610-1-peng.fan@oss.nxp.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SG2PR01CA0158.apcprd01.prod.exchangelabs.com (2603:1096:4:28::14) To DU0PR04MB9417.eurprd04.prod.outlook.com (2603:10a6:10:358::11) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU0PR04MB9417:EE_|VE1PR04MB7261:EE_ X-MS-Office365-Filtering-Correlation-Id: 9d814bdb-169a-47b6-9d40-08db973f3bc4 X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: BUvalHzviW4cbZu4Kv68dVTmd9xqOSD0DjJcR5QJjBkjKHWMLyQb29nhaYRHgTcKI35Mrm3GCg0CxgO2W3Yta/bv8pAENRmW++0fASk7hjSz4DyvOi6dkTGP2Pr/2POy9ekFckLt2nvckGoMpj5s0Q73swDmUvkIdN7xQIct8dw7jnE9LYDMIKJTMdsZzJhrFsgkllcroOlcfO6qpgQUFqlU2w1nu3OjxF2Whs/3xJ53TjKQ6AgKR1pbpAZ5c7ink8IqSBEbfWG85WobAhSeiZK57OlMByXiE7zAVOX+Gw4lvzrsxJPqFT3NVpQrW2LQy4jBLVuFL4T6z2WcpBbjvQBUgDei8PoQjJFFSSOdkMTL08Zdm6VGPSNOof0YwMTIjxgd8ga5z52mURZhcECz+nBNXmxaCBws2PImkDhhEGE/jObGMnqEK4t5W8f/wz5w/QU4wQMiMIIbbfV1yNGL01Aa3UEbk/UUskTa6uWsN+5Uu+50TPmEITY6suTXBg+TF/gUUFYBd3A0brRvC/dzrJELQ3f3ECasqgUiZdWfUMf6KpRyZqcwz373aNioFFARXUjBv9rEbmnyQazQM4EWUQnBad8p++55hxrs6QX629AzK7naC5UIq9tqhjytnPos X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU0PR04MB9417.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(396003)(346002)(366004)(39860400002)(376002)(136003)(451199021)(1800799003)(186006)(6512007)(26005)(6506007)(1076003)(38350700002)(38100700002)(5660300002)(86362001)(4326008)(2906002)(66476007)(66556008)(66946007)(41300700001)(316002)(8936002)(8676002)(6666004)(52116002)(478600001)(2616005)(83380400001)(6486002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?LYJhXqNs04++QnDWKRxpPpROv6y7dYps8K9ytZBaFvn3szNz3bAHnum3usTx?= =?us-ascii?Q?5Fdc40y0rhGwVo20LI0lacUSXrk82v8ROooShPJ7HTY9C29XzLb2o2hbD9AL?= =?us-ascii?Q?uTwNyl0qXqPXJRX4k0W8GobTG5NuMQowlQSi9ImM5E5hcziV7t2ek8x82C69?= =?us-ascii?Q?f08cBXmWz5jjqwqRdNfL37zVoSNDUniV8hfe/Jt3Kyhl8aeC3USV5l0THhAx?= =?us-ascii?Q?epN6jlQikVhO857hZXmt/7vhd+pVwN62gG0Uhdxsyv14gjsKavtw8QtDRF63?= =?us-ascii?Q?MgLaNsIRFwlbF9OI2Py+nI3s6PqdFVdWKKU9RFYXyW95Bc/wKtDao9IRg4aD?= =?us-ascii?Q?5zClro+W/YotFxIWSVGn2/3Eq5cEXeJcQp+92xMhLz4sKyJKxRSsyScUrXKZ?= =?us-ascii?Q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Q3rilZeK?= =?us-ascii?Q?goN8NYi2NWaEabuOvhz9JVe8eP+z5Km3kOzeqgEQGcTZ6zW7LW287998Mwkc?= =?us-ascii?Q?jyVA93hJEbkBTHZizc/+5ZG2DuA/nR/SZ4A+vECVrR7dpn5Fl6jI3iahaOdp?= =?us-ascii?Q?norYHB2/nSCK6kyNwy1dDm8zW1XuS1u7vWJnoL1Wlc4+qXn54JJkd1ltnkJs?= =?us-ascii?Q?cfRNw92ZvMvEwDH5iL02Kl2Frq7xsw+Jfsp+42Ahj5G2d/41c5huEU9mc6ZN?= =?us-ascii?Q?RfgzpuM7AXRbZF/Q5sclt6Xz2M7UHQ4n6Kh3opOx?= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9d814bdb-169a-47b6-9d40-08db973f3bc4 X-MS-Exchange-CrossTenant-AuthSource: DU0PR04MB9417.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Aug 2023 12:10:04.7917 (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: M+i31C1ZMP1wKVqQ6ddNF0Yowp4rDjxjlxMMGeJuL1SDDpCIt7p5bvDmRlwZXvUNuHZgtXiiExyQ31do2eUIlA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR04MB7261 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Peng Fan Same as soc-imx8m and soc-imx driver, use soc name for soc_id which is user friendly. Signed-off-by: Peng Fan --- drivers/firmware/imx/imx-scu-soc.c | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/drivers/firmware/imx/imx-scu-soc.c b/drivers/firmware/imx/imx-scu-soc.c index 2f32353de2c9..497192320562 100644 --- a/drivers/firmware/imx/imx-scu-soc.c +++ b/drivers/firmware/imx/imx-scu-soc.c @@ -78,6 +78,22 @@ static int imx_scu_soc_id(void) return msg.data.resp.id; } +static const char *imx_scu_soc_name(u32 id) +{ + switch (id) { + case 0x1: + return "i.MX8QM"; + case 0x2: + return "i.MX8QXP"; + case 0xe: + return "i.MX8DXL"; + default: + break; + } + + return "NULL"; +} + int imx_scu_soc_init(struct device *dev) { struct soc_device_attribute *soc_dev_attr; @@ -113,9 +129,7 @@ int imx_scu_soc_init(struct device *dev) /* format soc_id value passed from SCU firmware */ val = id & 0x1f; - soc_dev_attr->soc_id = devm_kasprintf(dev, GFP_KERNEL, "0x%x", val); - if (!soc_dev_attr->soc_id) - return -ENOMEM; + soc_dev_attr->soc_id = imx_scu_soc_name(val); /* format revision value passed from SCU firmware */ val = (id >> 5) & 0xf; -- 2.37.1