From mboxrd@z Thu Jan 1 00:00:00 1970 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 phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9E9E9C43334 for ; Thu, 16 Jun 2022 08:40:35 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 37F5084328; Thu, 16 Jun 2022 10:40:33 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=solid-run.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=solid-run-com.20210112.gappssmtp.com header.i=@solid-run-com.20210112.gappssmtp.com header.b="FmND+3u1"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 891AC84334; Thu, 16 Jun 2022 10:40:31 +0200 (CEST) Received: from mail-ed1-x534.google.com (mail-ed1-x534.google.com [IPv6:2a00:1450:4864:20::534]) (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 28EC084304 for ; Thu, 16 Jun 2022 10:40:29 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=solid-run.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=josua@solid-run.com Received: by mail-ed1-x534.google.com with SMTP id w27so1176104edl.7 for ; Thu, 16 Jun 2022 01:40:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=solid-run-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=hcgM8S7JCgYF3ggd7UNAcrM156F6ik2uHJsLdy+eikY=; b=FmND+3u1OpWgQzegnLHfqRNfMfTaaua04t40mPcMz8/2KCsgA+UtBbFJLkfDX9bc8I MKepSJ0HCe601arQlzpnY3XBWts+yNMvHE6R07+p+4Gm5lNi2EZrIYfKGa/e8jW2SVT2 lB8GFGPOsIeYIAL7amN18VsPexumMdnjrKXhT/iho5ZAC4Ilac6GtJsjuPR14+nfMwwh RgSTAmfgUTdfCGxc3vsT4NwkMMLuZaVtxyS/qQEgoUpOI2Sz2inEWlr8P60NfJF9hoO4 m1xUG1j8mTLquyADvqcDbDcvzdS9DWeMH6Jn67/u02686d23TU5vb9X+17oZRMmEArbZ qKZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=hcgM8S7JCgYF3ggd7UNAcrM156F6ik2uHJsLdy+eikY=; b=TCCAAtLNjFWxKptlvLoB9LxOzX32ZoV64esCQhj3UhGmAweF/oJ1eXw3omzmoU5fDA X5mY2OXqMd5YH/bj19Kj/gP4T8egfwzrTQUtRH3PvdNya4edDYKx5BfUmJLV8u99tqvH TqeKVWkzO4KDDLSzjTlw0Jat7VKDtNT3ixI/d8NJN0tD4OpWlSDHA6+4GAfoHsm6oSLi Igpl0HNtq4IiKeYr+FuNmqNK+UhvuOq3taky02Fbbolw837+pvjU0WObQDRillfweOJ4 IVqbUtGChGnbzFtXtz8ruPuTi4cMAD6MyUTRvwtj7z5AprbIjqeGtAA9f+xye9yaO89e Qr+w== X-Gm-Message-State: AJIora+9gV1ebjcSXCeVcOWXDklGn5gZvJQIcZ1R3q1bxw7F0XlT7aM1 KvaBTDVBgjO7LuB6UnJ8ME83clw6drDLKkoc X-Google-Smtp-Source: AGRyM1u497wX8nV1Z3jedxdsDNMrPNYYtBVqb7nMdk14XLM7Uwq9xKzW0vzGDGGSZLNG2MolHxxKSQ== X-Received: by 2002:a05:6402:1851:b0:42d:c904:d73b with SMTP id v17-20020a056402185100b0042dc904d73bmr4896983edy.417.1655368828537; Thu, 16 Jun 2022 01:40:28 -0700 (PDT) Received: from localhost.localdomain (p4fde234b.dip0.t-ipconnect.de. [79.222.35.75]) by smtp.gmail.com with ESMTPSA id o16-20020a170906601000b0070662b3b792sm469079ejj.222.2022.06.16.01.40.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Jun 2022 01:40:27 -0700 (PDT) From: Josua Mayer To: u-boot@lists.denx.de Cc: alvaro.karsz@solid-run.com, Josua Mayer , Baruch Siach , Fabio Estevam Subject: [PATCH] mx6cuboxi: fix board detection while patching device-tree phy nodes Date: Thu, 16 Jun 2022 11:40:15 +0300 Message-Id: <20220616084015.13932-1-josua@solid-run.com> X-Mailer: git-send-email 2.35.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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.5 at phobos.denx.de X-Virus-Status: Clean ft_board_setup relies on the board_type() function to optimize which phy nodes need to be enabled for Linux. Add calls to setup and release the board-detect GPIOs. Also fix the switch-case statement to only enable phy address 4 for Cubox and unknown devices. Fixes: 741ce308 ("mx6cuboxi: fixup dtb ethernet phy nodes before booting an OS") Signed-off-by: Josua Mayer --- board/solidrun/mx6cuboxi/mx6cuboxi.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/board/solidrun/mx6cuboxi/mx6cuboxi.c b/board/solidrun/mx6cuboxi/mx6cuboxi.c index 42aa5cb63c..debf4f6a3b 100644 --- a/board/solidrun/mx6cuboxi/mx6cuboxi.c +++ b/board/solidrun/mx6cuboxi/mx6cuboxi.c @@ -449,15 +449,26 @@ int ft_board_setup(void *fdt, struct bd_info *bd) int node_phy0, node_phy1, node_phy4; int ret, phy; bool enable_phy0 = false, enable_phy1 = false, enable_phy4 = false; + enum board_type board; + + // detect device + request_detect_gpios(); + board = board_type(); + free_detect_gpios(); // detect phy phy = find_ethernet_phy(); if (phy == 0 || phy == 4) { enable_phy0 = true; - switch (board_type()) { + switch (board) { + case HUMMINGBOARD: + case HUMMINGBOARD2: + /* atheros phy may appear only at address 0 */ + break; case CUBOXI: case UNKNOWN: default: + /* atheros phy may appear at either address 0 or 4 */ enable_phy4 = true; } } else if (phy == 1) { -- 2.35.3