From patchwork Sat Dec 26 00:09:02 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lukasz Majewski X-Patchwork-Id: 1420655 X-Patchwork-Delegate: trini@ti.com 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=GDEzGWTn; 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 4D2kjN5fG8z9sW8 for ; Sat, 26 Dec 2020 11:10:32 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 7A890826AC; Sat, 26 Dec 2020 01:10:10 +0100 (CET) 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=1608941410; bh=fzn2i65w/WIpTGwyFy9UiEXD3RznQjUWY4OzIVrGKFY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=GDEzGWTndT0YUS2CvpWfPduh+aaGDqAuE2yWQ8zimteEmGeQt2KaSy14lRYmL0Inj m90YSpTNohIxvdvUeJhaBH4YsQ7OVR54wpi5hZoYgsuB7ACdVgeF9xaZkz+Ai8p2BT 6+c3NVHQZUcGA/qUh5xLHhPkeLK9apMeS3LsS6stMYPF8t2AwSsg6noLrHK0n5Hxco gvchxZSG5nVco4MatDpQ4WmFJj5Q3Fc3KUHyr9dFQY00PsBYhh60j3eukR4NIq1JpN 7UaSWf63EyeW5qQR9eShnw0Q+bCuaHFknO18iooAKFIpnWk/UiWLXpD/AQgMP/67r4 KULCq8M3huR+A== Received: by phobos.denx.de (Postfix, from userid 109) id 537788268D; Sat, 26 Dec 2020 01:09:50 +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=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW, SPF_HELO_NONE 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 6D30F82686 for ; Sat, 26 Dec 2020 01:09:28 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=none smtp.mailfrom=lukma@denx.de Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 4D2kh81knTz1rt3q; Sat, 26 Dec 2020 01:09:28 +0100 (CET) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 4D2kh81VSrz1qr4D; Sat, 26 Dec 2020 01:09:28 +0100 (CET) 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 e-n0FgGGnd_q; Sat, 26 Dec 2020 01:09:27 +0100 (CET) X-Auth-Info: yeIwg+FFrGqVUICZyBlnZygG6ZNAzs2HeT4+ntTJy+E= Received: from localhost.localdomain (89-64-25-12.dynamic.chello.pl [89.64.25.12]) (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, 26 Dec 2020 01:09:27 +0100 (CET) From: Lukasz Majewski To: u-boot@lists.denx.de, Stefano Babic , Simon Glass , Tom Rini Cc: Lukasz Majewski Subject: [PATCH v1 3/3] xea: config: Disable CONFIG_SPL_OF_PLATDATA_PARENT on XEA (imx28) Date: Sat, 26 Dec 2020 01:09:02 +0100 Message-Id: <20201226000902.23020-4-lukma@denx.de> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20201226000902.23020-1-lukma@denx.de> References: <20201226000902.23020-1-lukma@denx.de> MIME-Version: 1.0 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 On the XEA board (imx28) one needs in the SPL support for GPIO, MMC and SPI. Two last ones are necessary for booting the device. The GPIO support allows deciding which medium will be used. For example the GPIO DTS node (gpio@0 at imx28.dtsi) has pinctrl parent (pinctrl@80018000) for which we don't need driver asigned for correct operation. In the spl/dts/dt-platdata.c the gpio@0 has index 4 and its parent - pinctrl@80018000 has index 5. In the bind_drivers_pass() function (at drivers/core/lists.c) call to device_bind_by_name() for `fsl_imx23_pinctrl` returns -2, which is expected. With current setup - when the SPL_OF_PLATDATA_PARENT=y The gpio@0 node with index 4 is skipped as its parent with 5 is not yet bound. It cannot be as we don't need and provide the driver for it. As a result the gpio@0 is never bound and we end up with bricked board in the SPL stage. When CONFIG_SPL_OF_PLATDATA_PARENT is NOT set, all entries from spl/dts/dt-platdata.c are scanned in ascending index order, so gpio@0 is properly initialized. For `fsl_imx_pinctrl` we simply check 10 times if the driver for is available (which is not) and exit. As a result the GPIOs are initialized and can be used in early SPL stage. This commit fixes XEA regression introduced with e41651fffda7da55f6. Signed-off-by: Lukasz Majewski Reviewed-by: Simon Glass --- configs/imx28_xea_defconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/configs/imx28_xea_defconfig b/configs/imx28_xea_defconfig index e418d8c9e9..2e1d060024 100644 --- a/configs/imx28_xea_defconfig +++ b/configs/imx28_xea_defconfig @@ -65,6 +65,7 @@ CONFIG_OF_CONTROL=y CONFIG_SPL_OF_CONTROL=y CONFIG_OF_SPL_REMOVE_PROPS="pinctrl-0 pinctrl-names clock-names interrupt-parent interrupts" CONFIG_SPL_OF_PLATDATA=y +# CONFIG_SPL_OF_PLATDATA_PARENT is not set CONFIG_ENV_OVERWRITE=y CONFIG_ENV_IS_IN_SPI_FLASH=y CONFIG_USE_ENV_SPI_BUS=y