From patchwork Fri Jul 15 17:01:02 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Christian_Kohlsch=C3=BCtter?= X-Patchwork-Id: 12919477 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 69BEBC43334 for ; Fri, 15 Jul 2022 17:01:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:To:References:Message-Id:Cc:Date: In-Reply-To:From:Subject:Mime-Version:Reply-To:Content-ID:Content-Description :Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=46/IBTFRJzBSsWVn8OH/jr833BuyAE2djs62OqNHSTE=; b=II0+sLE6TjRgmd tOqgyqscti8CmT8ueSJLLZ0douL4josFWYdi0zFAwNZzBKy1kaE4eg+CnWJAZW25XpGZUD7a4a5OU yNHk/xTZBLDPhX1XtyvbgUKx9A0IDMKXqstZj/IUAPRg7sCCIZ9F+UY/XpePA0BMfkE8pZhnnf94d W0QGSBPYi6O26zXE97uqM8CYkWg32MApmydukeq4mDw5zrBSCip1VRDt5Md3DJ7zbRSm/jQKenIdp IwaVn90eo1T8wKaDRZqwwyobw3MUCn+TM585lLoSHPQl1A3zMEBXgtBfL4VUN/fOamnwwD90YExnN 5M4h1ROFLtfFWjZktjOA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oCOgs-0090Wo-8U; Fri, 15 Jul 2022 17:01:22 +0000 Received: from mail-ej1-x62e.google.com ([2a00:1450:4864:20::62e]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oCOgh-0090QA-P8 for linux-rockchip@lists.infradead.org; Fri, 15 Jul 2022 17:01:13 +0000 Received: by mail-ej1-x62e.google.com with SMTP id z23so10014326eju.8 for ; Fri, 15 Jul 2022 10:01:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kohlschutter-com.20210112.gappssmtp.com; s=20210112; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=dIRVpOqiqH59RP0AoZiD2s3xlmYa2fxQT3tSFC8Essc=; b=HRy26nf+hmKczXYwhz8g5F1tYXyzvWLNDZbn+FWf+AiEATRROmPI+AoL9+m/YxBlLS K3uRB9w/1ZIIZV6E+hgu7GNHmQQFNvxB7fbmvBWEyxKY1+RF5dNWI1Q2veOAs8c8cW+Y hhxBqUOvZnpOaa4+p9EQ7lw6c5Q3W7aDFgdjclMTKaQPL3uGM28Bn1IA3BAeAjxiYckB N6bl61gRnYmN0esXHP2QkHcXNMWT09uysgJvDCcpyB8F5rNRlSdwFWt37o2tmfk27cWL MEKgBmxUvEYNaNwjpKnJDgT/2Uo2IqAtSUdBXGKFinOK3WxS7OTqYmAgx/rOf5b9UOzq L7nw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=dIRVpOqiqH59RP0AoZiD2s3xlmYa2fxQT3tSFC8Essc=; b=xEPAyJh5nTNRKYeD1vLj2fgXWo1UAbbioXVYABcMtyEL/AVPDZQN7kzlB8dQgZZhHK ji56ACeWg2ehFjf6U7j9qX5+6K9PbmRNRCcGQBLPTgPED5NZtYX0z+goIgwAQ8fqNrtb E/iS9ZGDRFNzr6J5LdR6YX7qwmKFxCkoq7hFyfcuBj2CAHz/YGPui6iAaq+Qk0o4XS+P rV++OOIA3/2lQmwvk2A6NHwdxdpxU+tWCLTceFsBIwS9tVCMEZ1cQA6UnDNm3GNfbe6h c0nsLb+n5pOLi9Qg0g01v+1aSHbLA4KccMy9EpMMiTs13zg6Zys9zvYKXDoKffCRniva XJ4Q== X-Gm-Message-State: AJIora9WJUYownaCNc4d8Q6DFOp1Q5584jAviPloD5SjWELm38gGWSmz 8i9M/a6cDyNCeyo4/7gVNj4rDA== X-Google-Smtp-Source: AGRyM1s485bZlc9JnrL6z/lbu4yj3ep3vPK+ktztWjflB/3vWNqvh4mR5HlbnzXJR9uF9cnStQ2dMA== X-Received: by 2002:a17:906:8a4d:b0:72b:6b8d:3779 with SMTP id gx13-20020a1709068a4d00b0072b6b8d3779mr14677191ejc.759.1657904463891; Fri, 15 Jul 2022 10:01:03 -0700 (PDT) Received: from smtpclient.apple (ip5b434222.dynamic.kabel-deutschland.de. [91.67.66.34]) by smtp.gmail.com with ESMTPSA id f24-20020a056402069800b004316f94ec4esm3142765edy.66.2022.07.15.10.01.02 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 15 Jul 2022 10:01:03 -0700 (PDT) Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.100.31\)) Subject: [PATCH v3] arm64: dts: rockchip: Fix SD card init on rk3399-nanopi4 From: =?utf-8?q?Christian_Kohlsch=C3=BCtter?= In-Reply-To: <502b3fbe-3077-407e-6010-a8cb3ffce7d6@arm.com> Date: Fri, 15 Jul 2022 19:01:02 +0200 Cc: linux-arm-kernel , "open list:ARM/Rockchip SoC..." , linux-kernel , Linux MMC List Message-Id: <449292CA-CE60-4B90-90F7-295FBFEAB3F8@kohlschutter.com> References: <12878108.O9o76ZdvQC@diego> <103b714c-b07c-f016-1062-84bd94786b22@arm.com> <9AF1E75F-5947-49B0-887D-82C426527B99@kohlschutter.com> <590f7a08-a6ca-be54-4254-363343642a52@arm.com> <5ca9bd94-54d9-04f8-0098-a56ffb6f5fe1@arm.com> <502b3fbe-3077-407e-6010-a8cb3ffce7d6@arm.com> To: Robin Murphy , wens@kernel.org, =?utf-8?q?Heiko_St?= =?utf-8?q?=C3=BCbner?= , Markus Reichl X-Mailer: Apple Mail (2.3696.100.31) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220715_100111_824498_3D6C240B X-CRM114-Status: GOOD ( 11.15 ) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+linux-rockchip=archiver.kernel.org@lists.infradead.org mmc/SD-card initialization may fail on NanoPi R4S with "mmc1: problem reading SD Status register" / "mmc1: error -110 whilst initialising SD card" either on cold boot or after a reboot. Moreover, the system would also sometimes hang upon reboot. This is prevented by setting an explicit undervoltage protection limit for the SD-card-specific vcc3v0_sd voltage regulator. While using a limit of 3V seems to work, an additional safety buffer should prevent accidental tripping, preventing a system hang. Set the undervoltage protection limit to 2.7V, which is the minimum permissible SD card operating voltage. Signed-off-by: Christian Kohlschütter --- arch/arm64/boot/dts/rockchip/rk3399-nanopi4.dtsi | 4 ++++ 1 file changed, 4 insertions(+) mode change 100644 => 100755 arch/arm64/boot/dts/rockchip/rk3399-nanopi4.dtsi diff --git a/arch/arm64/boot/dts/rockchip/rk3399-nanopi4.dtsi b/arch/arm64/boot/dts/rockchip/rk3399-nanopi4.dtsi old mode 100644 new mode 100755 index 8c0ff6c96e03..669c74ce4d13 --- a/arch/arm64/boot/dts/rockchip/rk3399-nanopi4.dtsi +++ b/arch/arm64/boot/dts/rockchip/rk3399-nanopi4.dtsi @@ -73,6 +73,10 @@ vcc3v0_sd: vcc3v0-sd { regulator-always-on; regulator-min-microvolt = <3000000>; regulator-max-microvolt = <3000000>; + + // must be initialized or SD card may fail to initialize / system may hang + regulator-uv-protection-microvolt = <2700000>; + regulator-name = "vcc3v0_sd"; vin-supply = <&vcc3v3_sys>; };