From patchwork Thu Jun 6 13:02:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Vasut X-Patchwork-Id: 1944651 X-Patchwork-Delegate: patrice.chotard@st.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.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=i+UFup7m; dkim=pass (2048-bit key) header.d=denx.de header.i=@denx.de header.a=rsa-sha256 header.s=phobos-20191101 header.b=rkXx3qRF; dkim-atps=neutral Authentication-Results: legolas.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=patchwork.ozlabs.org) 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 ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Vw4JV6wlXz20PW for ; Thu, 6 Jun 2024 23:03:22 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 8FDDE883AA; Thu, 6 Jun 2024 15:03:20 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (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=1717679000; bh=iNQAEz1SXQr5mv/7JOm+IOln8rFvhdf48ItkZ8tpjHg=; h=From:To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From; b=i+UFup7mp3By51Mq9Z1XUEeF5hLXVIbN6+xu4KbPMks71EOz/0XxTY7i4482U6eiw 05w/zs4GOFq1/tzFH3GewxinvSiz0iYKcVpWKPrrITNxIi46GNFena51ZJxvWlZS/r rHooqXS/Iq/zEwpYIU720tvp4E/ykUZ/FK4R7tu4kdBbr/02ZxSY3Fon4+wYL2+ntz QL+V29o2G8l+9cGHerDGkyCpXSBoitnYEBjgP4godFV635QOgR1KZK9+YyUrGLBlax H+pphLLToSU7oJtjL6NyUf3/P63xzTI5XPMHPuLqsdXaljTGd7gYJT1PaZUnAfeoSy qFb6aoebr2SNA== Received: from tr.lan (ip-86-49-120-218.bb.vodafone.cz [86.49.120.218]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: marex@denx.de) by phobos.denx.de (Postfix) with ESMTPSA id AE68F87666; Thu, 6 Jun 2024 15:03:18 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1717678999; bh=iNQAEz1SXQr5mv/7JOm+IOln8rFvhdf48ItkZ8tpjHg=; h=From:To:Cc:Subject:Date:From; b=rkXx3qRFi8JXDKuh9OM8PSvg2foboBdDt7FbL6cnkrCp8hyr/oY4evDB/KzcxwBfj UUwkcwQch+BXEYM4uz7ZcfCrkIfZA82iIOOWP4cDEuRJfDBPFB3O/YMY0ZwkK/zURu EdcvuxTkV/flcrmsfuGKrZN+1KD0w44M6UKVZB/zFKkA0jNJ9zzdFzUdVX7DGSmoqP rmsP0EGl2//7aDe2P23wnPH05kS0Ot6CBqiSodmZGL3Boji+XP2MDLXafBvJ4UQuxf dxabaGsVzKF4yMUdLKKJJj25QLed8/mUxXvbfHEgj8DfgBQiuTLO+sC+/i0VXxkUXf Iq59G1aPe5G7Q== From: Marek Vasut To: u-boot@lists.denx.de Cc: Marek Vasut , Patrice Chotard , Patrick Delaunay , Simon Glass , Tom Rini , u-boot@dh-electronics.com, uboot-stm32@st-md-mailman.stormreply.com Subject: [PATCH] ARM: stm32: Fix livetree conversion on STM32MP15xx DHSOM Date: Thu, 6 Jun 2024 15:02:46 +0200 Message-ID: <20240606130305.24563-1-marex@denx.de> X-Mailer: git-send-email 2.43.0 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 Unlike fdt_node_check_compatible() which returns 0 if node is compatible, ofnode_device_is_compatible() return true which is non-zero if node is compatible. The intention of the code is to exit from the function in case the node is not compatible with "micrel,ks8851-mll". Add the missing invert into the conditional to reinstate original behavior. This exposes a follow up problem caused by conversion to DM based FMC2 EBI driver, where the FMC2 EBI is not configured when accessed by this code. Probe the KS8851 MAC, which also configures the FMC2 EBI as a dependency, so that the KS8851 MAC CCR register can be accessed over the FMC2 EBI bus and checked for EEPROM present bit. Fixes: 5a605b7c8615 ("board: dhelectronics: stm32mp1: convert to livetree") Signed-off-by: Marek Vasut Reviewed-by: Patrice Chotard --- Cc: Patrice Chotard Cc: Patrick Delaunay Cc: Simon Glass Cc: Tom Rini Cc: u-boot@dh-electronics.com Cc: u-boot@lists.denx.de Cc: uboot-stm32@st-md-mailman.stormreply.com --- board/dhelectronics/dh_stm32mp1/board.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/board/dhelectronics/dh_stm32mp1/board.c b/board/dhelectronics/dh_stm32mp1/board.c index ebd45f9053f..4f4f537fee5 100644 --- a/board/dhelectronics/dh_stm32mp1/board.c +++ b/board/dhelectronics/dh_stm32mp1/board.c @@ -76,14 +76,25 @@ static bool dh_stm32_mac_is_in_ks8851(void) { - ofnode node; + struct udevice *udev; u32 reg, cider, ccr; + char path[256]; + ofnode node; + int ret; node = ofnode_path("ethernet1"); if (!ofnode_valid(node)) return false; - if (ofnode_device_is_compatible(node, "micrel,ks8851-mll")) + ret = ofnode_get_path(node, path, sizeof(path)); + if (ret) + return false; + + ret = uclass_get_device_by_of_path(UCLASS_ETH, path, &udev); + if (ret) + return false; + + if (!ofnode_device_is_compatible(node, "micrel,ks8851-mll")) return false; /*