From nobody Mon Sep 8 08:00:18 2025 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 16FDDEE57F1 for ; Fri, 8 Sep 2023 10:18:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230260AbjIHKSl (ORCPT ); Fri, 8 Sep 2023 06:18:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37026 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235885AbjIHKSh (ORCPT ); Fri, 8 Sep 2023 06:18:37 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A258E2134 for ; Fri, 8 Sep 2023 03:18:00 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 35D0CC433BB; Fri, 8 Sep 2023 10:17:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1694168254; bh=ynRD6EJmzx9ScX9FqHEAG3RGBNXu033RrZwYL9Faey8=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=sBIySQNkGtQEVLyt+YcTgdwTBYTjpnjzqXiUUDvRJ/g60FnJt+0Yj98t5vHE1H6AE 4zwuPF7G2jyu0gXzwCqrLFNUNBfb648mmwWRjzWX1plzWYVj/ANMYBP4nYYxlTRppm UdZJ3m8gXVbowf1Ukc2SKCvLL9++hKt///9/5siCpLP4oXgHfKkv1oUMmWQ9nu5LlO wjgjrFlkjBzheP3g2vAfCMIV+Ivb7rpwAJqdL+rOLpF8tI/m/ObEm7sxDtMZRtEJXf 5bRR4bJ4zuw6CBHuoiJfFzQE9cxyLGt4CrAQJtcA5UAmhvtk4xUT0kBByl6tD/SdM9 ngsUEPVOoR0Ow== From: Michael Walle Date: Fri, 08 Sep 2023 12:16:49 +0200 Subject: [PATCH v3 31/41] mtd: spi-nor: atmel: sort flash_info database MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20230807-mtd-flash-info-db-rework-v3-31-e60548861b10@kernel.org> References: <20230807-mtd-flash-info-db-rework-v3-0-e60548861b10@kernel.org> In-Reply-To: <20230807-mtd-flash-info-db-rework-v3-0-e60548861b10@kernel.org> To: Tudor Ambarus , Pratyush Yadav , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra Cc: linux-kernel@vger.kernel.org, linux-mtd@lists.infradead.org, Michael Walle X-Mailer: b4 0.12.2 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The flash ID is the new primary key into our database. Sort the entry by it. Keep the most specific ones first, because there might be ID collisions between shorter and longer ones. Signed-off-by: Michael Walle Reviewed-by: Tudor Ambarus --- drivers/mtd/spi-nor/atmel.c | 82 ++++++++++++++++++++++-------------------= ---- 1 file changed, 41 insertions(+), 41 deletions(-) diff --git a/drivers/mtd/spi-nor/atmel.c b/drivers/mtd/spi-nor/atmel.c index ccc985c48ae3..18e904962d0e 100644 --- a/drivers/mtd/spi-nor/atmel.c +++ b/drivers/mtd/spi-nor/atmel.c @@ -164,20 +164,20 @@ static const struct spi_nor_fixups atmel_nor_global_p= rotection_fixups =3D { =20 static const struct flash_info atmel_nor_parts[] =3D { { - .id =3D SNOR_ID(0x1f, 0x66, 0x01), - .name =3D "at25fs010", - .sector_size =3D SZ_32K, - .size =3D SZ_128K, - .flags =3D SPI_NOR_HAS_LOCK, + .id =3D SNOR_ID(0x1f, 0x04, 0x00), + .name =3D "at26f004", + .size =3D SZ_512K, .no_sfdp_flags =3D SECT_4K, - .fixups =3D &at25fs_nor_fixups }, { - .id =3D SNOR_ID(0x1f, 0x66, 0x04), - .name =3D "at25fs040", - .size =3D SZ_512K, - .flags =3D SPI_NOR_HAS_LOCK, + .id =3D SNOR_ID(0x1f, 0x25, 0x00), + .name =3D "at45db081d", + .size =3D SZ_1M, .no_sfdp_flags =3D SECT_4K, - .fixups =3D &at25fs_nor_fixups + }, { + .id =3D SNOR_ID(0x1f, 0x42, 0x16), + .name =3D "at25sl321", + .size =3D SZ_4M, + .no_sfdp_flags =3D SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ, }, { .id =3D SNOR_ID(0x1f, 0x44, 0x01), .name =3D "at25df041a", @@ -186,62 +186,62 @@ static const struct flash_info atmel_nor_parts[] =3D { .no_sfdp_flags =3D SECT_4K, .fixups =3D &atmel_nor_global_protection_fixups, }, { - .id =3D SNOR_ID(0x1f, 0x47, 0x00), - .name =3D "at25df321", - .size =3D SZ_4M, + .id =3D SNOR_ID(0x1f, 0x45, 0x01), + .name =3D "at26df081a", + .size =3D SZ_1M, .flags =3D SPI_NOR_HAS_LOCK | SPI_NOR_SWP_IS_VOLATILE, .no_sfdp_flags =3D SECT_4K, .fixups =3D &atmel_nor_global_protection_fixups }, { - .id =3D SNOR_ID(0x1f, 0x47, 0x01), - .name =3D "at25df321a", - .size =3D SZ_4M, + .id =3D SNOR_ID(0x1f, 0x46, 0x01), + .name =3D "at26df161a", + .size =3D SZ_2M, .flags =3D SPI_NOR_HAS_LOCK | SPI_NOR_SWP_IS_VOLATILE, .no_sfdp_flags =3D SECT_4K, .fixups =3D &atmel_nor_global_protection_fixups }, { - .id =3D SNOR_ID(0x1f, 0x48, 0x00), - .name =3D "at25df641", - .size =3D SZ_8M, + .id =3D SNOR_ID(0x1f, 0x47, 0x00), + .name =3D "at25df321", + .size =3D SZ_4M, .flags =3D SPI_NOR_HAS_LOCK | SPI_NOR_SWP_IS_VOLATILE, .no_sfdp_flags =3D SECT_4K, .fixups =3D &atmel_nor_global_protection_fixups }, { - .id =3D SNOR_ID(0x1f, 0x42, 0x16), - .name =3D "at25sl321", + .id =3D SNOR_ID(0x1f, 0x47, 0x00), + .name =3D "at26df321", .size =3D SZ_4M, - .no_sfdp_flags =3D SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ, - }, { - .id =3D SNOR_ID(0x1f, 0x04, 0x00), - .name =3D "at26f004", - .size =3D SZ_512K, - .no_sfdp_flags =3D SECT_4K, - }, { - .id =3D SNOR_ID(0x1f, 0x45, 0x01), - .name =3D "at26df081a", - .size =3D SZ_1M, .flags =3D SPI_NOR_HAS_LOCK | SPI_NOR_SWP_IS_VOLATILE, .no_sfdp_flags =3D SECT_4K, .fixups =3D &atmel_nor_global_protection_fixups }, { - .id =3D SNOR_ID(0x1f, 0x46, 0x01), - .name =3D "at26df161a", - .size =3D SZ_2M, + .id =3D SNOR_ID(0x1f, 0x47, 0x01), + .name =3D "at25df321a", + .size =3D SZ_4M, .flags =3D SPI_NOR_HAS_LOCK | SPI_NOR_SWP_IS_VOLATILE, .no_sfdp_flags =3D SECT_4K, .fixups =3D &atmel_nor_global_protection_fixups }, { - .id =3D SNOR_ID(0x1f, 0x47, 0x00), - .name =3D "at26df321", - .size =3D SZ_4M, + .id =3D SNOR_ID(0x1f, 0x48, 0x00), + .name =3D "at25df641", + .size =3D SZ_8M, .flags =3D SPI_NOR_HAS_LOCK | SPI_NOR_SWP_IS_VOLATILE, .no_sfdp_flags =3D SECT_4K, .fixups =3D &atmel_nor_global_protection_fixups }, { - .id =3D SNOR_ID(0x1f, 0x25, 0x00), - .name =3D "at45db081d", - .size =3D SZ_1M, + .id =3D SNOR_ID(0x1f, 0x66, 0x01), + .name =3D "at25fs010", + .sector_size =3D SZ_32K, + .size =3D SZ_128K, + .flags =3D SPI_NOR_HAS_LOCK, + .no_sfdp_flags =3D SECT_4K, + .fixups =3D &at25fs_nor_fixups + }, { + .id =3D SNOR_ID(0x1f, 0x66, 0x04), + .name =3D "at25fs040", + .size =3D SZ_512K, + .flags =3D SPI_NOR_HAS_LOCK, .no_sfdp_flags =3D SECT_4K, + .fixups =3D &at25fs_nor_fixups }, }; =20 --=20 2.39.2