From patchwork Thu Dec 17 09:06:24 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 344917 Delivered-To: patch@linaro.org Received: by 2002:a02:85a7:0:0:0:0:0 with SMTP id d36csp986866jai; Thu, 17 Dec 2020 01:07:03 -0800 (PST) X-Google-Smtp-Source: ABdhPJwZI6D86nnKH7BgEJR0LBOxm7ctyiUhRBV0s+ikM0aiz9y5HgySOwLLF6F8y32Z+Ey6R57u X-Received: by 2002:a17:906:5952:: with SMTP id g18mr12352581ejr.506.1608196023390; Thu, 17 Dec 2020 01:07:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608196023; cv=none; d=google.com; s=arc-20160816; b=LWaxPb6jD/fMN5Z08tOK/GmpFmE6XchZ9Bk9logVvrQ+Es7H+UZQ+1MKNC5dLkzgVA 2QheqDn8s8jOHmWIypvj2AXraZGLkkNLUE5/4vdptff5F5SGdgW59KfNKdZDwMO+bR8M IOkNL6FFW4bjQe8mH56Z0GjvYHFqV1SzbtsJAysdYGRb7xJAnGOEwoyzbjDDA7TCnIH6 UzKrKcEThgFm+wwAW5WJuOfkoU/22BfKc3nCeph6aZbT4qUfP0q2fhLH9vGxaCNCdTdY xgvfuwPi1rpt/kZT21M4VS7waqphIh/SECiQrelqrPiV/ZdJqN7w8dNcTQTElh8jE441 ijqg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:references:cms-type:message-id :date:subject:cc:to:from:dkim-signature:dkim-filter; bh=rO6ZtC7/2GfmHNLyS/Wh+JO9DwZo/WFi/2UPkH05UR4=; b=UWJAMiT0bFYZzO861ACL0iWF8IctwWuRK8sQC1HQC72T69fSb0VebUCsyavUA5Gy9k 2C/m1fmfmZOWqVVojudqphl8VPfyZuvn+tYb6FHPBWXkkcyeSkhvaGbhDbcKmQEoPuXO Yl28cXtbyzFuTcZQRSNknv/KInypNHXEOelSTAJmqV4nKZVJU/6U/cpJraB7VEGixgJu dPl/6aeUe6gQ9BQl3e5iYZ2j+cTcHouOutSd+DFUu1EkX0cf0IJ/bCPlde1LslUGnTBp Ycbllf3EIniK0m7WZkWdVh/CiN63WGaTJGJ/smlE/RvbC7u88ZswzVfI+m5sJBMK/pL6 wm7g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b="s/bRUfMR"; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from phobos.denx.de (phobos.denx.de. [2a01:238:438b:c500:173d:9f52:ddab:ee01]) by mx.google.com with ESMTPS id q11si2228447ejx.0.2020.12.17.01.07.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Dec 2020 01:07:03 -0800 (PST) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; Authentication-Results: mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b="s/bRUfMR"; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id AF9E882B2C; Thu, 17 Dec 2020 10:06:59 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=samsung.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=samsung.com header.i=@samsung.com header.b="s/bRUfMR"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 59E6182B17; Thu, 17 Dec 2020 10:06:58 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-7.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_HI, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mailout1.w1.samsung.com (mailout1.w1.samsung.com [210.118.77.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 53E1C82B17 for ; Thu, 17 Dec 2020 10:06:55 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=samsung.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=m.szyprowski@samsung.com Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20201217090644euoutp01eaaca246915df4b7b2cc2006a774e6d7~Rdb7dd2pu0079300793euoutp017 for ; Thu, 17 Dec 2020 09:06:44 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20201217090644euoutp01eaaca246915df4b7b2cc2006a774e6d7~Rdb7dd2pu0079300793euoutp017 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1608196004; bh=rO6ZtC7/2GfmHNLyS/Wh+JO9DwZo/WFi/2UPkH05UR4=; h=From:To:Cc:Subject:Date:References:From; b=s/bRUfMRB8lvieoXjRi2rQnPIRy16T8j+9DLy6iZ1Hv7TmTxPGCZ1tmu5wY0fm9Kh Mz75sMky+uVWD+KgGNOVKdIwSqw7KhEvlN2qCIvhuzZGjJTx/hgmfJlKIf2Q5uqx0d aPPhsYeuoEgVSJ4xWJQx5cJT3zE/YVyIUvPaxtC4= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20201217090636eucas1p1d324ac7a85362e50bf644184e990c935~Rdb0GgCtw1853118531eucas1p1f; Thu, 17 Dec 2020 09:06:36 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id FF.66.27958.C9F1BDF5; Thu, 17 Dec 2020 09:06:36 +0000 (GMT) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20201217090636eucas1p12fcdef289555f4efc425a8f325ddfe4c~Rdbzwe5Ec1853118531eucas1p1e; Thu, 17 Dec 2020 09:06:36 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20201217090636eusmtrp261005abea10d0e915fc109b3dff41d0a~Rdbzvo7mv1507115071eusmtrp2Q; Thu, 17 Dec 2020 09:06:36 +0000 (GMT) X-AuditID: cbfec7f2-efdff70000006d36-5b-5fdb1f9cdfa6 Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id A3.4A.21957.C9F1BDF5; Thu, 17 Dec 2020 09:06:36 +0000 (GMT) Received: from AMDC2765.digital.local (unknown [106.120.51.73]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20201217090635eusmtip14258a5dfcce6465ba750474f77b9f97a~RdbzZcp-o2994029940eusmtip1C; Thu, 17 Dec 2020 09:06:35 +0000 (GMT) From: Marek Szyprowski To: u-boot@lists.denx.de, u-boot-amlogic@groups.io Cc: Marek Szyprowski , Neil Armstrong , Jaehoon Chung , Bartlomiej Zolnierkiewicz Subject: [PATCH/RFC] board: amlogic: Fix Odroid-C4 SD card reboot issue Date: Thu, 17 Dec 2020 10:06:24 +0100 Message-Id: <20201217090624.14902-1-m.szyprowski@samsung.com> X-Mailer: git-send-email 2.17.1 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrOIsWRmVeSWpSXmKPExsWy7djPc7pz5G/HG5ztV7XYOGM9q8WNX22s FmuP3GW3ONQXbTFpwi82i7d7O9kd2Dze32hl95jf+Z3J4+ydHYwefVtWMQawRHHZpKTmZJal FunbJXBlLH/+g6XgI1/FhbeNrA2M23m6GDk4JARMJGb90Opi5OIQEljBKLHmyXtGCOcLo8TZ 2e1QzmdGiZM7drB3MXKCdWy/3c0OkVjOKPFt0RRWuJbeL59YQarYBAwlut52sYHYIgJGEpea drCAFDEL7GaUaL/UxAKyXFjAXeLWkzSQGhYBVYlbPdcYQcK8ArYSB59qQCyTl1i94QAzSKuE wFd2iSk7dzBBJFwkThx9CWULS7w6vgXqOhmJ/zvnM0E0NDNKPDy3lh3C6WGUuNw0gxGiylri zrlfbCDbmAU0Jdbv0ocIO0rcXQUyCBQwfBI33gqChJmBzEnbpjNDhHklOtqEIKrVJGYdXwe3 9uCFS8wQtofEu7cfwU4TEoiV2DFjOvsERrlZCLsWMDKuYhRPLS3OTU8tNsxLLdcrTswtLs1L 10vOz93ECIz70/+Of9rBOPfVR71DjEwcjIcYJTiYlUR4Ew7cjBfiTUmsrEotyo8vKs1JLT7E KM3BoiTOu2r2mnghgfTEktTs1NSC1CKYLBMHp1QDU5JE2670i89Lp/lGB63+5sm3vKL5/koJ JbO3To7Nog9Fl99SX+nt/PVmwQPhNUdKNeZ7x1ZNfrPzyd5C1k/X3012veDgxFDbFrHMcVHe h/+fm1ueR6ompptsXDG5xNHkWnHRZM/TF96Xn3r7Lmtz0unL+yZY6HJ0/FTdZpb1bnN86oOg H4Jr3he/eT/H6Ni9k2dzzW9y9/xnuFbwfJqN3PpDthPjG99d7fv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JKY51dcfXC86OUWJpTgj0VCLuag4 EQAXHITcvwIAAA== X-CMS-MailID: 20201217090636eucas1p12fcdef289555f4efc425a8f325ddfe4c X-Msg-Generator: CA X-RootMTR: 20201217090636eucas1p12fcdef289555f4efc425a8f325ddfe4c X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20201217090636eucas1p12fcdef289555f4efc425a8f325ddfe4c References: X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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.3 at phobos.denx.de X-Virus-Status: Clean For the proper reboot Odroid C4 board requires to switch TFLASH_VDD_EN pin to the input (high impedance?) mode, otherwise the board is stuck in the middle of loading early stages of the bootloader from SD card. This has been achieved by hijacking reset_misc() callback from the PSCI firmware in the Odroid board code. The common meson cpu_reset() function, which is called later during the reboot procedure, will call PSCI reboot anyway. This issue doesn't happen if board is booted from eMMC. Signed-off-by: Marek Szyprowski --- board/amlogic/odroid-n2/odroid-n2.c | 15 +++++++++++++++ configs/odroid-c4_defconfig | 1 + 2 files changed, 16 insertions(+) -- 2.17.1 Tested-by: Mark Kettenis diff --git a/board/amlogic/odroid-n2/odroid-n2.c b/board/amlogic/odroid-n2/odroid-n2.c index caf7fd6810..ad91de7ac5 100644 --- a/board/amlogic/odroid-n2/odroid-n2.c +++ b/board/amlogic/odroid-n2/odroid-n2.c @@ -10,6 +10,7 @@ #include #include #include +#include #include #include @@ -47,3 +48,17 @@ int misc_init_r(void) return 0; } + +#ifndef CONFIG_PSCI_RESET +void reset_misc(void) +{ + if (of_machine_is_compatible("hardkernel,odroid-c4")) { + unsigned int gpio; + const char *str_gpio = "aobus-banks3"; + + gpio_lookup_name(str_gpio, NULL, NULL, &gpio); + gpio_request(gpio, "reboot"); + gpio_direction_input(gpio); + } +} +#endif diff --git a/configs/odroid-c4_defconfig b/configs/odroid-c4_defconfig index 367d22db0b..ca0ab71a7a 100644 --- a/configs/odroid-c4_defconfig +++ b/configs/odroid-c4_defconfig @@ -14,6 +14,7 @@ CONFIG_DEBUG_UART=y CONFIG_OF_BOARD_SETUP=y # CONFIG_DISPLAY_CPUINFO is not set CONFIG_MISC_INIT_R=y +# CONFIG_PSCI_RESET is not set # CONFIG_CMD_BDI is not set # CONFIG_CMD_IMI is not set CONFIG_CMD_GPIO=y