From nobody Sun Sep 7 12:30:59 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 11A58C41513 for ; Mon, 7 Aug 2023 13:23:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234038AbjHGNXe (ORCPT ); Mon, 7 Aug 2023 09:23:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36348 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234083AbjHGNW4 (ORCPT ); Mon, 7 Aug 2023 09:22:56 -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 EA60319AB for ; Mon, 7 Aug 2023 06:22:31 -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 3D5C661AD8 for ; Mon, 7 Aug 2023 13:22:29 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id F08ABC433C8; Mon, 7 Aug 2023 13:22:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1691414548; bh=yRymFxs0ZgCRKKfeCO93P0NNgII3piuTmdoZV/3f5XU=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=olllZq88iDLzskVOUa+X7jTz7y9olhhD4f5hPoUo024ZPQ+f8ncO0seR8aPleWC0K yir906/w5x0AMMX5Bgx6W556jMfHr3bfzwqZPEOM1aFjA9l0ipmr+/hYtbUj0/5TL5 0NS4UmYPv2qO11z5gWwNDDDg2PTe5OaxakeRB0V3jO5jqKz6OCwlQFezcs7tlf8+EB nMeR3u6zp64BZHXHwIfG4KB9s4nXOFPCQ5e8vtMfmXk+kR16l/TvbrJ8SxM4maQAp5 Qi29sox6N/lew8UrQI2+NqsSKgtXCwqytyOkIzITGIGwVJ34OMdkYZ7ubqSm9z/z5R yTFYSDd2uUJWg== From: Michael Walle Date: Mon, 07 Aug 2023 15:21:11 +0200 Subject: [PATCH 17/41] mtd: spi-nor: atmel: convert flash_info to new format MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20230807-mtd-flash-info-db-rework-v1-17-3d3d5bef4ba4@kernel.org> References: <20230807-mtd-flash-info-db-rework-v1-0-3d3d5bef4ba4@kernel.org> In-Reply-To: <20230807-mtd-flash-info-db-rework-v1-0-3d3d5bef4ba4@kernel.org> To: Tudor Ambarus , Pratyush Yadav , Michael Walle , 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 INFOx() macros are going away. Convert the flash_info database to the new format. Signed-off-by: Michael Walle --- drivers/mtd/spi-nor/atmel.c | 122 +++++++++++++++++++++++++++++-----------= ---- 1 file changed, 80 insertions(+), 42 deletions(-) diff --git a/drivers/mtd/spi-nor/atmel.c b/drivers/mtd/spi-nor/atmel.c index d2de2cb0c066..ccc985c48ae3 100644 --- a/drivers/mtd/spi-nor/atmel.c +++ b/drivers/mtd/spi-nor/atmel.c @@ -163,48 +163,86 @@ static const struct spi_nor_fixups atmel_nor_global_p= rotection_fixups =3D { }; =20 static const struct flash_info atmel_nor_parts[] =3D { - { "at25fs010", INFO(0x1f6601, 0, 32 * 1024, 4) - FLAGS(SPI_NOR_HAS_LOCK) - NO_SFDP_FLAGS(SECT_4K) - .fixups =3D &at25fs_nor_fixups }, - { "at25fs040", INFO(0x1f6604, 0, 64 * 1024, 8) - FLAGS(SPI_NOR_HAS_LOCK) - NO_SFDP_FLAGS(SECT_4K) - .fixups =3D &at25fs_nor_fixups }, - { "at25df041a", INFO(0x1f4401, 0, 64 * 1024, 8) - FLAGS(SPI_NOR_HAS_LOCK | SPI_NOR_SWP_IS_VOLATILE) - NO_SFDP_FLAGS(SECT_4K) - .fixups =3D &atmel_nor_global_protection_fixups }, - { "at25df321", INFO(0x1f4700, 0, 64 * 1024, 64) - FLAGS(SPI_NOR_HAS_LOCK | SPI_NOR_SWP_IS_VOLATILE) - NO_SFDP_FLAGS(SECT_4K) - .fixups =3D &atmel_nor_global_protection_fixups }, - { "at25df321a", INFO(0x1f4701, 0, 64 * 1024, 64) - FLAGS(SPI_NOR_HAS_LOCK | SPI_NOR_SWP_IS_VOLATILE) - NO_SFDP_FLAGS(SECT_4K) - .fixups =3D &atmel_nor_global_protection_fixups }, - { "at25df641", INFO(0x1f4800, 0, 64 * 1024, 128) - FLAGS(SPI_NOR_HAS_LOCK | SPI_NOR_SWP_IS_VOLATILE) - NO_SFDP_FLAGS(SECT_4K) - .fixups =3D &atmel_nor_global_protection_fixups }, - { "at25sl321", INFO(0x1f4216, 0, 64 * 1024, 64) - NO_SFDP_FLAGS(SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) }, - { "at26f004", INFO(0x1f0400, 0, 64 * 1024, 8) - NO_SFDP_FLAGS(SECT_4K) }, - { "at26df081a", INFO(0x1f4501, 0, 64 * 1024, 16) - FLAGS(SPI_NOR_HAS_LOCK | SPI_NOR_SWP_IS_VOLATILE) - NO_SFDP_FLAGS(SECT_4K) - .fixups =3D &atmel_nor_global_protection_fixups }, - { "at26df161a", INFO(0x1f4601, 0, 64 * 1024, 32) - FLAGS(SPI_NOR_HAS_LOCK | SPI_NOR_SWP_IS_VOLATILE) - NO_SFDP_FLAGS(SECT_4K) - .fixups =3D &atmel_nor_global_protection_fixups }, - { "at26df321", INFO(0x1f4700, 0, 64 * 1024, 64) - FLAGS(SPI_NOR_HAS_LOCK | SPI_NOR_SWP_IS_VOLATILE) - NO_SFDP_FLAGS(SECT_4K) - .fixups =3D &atmel_nor_global_protection_fixups }, - { "at45db081d", INFO(0x1f2500, 0, 64 * 1024, 16) - NO_SFDP_FLAGS(SECT_4K) }, + { + .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 + }, { + .id =3D SNOR_ID(0x1f, 0x44, 0x01), + .name =3D "at25df041a", + .size =3D SZ_512K, + .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 "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, 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, 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, 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, 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, + .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, + .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, + .no_sfdp_flags =3D SECT_4K, + }, }; =20 const struct spi_nor_manufacturer spi_nor_atmel =3D { --=20 2.39.2