From nobody Wed Dec 17 10:53:29 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 10C46EE49A5 for ; Tue, 22 Aug 2023 07:13:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233583AbjHVHNY (ORCPT ); Tue, 22 Aug 2023 03:13:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53158 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233436AbjHVHMU (ORCPT ); Tue, 22 Aug 2023 03:12:20 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 66E4710EB for ; Tue, 22 Aug 2023 00:11:53 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 081F3648F5 for ; Tue, 22 Aug 2023 07:10:39 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A92A7C433CB; Tue, 22 Aug 2023 07:10:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1692688238; bh=cvOmQ4r9lT/hD8cobtpM84I53hfGaM55Wi2KKw6QCYM=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=MzdW72jIFXTv2uOfCLOVwgznPeKdO3r7cElkUdw7PcryfmMxKtssCWISkSt48CGeO UE6wOgGDGD9qoUkDoO/a9DerI3iWxcDXRL1Q494uh59uDcbPV++eUEai1cfuUdEXHt CqqGWKYd2KKNpcrw4cflq0nXtHcviCbJpZGPuSbH8TmUi1xxgFAxTG7sge50qpp1KB V60uDXnRAMcc2G4kKNG+GgrPY2myFje2Yn88vse0EvRJAqOXhBknX588WnHiQ69cPc dVtrD9dqQeH28f3Yg7aEszQls8l3S+8kol5jsFEhP+vzGaeml/i325lvHfyVzP0KiQ w/7PRJKmNibSg== From: Michael Walle Date: Tue, 22 Aug 2023 09:09:47 +0200 Subject: [PATCH v2 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-v2-31-291a0f39f8d8@kernel.org> References: <20230807-mtd-flash-info-db-rework-v2-0-291a0f39f8d8@kernel.org> In-Reply-To: <20230807-mtd-flash-info-db-rework-v2-0-291a0f39f8d8@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 --- 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