From patchwork Tue Jul 4 17:09:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 1803335 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20221208 header.b=HBBaSuyo; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4QwTn54Fkcz20Pf for ; Wed, 5 Jul 2023 03:10:01 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 3A22E85E44; Tue, 4 Jul 2023 19:09:58 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="HBBaSuyo"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id B9CE586119; Tue, 4 Jul 2023 19:09:56 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-oa1-x31.google.com (mail-oa1-x31.google.com [IPv6:2001:4860:4864:20::31]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 62517847A5 for ; Tue, 4 Jul 2023 19:09:54 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=festevam@gmail.com Received: by mail-oa1-x31.google.com with SMTP id 586e51a60fabf-1a35f67d8efso1077957fac.1 for ; Tue, 04 Jul 2023 10:09:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1688490593; x=1691082593; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=1AtavPLAdcWy4XJk3aJqF/h/PfN9IUiLH3AofCSk/6A=; b=HBBaSuyoy/4rqNMBYT96fAsr8cKkTPJIFHXlWfckIALvFDwzPUScP0W8OG4HK8JYfq tSUYDpjfTDCcwJjCaRiMkaT1RVJ1Ux1roxH7NPyUjVbDC4ue83R5W+QldGSQr9DWw/dG fGfzEUm64IK6hKqayVwoYQAqnUnYkjQznLqO/9jKDLQcd3XSOMitzzqUixvcCJeZa6Ht cJhPD1VwoRVP4Y9ZEzgq06HXQiZ2dGEDamlnuLefBASXea2OQSj1DeJqWDK7YbsrDDSK drMEiWasys3UzoJvu5pGrNyD3Gd40R0+Iap7ybAV/BlzRLgOETbv/2Wo05xxqvwU0YyQ Ygpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688490593; x=1691082593; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=1AtavPLAdcWy4XJk3aJqF/h/PfN9IUiLH3AofCSk/6A=; b=YlbQpMeEIn8rVnNDEJgO0vvd9bw7EcdzmTXnHGzgcRlBBtwqmkN/hS8MTo8d1hB8G4 5zmth/zD4gJsZFiPDk9NMKMbG5Za7l1XrTsni6RKplq006bb+x3HeAYrKyqv2aPHtz7u szejtlqL9IF8wRSQykisx9YGsynF75Oubye6FzR84/jMr4acuQjG0wrwTSQ6SoPag5eM lbhBSDeD971TX4qPJLIAbvGDOlT1lpc8NhNez0kBe8v4A78YghWCI9erlYCiSZo0M5oN 5l97jIDMSxbL2V1qxxiJGiuUjW5CSCE2Ld44l6yGAARJSpH5jHlKBH6CLtGwICTvPj8m aD2Q== X-Gm-Message-State: ABy/qLZ6AQkXoacrhhlehS5AHyJwu8qfopS+s6BOGTiXHT6Dlzo7Lt01 wmLox13mhHuEfAGBwe8xBjPlT2Y6R349Bw== X-Google-Smtp-Source: APBJJlGu3eJGdwcGFUZvBY8J3LfMQ93bh+VXubrmCTGceMPL13oqd9CjLlxi8dAkZYVob1j3AX6+Uw== X-Received: by 2002:a05:6870:4187:b0:1b3:afdc:6c08 with SMTP id y7-20020a056870418700b001b3afdc6c08mr6020552oac.0.1688490592926; Tue, 04 Jul 2023 10:09:52 -0700 (PDT) Received: from fabio-Precision-3551.. ([2804:14c:485:4b61:5e54:8fcb:96f1:921d]) by smtp.gmail.com with ESMTPSA id pt1-20020a0568709e4100b001b36699bd5fsm5540169oab.35.2023.07.04.10.09.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Jul 2023 10:09:52 -0700 (PDT) From: Fabio Estevam To: trini@konsulko.com Cc: u-boot@lists.denx.de, marcel.ziswiler@toradex.com, francesco.dolcini@toradex.com, sbabic@denx.de, Fabio Estevam Subject: [PATCH v2] colibri-imx7: Call fdt_increase_size() Date: Tue, 4 Jul 2023 14:09:45 -0300 Message-Id: <20230704170945.1533283-1-festevam@gmail.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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.103.8 at phobos.denx.de X-Virus-Status: Clean From: Fabio Estevam For changing the USB OTG node status from "okay" to "disabled" more space is needed, so call fdt_increase_size() to avoid the following error: ``` U-Boot 2023.07-rc5-0.0.0-devel+git.580eb31199be (Jun 27 2023 - 13:39:58 +0000) CPU: Freescale i.MX7S rev1.2 800 MHz (running at 792 MHz) CPU: Extended Commercial temperature grade (-20C to 105C) at 30C Reset cause: POR DRAM: initcall sequence 8786eafc failed at call 8781b351 (err=-3) ### ERROR ### Please RESET the board ### ``` Ideally, fdt_status_disabled() should call fdt_increase_size() internally, so that there would be no need for manually calling it in board code. Do it manually for now to fix the regression. Based on the code from board/CZ.NIC/turris_omnia/turris_omnia.c. Reported-by: Francesco Dolcini Signed-off-by: Fabio Estevam Reviewed-by: Francesco Dolcini Tested-by: Francesco Dolcini # Toradex Colibri iMX7S --- Changes since v1: - Fix indentation. (Francesco) board/toradex/colibri_imx7/colibri_imx7.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/board/toradex/colibri_imx7/colibri_imx7.c b/board/toradex/colibri_imx7/colibri_imx7.c index 3e79ab93a982..119e67b47f79 100644 --- a/board/toradex/colibri_imx7/colibri_imx7.c +++ b/board/toradex/colibri_imx7/colibri_imx7.c @@ -311,10 +311,23 @@ int ft_board_setup(void *blob, struct bd_info *bd) #ifdef CONFIG_USB_EHCI_MX7 int board_fix_fdt(void *rw_fdt_blob) { + int ret; + /* i.MX 7Solo has only one single USB OTG1 but no USB host port */ if (is_cpu_type(MXC_CPU_MX7S)) { int offset = fdt_path_offset(rw_fdt_blob, "/soc/bus@30800000/usb@30b20000"); + /* + * We're changing from status = "okay" to status = "disabled". + * In this case we'll need more space, so increase the size + * a little bit. + */ + ret = fdt_increase_size(rw_fdt_blob, 32); + if (ret < 0) { + printf("Cannot increase FDT size: %d\n", ret); + return ret; + } + return fdt_status_disabled(rw_fdt_blob, offset); }