From patchwork Sat May 16 20:34:19 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anatolij Gustschin X-Patchwork-Id: 1291967 X-Patchwork-Delegate: sbabic@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=denx.de header.i=@denx.de header.a=rsa-sha256 header.s=phobos-20191101 header.b=c/pu8sQo; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49PcTP5py0z9sTK for ; Sun, 17 May 2020 06:34:46 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id A104F8168D; Sat, 16 May 2020 22:34:36 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1589661276; bh=2m8L2jsERJnbKpZSMY3/rZs/pAbYSRewIYjeKTZaVdA=; h=From:To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From; b=c/pu8sQodASbUGd1XWlBg2fP5YrGCBBntYAwbI5Natv2pIZRFy4DvicTXb1T+n5Nr tMnGyGZ/H4o6CBb6p32+uUWdIIrWWtmjdh+12Gy59Et5h2+BsUFvbmYbKMPA6wL49v 8sGQlykMcYY0iDLIJTZdnY9cEAchuOGc/9NMcYzmW7/dPFaMoP4YEtpMjyTjHgyJ5Z owRIkwrP8+rbkC43VIYJXOjlbPvEfaIzb+UDKIo4YUCr2BXLuwnhkl0JHdHbS5Hk7J lTL9AENJJ51qdP2S26wJGumo4NNMRxe1A0GyYGwJxWRFUW6n2n00l9Xw/Pu95i5yKD Sbjp4YstJGOWQ== Received: by phobos.denx.de (Postfix, from userid 109) id 2A77281726; Sat, 16 May 2020 22:34:35 +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.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-out.m-online.net (mail-out.m-online.net [IPv6:2001:a60:0:28:0:1:25:1]) (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 7D1A78168B for ; Sat, 16 May 2020 22:34:32 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=none smtp.mailfrom=agust@denx.de Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 49PcT33B4Hz1rrKZ; Sat, 16 May 2020 22:34:31 +0200 (CEST) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 49PcT32pSbz1shfV; Sat, 16 May 2020 22:34:31 +0200 (CEST) Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new, port 10024) with ESMTP id XmkeSW3FGU4E; Sat, 16 May 2020 22:34:30 +0200 (CEST) X-Auth-Info: BLsy686hMSrqfgcDx9LljpI5emZTlPbiGfG9dz6nqX0= Received: from crub.agik.hopto.org (pd95f11d0.dip0.t-ipconnect.de [217.95.17.208]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPSA; Sat, 16 May 2020 22:34:30 +0200 (CEST) From: Anatolij Gustschin To: u-boot@lists.denx.de Cc: peng.fan@nxp.com, ye.li@nxp.com, Frank.Li@nxp.com, sbabic@denx.de Subject: [PATCH 1/2] cpu: imx8: fix type and rate detection Date: Sat, 16 May 2020 22:34:19 +0200 Message-Id: <20200516203420.24409-1-agust@denx.de> X-Mailer: git-send-email 2.17.1 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 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.2 at phobos.denx.de X-Virus-Status: Clean CPU type and rate detection is broken, for A35 cpu we get A53: ... sc_pm_get_clock_rate: resource:0 clk:2: res:3 Could not read CPU frequency: -22 CPU: NXP i.MX8QXP RevB A53 at 0 MHz at 47C Fixes: 55bc96f3b675 ("cpu: imx8: fix get core name and rate") Signed-off-by: Anatolij Gustschin Reviewed-by: Peng Fan --- drivers/cpu/imx8_cpu.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/cpu/imx8_cpu.c b/drivers/cpu/imx8_cpu.c index 95c14c98d8..896e1ac776 100644 --- a/drivers/cpu/imx8_cpu.c +++ b/drivers/cpu/imx8_cpu.c @@ -52,11 +52,11 @@ const char *get_imx8_rev(u32 rev) const char *get_core_name(struct udevice *dev) { - if (!device_is_compatible(dev, "arm,cortex-a35")) + if (device_is_compatible(dev, "arm,cortex-a35")) return "A35"; - else if (!device_is_compatible(dev, "arm,cortex-a53")) + else if (device_is_compatible(dev, "arm,cortex-a53")) return "A53"; - else if (!device_is_compatible(dev, "arm,cortex-a72")) + else if (device_is_compatible(dev, "arm,cortex-a72")) return "A72"; else return "?"; @@ -183,11 +183,11 @@ static ulong imx8_get_cpu_rate(struct udevice *dev) ulong rate; int ret, type; - if (!device_is_compatible(dev, "arm,cortex-a35")) + if (device_is_compatible(dev, "arm,cortex-a35")) type = SC_R_A35; - else if (!device_is_compatible(dev, "arm,cortex-a53")) + else if (device_is_compatible(dev, "arm,cortex-a53")) type = SC_R_A53; - else if (!device_is_compatible(dev, "arm,cortex-a72")) + else if (device_is_compatible(dev, "arm,cortex-a72")) type = SC_R_A72; else return 0;