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 lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 536C8C43334 for ; Wed, 8 Jun 2022 06:15:32 +0000 (UTC) Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4LHxmL31xNz3bhK for ; Wed, 8 Jun 2022 16:15:30 +1000 (AEST) Received: from gandalf.ozlabs.org (gandalf.ozlabs.org [150.107.74.76]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4LHxlw2SDKz30F8 for ; Wed, 8 Jun 2022 16:15:08 +1000 (AEST) Received: from gandalf.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3]) by gandalf.ozlabs.org (Postfix) with ESMTP id 4LHxlr1clBz4xR1; Wed, 8 Jun 2022 16:15:04 +1000 (AEST) Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.ozlabs.org (Postfix) with ESMTPSA id 4LHxll3k9sz4xD9; Wed, 8 Jun 2022 16:14:59 +1000 (AEST) From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= To: openbmc@lists.ozlabs.org Subject: [PATCH 1/2] spi: aspeed: Use "jedec,spi-nor" compatible to count devices Date: Wed, 8 Jun 2022 08:14:54 +0200 Message-Id: <20220608061455.365123-1-clg@kaod.org> X-Mailer: git-send-email 2.35.3 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: openbmc@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development list for OpenBMC List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Chin-Ting Kuo , Jae Hyun Yoo , Joel Stanley , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= Errors-To: openbmc-bounces+openbmc=archiver.kernel.org@lists.ozlabs.org Sender: "openbmc" The SoC device trees use the "jedec,spi-nor" compatible property to describe the flash devices and the board device trees override this property with "spi-flash", "sst,w25q256". This comes from the initial driver which was first written when spi-nor support had not been merged in U-boot yet. "jedec,spi-nor" should be preferred since it is used by Linux and the latest U-boot. Use it to count devices. We will clean up the board device trees later. Cc: Chin-Ting Kuo Signed-off-by: Cédric Le Goater --- drivers/spi/aspeed_spi.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/spi/aspeed_spi.c b/drivers/spi/aspeed_spi.c index 65d69105e8e8..45f6a8dd6850 100644 --- a/drivers/spi/aspeed_spi.c +++ b/drivers/spi/aspeed_spi.c @@ -1241,7 +1241,8 @@ static int aspeed_spi_count_flash_devices(struct udevice *bus) dev_for_each_subnode(node, bus) { if (ofnode_is_available(node) && - ofnode_device_is_compatible(node, "spi-flash")) + (ofnode_device_is_compatible(node, "spi-flash") || + ofnode_device_is_compatible(node, "jedec,spi-nor"))) count++; } -- 2.35.3