Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp1529481ybx; Thu, 31 Oct 2019 11:58:05 -0700 (PDT) X-Google-Smtp-Source: APXvYqzAe6uCzMzNQTgqsOVdv9KP8tujywYNL7iGP3wdVZkVCWIs63ktfL+qkKpHBeyGW/7Mwdeb X-Received: by 2002:a17:906:86c5:: with SMTP id j5mr5846553ejy.189.1572548285057; Thu, 31 Oct 2019 11:58:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572548285; cv=none; d=google.com; s=arc-20160816; b=gycjauIxvPOgaQHWgJ30seF8bzJlBAxBeX0lYAr6Ac0rJcuaCzwhahhOYJNsR1uKWz erhakA34NZ5I4H6OTXaOxoq6qTGdfiMRGVj1U5zGZLz/ediePRHykYuev/931pkQ+tes PstuLuWyq+TBKsupIKaON0qTSp0AV5vCkHcKeh7wCAvkiaa153SdbdchxEQdcAcaUTpt EzLm0ne+xYeJtjBZGGMjjO++I+I01b6qPzmLewF7UHdW3KENsehHmt8KhvLWBdg51e/X IKVBYGJqWfnVShJqT3iLwpYGNwWNxKjFBpqJhdGU0SWT9rQO6XPOb4vCeyUIjoDURVqF b2cA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=KEZ2MGdwSvgyihy3BgAVtU7EXgoX4IyUpv+yaDE4EcM=; b=DWacz5pCfpc/ZiZZPFtiNO0PwczS3mmawnm9CJY1AIC9ubkw8kn9P/6Lv61HJt7GrP XJImIjUKZh/y6CGjl8BzyWzxoS8kC/tUpX/dkHDsZQ2V78oJQjE1WA347cfiDqBtPe+j +sBhJrHoBEUm/xmT1JaDMlZ8A2C7moj0rbQoKK0PlwaY2qPpA3/o6pAhNobBGn3DGUIt HW1LOwf+an0cTe+fiB+CkXH/yw9FCZ4wiUS7nvdsn50f5xvZv4z5tNglFPkt8IYIV3H7 YywQnDq68oXbWRpSTgxG4I4105brq3bgIC0wqP3yE0FqUDGDbjnPm29lbrj7GgZ/Oc10 QGsw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ZYtnp5Vt; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w27si1652291ejq.253.2019.10.31.11.57.40; Thu, 31 Oct 2019 11:58:05 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ZYtnp5Vt; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729424AbfJaSz6 (ORCPT + 99 others); Thu, 31 Oct 2019 14:55:58 -0400 Received: from mail-wm1-f65.google.com ([209.85.128.65]:37862 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729252AbfJaSz5 (ORCPT ); Thu, 31 Oct 2019 14:55:57 -0400 Received: by mail-wm1-f65.google.com with SMTP id q130so6980529wme.2; Thu, 31 Oct 2019 11:55:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=KEZ2MGdwSvgyihy3BgAVtU7EXgoX4IyUpv+yaDE4EcM=; b=ZYtnp5VtI2P7IqkhTg1B8qmX/LGKFnyoyP1OI02dcs9Y9z49dyvvKdcCH9EFsu7iyJ t3/OP80zD06K5ZwZsq3mCVndr+GGQO6XZ+W2cyUIPfufhkG7kSrg8Mp7cfm2aDfxLUgV eu11mNVUZvgFNT+OXFwpttyldXIHuSXsgwyUzXzLiEAZj5GUUmmBi7xHjroJUTFmlxXp 7qra1V80Vh6JiZ2mfcX/uIaSdLZJ7w/AN54R2pbz3oBnrULe1IxtgUwIpFIIrkVsqFw5 cbpacAfI5X7UrSZxxYKVBLQNgtp6ojnq1PgdlRoTMg4cI/bS+xYJaB0eEiO5W/GRwdOf /sdA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=KEZ2MGdwSvgyihy3BgAVtU7EXgoX4IyUpv+yaDE4EcM=; b=tGfSqBmJEv5vaelaaPmluVSZ6oC0d3HEMpVPh45bQ5eZTAzo7Wwfw7k2o3kwksG0jf yTlgcfXQxoJNHdGo4okbtsilU4nDglUDGj8CtkO9QV+me08iWYOE1iofQ9mfdhfBoVtq 9DyjiJoKbvbF3zaBZ5dboXSs3CQYBH2xFHU994HIG5w5mngjbiCci2P1xXM7hrzeoEl+ K1SavmSqXUpLzIucBkgJEGiICbjaDmPblc5MDRyv1myiVu+MQuDa2DOLmUHdMH+cSc0t cBjClePFDnM6CH7C8wmtz87VYBI5RTt2RtJ/aoGIYfexjRqj8iw09B6K9JzdlmqVLAU4 Ns0g== X-Gm-Message-State: APjAAAXlKbnNx3B7QYk3PC5+w7qT9U6HFzkeSAzMlU0uwtwIIH2zq3Xc CUUe7q6xHK+GOTLOwZC0itsv3dZ3Ga90w9Ht+/M= X-Received: by 2002:a1c:480a:: with SMTP id v10mr6775812wma.138.1572548154853; Thu, 31 Oct 2019 11:55:54 -0700 (PDT) MIME-Version: 1.0 References: <20191031181359.282617-1-megous@megous.com> In-Reply-To: <20191031181359.282617-1-megous@megous.com> From: =?UTF-8?B?Q2zDqW1lbnQgUMOpcm9u?= Date: Thu, 31 Oct 2019 19:55:43 +0100 Message-ID: Subject: Re: [linux-sunxi] [PATCH] cpufreq: sun50i: Fix CPU speed bin detection To: megous@megous.com Cc: linux-sunxi , Yangtao Li , "Rafael J. Wysocki" , Viresh Kumar , Maxime Ripard , Chen-Yu Tsai , "open list:ALLWINNER CPUFREQ DRIVER" , "moderated list:ARM/Allwinner sunXi SoC support" , open list Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Ondrej, On Thu, 31 Oct 2019 at 19:14, Ondrej Jirman wrote: > > I have failures to boot on Orange Pi 3, because this driver determined > that my SoC is from the normal bin, but my SoC only works reliably with > the OPP values for the slowest bin. > > Looking at BSP code, I found that efuse values have following meanings > on H6: > > - 0b000 invalid (interpreted in vendor's BSP as normal bin) > - 0b001 slowest bin > - 0b011 normal bin > - 0b111 fastest bin Maybe have some defines will be more readable no ? https://megous.com/git/linux/tree/drivers/soc/sunxi/sunxi-sid.c?h=3Dh6-4.9-= bsp#n213 #define SUN50I_NVEM_INVALID_CPU_OPP (0b000) #define SUN50I_NVEM_LOW_CPU_OPP (0b001) #define SUN50I_NVEM_NORMAL_CPU_OPP (0b011) #define SUN50I_NVEM_HIGH_CPU_OPP (0b111) Regards, Cl=C3=A9ment > > Let's play it safe and interpret 0 as the slowest bin, but fix detection > of other bins to match vendor code. > > Fixes: f328584f7bff ("cpufreq: Add sun50i nvmem based CPU scaling driver"= ) > Signed-off-by: Ondrej Jirman > --- > > See https://megous.com/git/linux/tree/drivers/soc/sunxi/sunxi-sid.c?h=3Dh= 6-4.9-bsp#n484 > and https://megous.com/git/linux/tree/drivers/cpufreq/sunxi-cpufreq.c?h= =3Dh6-4.9-bsp#n428 > (1 is substracted from soc_bin number here!) > > drivers/cpufreq/sun50i-cpufreq-nvmem.c | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > > diff --git a/drivers/cpufreq/sun50i-cpufreq-nvmem.c b/drivers/cpufreq/sun= 50i-cpufreq-nvmem.c > index df35ef3ef567..41dad03e245c 100644 > --- a/drivers/cpufreq/sun50i-cpufreq-nvmem.c > +++ b/drivers/cpufreq/sun50i-cpufreq-nvmem.c > @@ -71,9 +71,12 @@ static int sun50i_cpufreq_get_efuse(u32 *versions) > efuse_value =3D (*speedbin >> NVMEM_SHIFT) & NVMEM_MASK; > switch (efuse_value) { > case 0b0001: > - *versions =3D 1; > + *versions =3D 0; > break; > case 0b0011: > + *versions =3D 1; > + break; > + case 0b0111: > *versions =3D 2; > break; > default: > -- > 2.23.0 > > -- > You received this message because you are subscribed to the Google Groups= "linux-sunxi" group. > To unsubscribe from this group and stop receiving emails from it, send an= email to linux-sunxi+unsubscribe@googlegroups.com. > To view this discussion on the web, visit https://groups.google.com/d/msg= id/linux-sunxi/20191031181359.282617-1-megous%40megous.com.