From patchwork Sat Mar 26 00:58:33 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Iain Paton X-Patchwork-Id: 8673571 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 62DEDC0553 for ; Sat, 26 Mar 2016 01:01:04 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 47F662026D for ; Sat, 26 Mar 2016 01:01:03 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 39A102021B for ; Sat, 26 Mar 2016 01:01:02 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1ajcZ9-0000lE-Qe; Sat, 26 Mar 2016 00:58:59 +0000 Received: from mail-wm0-x241.google.com ([2a00:1450:400c:c09::241]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ajcZ6-0000j5-SR for linux-arm-kernel@lists.infradead.org; Sat, 26 Mar 2016 00:58:57 +0000 Received: by mail-wm0-x241.google.com with SMTP id p65so7167196wmp.1 for ; Fri, 25 Mar 2016 17:58:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-transfer-encoding; bh=5TMxOZVprVKAhYJryjOeIVnFCLRZjKSLtee6lX+WYKQ=; b=vB8z36IGUjQiksw8GJHwaIsdHIAAFCgjiXOFec/djeL4p8t9sbYwx6h7jMxKtTJ7/3 MdIWtTv3ztqa71Ua2O5tbSydmIgqeH6hc9yOxoIjOBPuH3ePj8cnrkzKG34L1TsG65P0 A+BmQA+as9HZYJSZSJSFbhZHrxOZXbpI8LlJvBTfOnNlAEHl9Gz6LZEFTH/ZlkGPUxmj idSDRMzsmlNfCL+mzXAup+IAYWdKvxj6dkoKhUNP6OEFFRpXi/lqu2doTTXY9Fo/51C5 gwXpbGWrBYPlp0RM3K17fVC/IvUeC2NJGjYxJwMPgrslH13M7QyC8uowcywhJeSwZbAp g6Kg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :cc:subject:references:in-reply-to:content-transfer-encoding; bh=5TMxOZVprVKAhYJryjOeIVnFCLRZjKSLtee6lX+WYKQ=; b=WwAz8YaRNrLckFpbYlX3Rzv/bJOlr1455lm1j7b+SV0vGDMZ5uBfmuZFcYCKPdlTrb s00v0f8PrR7I/nOnFq2US1p/nPrxOON7teT8ax5Mnug5C9proy42+gd8AtHydcYOlDZE ru8kkZbwjRxkrroQZdBNcOA3Pgocyv0BO/EysTl71o7v5hzESL81laZprqtv3sQWCtdC Zna1FumEZl1bbKg95QTrNKrjGPrV//EvUVDzA3PljpruU7Lx4XBkuNzcs/o4s1J5W550 /gyGoZSB9ze6K3cEkJ/Nza+CvUa4xtrIwHtzGh5kyIYzETWJ+Zef3zCpHHTGGFALR+Ri cazw== X-Gm-Message-State: AD7BkJJkM9x7tR40SeHpIt545N9w9b5uCrAej5zIqFxVG/MPnS4ICwv6ICV7HHOn2TS7Iw== X-Received: by 10.28.87.139 with SMTP id l133mr975511wmb.38.1458953915082; Fri, 25 Mar 2016 17:58:35 -0700 (PDT) Received: from ?IPv6:2001:8b0:3c4:1:2000::? (foundation.darkvoyage.org.uk. [2001:8b0:3c4:1:2000::]) by smtp.gmail.com with ESMTPSA id e127sm1023626wma.20.2016.03.25.17.58.34 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 25 Mar 2016 17:58:34 -0700 (PDT) Message-ID: <56F5DEB9.7070207@gmail.com> Date: Sat, 26 Mar 2016 00:58:33 +0000 From: Iain Paton User-Agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: haas@computerlinguist.org Subject: Re: [linux-sunxi] [PATCH 1/3] sunxi: A20-OLinuXino-LIME2: Fix ldo3/ldo4 in DTS References: <1458932647-24268-1-git-send-email-haas@computerlinguist.org> In-Reply-To: <1458932647-24268-1-git-send-email-haas@computerlinguist.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160325_175857_228826_745F0857 X-CRM114-Status: GOOD ( 20.79 ) X-Spam-Score: -2.5 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Hans de Goede , linux-sunxi@googlegroups.com, wens@csie.org, maxime.ripard@free-electrons.com, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-5.1 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On 25/03/16 19:04, Michael Haas wrote: > This patch implements the suggested changes. It is not enough > to set the voltage to 2800000 to avoid the crash. Hence, I have > also removed regulator-always-on. NAK. If setting both min and max to 2800000 isn't working then I'd suggest you're just papering over the issue and not actually solving it. It should be fairly clear that whenever those regulators are turned on by some driver you're going to see the same issue, you've just delayed the problem by removing the regulator-always-on item. The real problem here is people monkeying with the regulators without understanding what they're doing, bothering to test the results, or caring about the consequences. Anyway, Hans was correct in that the datasheet we have access to says that the defaults for these regulators are undefined. I suspect that's not the whole story though, if these regulators had random values at powerup we'd have seen problems before now. Most likely the values we think we know are simply incorrect plus there's probably some element of sequencing involved - perhaps LDO4 needs turned on first. However I don't see sufficient detail in the datasheets to confirm any of that, so we shouldn't assume anything. Electrically on the lime2 LDO3 goes to VCC-PE and LDO4 to VCC-PG. Neither groups E or G appear to be connected to anything other than gpio headers, so this has little to do with board design, it's something internal to the SoC that the datasheet is lacking on detail about. One of the reasons for the regulator-always-on being in the dts was so that the regulator didn't get touched and so didn't break anything. All said and done, it only takes a minute with a multimeter to determine actual defaults. Helpful to have multiple boards to gain some confidence that they behave the same, but still basing values like this on tiny sample sizes is probably unwise. Looking at other A20 based boards, Cubieboards for example, shows LDO3/4 being unused and the VCC-PE/PG pins they power on the lime2 being tied directly to 3.3v. No issues there simply because there's no way to mess with the power to those blocks. The patch you really want is something like the one below which works on my boards regardless of the presence of regulator-always-on. Verified on four boards with u-boot 2016.03 and kernel 4.5.0. Whether you decide to remove regulator-always-on or not is a different question, but please use 2.3v, or some other proven working value, for ldo3. At least that way you have a fighting chance of the board remaining functional when something wants to turn the regulator on. It's a good bet that the same u-boot change will have implications for other boards, if not now then at some future point. Hans, take note, the schematic is wrong. You shouldn't assume either the schematic or you are correct. Ill considered changes to regulators can cause real damage to peoples boards. I know we've discussed regulators before and that my opinion falls on deaf ears, but worth one last try.. Author: Iain Paton Date: Fri Mar 25 22:07:55 2016 +0000 sunxi: A20-OLinuXino-LIME2: Update ldo3/ldo4 in DTS A recent ill-considered u-boot change: >commit 02cc27c74f9b884b538bcd1b93342a4c05b5d608 >Author: Hans de Goede >Date: Sat Oct 3 15:29:24 2015 +0200 > > sunxi: power: Change axp209 LDO3 and LDO4 default to disabled causes the lime2 to lockup/crash when LDO3/4 are re-enabled by the kernel. The AXP209 datasheet shows the powerup values for these regulators to be undefined and the 2.8v suggested by the lime2 schematic also causes a lockup when the regulators are re-enabled so is obviously also incorrect. Empirical measurement suggests LDO3 @ 2.3v and LDO4 @ 2.8v are the actual defaults, but is based on a small sample size. Verified to work with u-boot 2016.03, kernel 4.5.0 on four lime2 boards. Signed-off-by: Iain Paton diff --git a/arch/arm/boot/dts/sun7i-a20-olinuxino-lime2.dts b/arch/arm/boot/dts/sun7i-a20-olinuxino-lime2.dts index d5c796c..e665d22 100644 --- a/arch/arm/boot/dts/sun7i-a20-olinuxino-lime2.dts +++ b/arch/arm/boot/dts/sun7i-a20-olinuxino-lime2.dts @@ -140,14 +140,14 @@ }; vcc_csi0: ldo3 { - regulator-min-microvolt = <700000>; - regulator-max-microvolt = <3500000>; + regulator-min-microvolt = <2300000>; + regulator-max-microvolt = <2300000>; regulator-always-on; }; vcc_csi1: ldo4 { - regulator-min-microvolt = <1250000>; - regulator-max-microvolt = <3300000>; + regulator-min-microvolt = <2800000>; + regulator-max-microvolt = <2800000>; regulator-always-on; };