From nobody Mon Sep 8 07:55:25 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 DAE67EE57F2 for ; Fri, 8 Sep 2023 10:18:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242852AbjIHKSZ (ORCPT ); Fri, 8 Sep 2023 06:18:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56758 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236689AbjIHKSX (ORCPT ); Fri, 8 Sep 2023 06:18:23 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 846AE1FDF for ; Fri, 8 Sep 2023 03:17:46 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A927CC433AB; Fri, 8 Sep 2023 10:17:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1694168246; bh=FnqvsVEt1dn/8eNY7lxm1PrsElAnzNiLYIyWKyfbLlM=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=PfOHdxLRuyqF4IMhUuLmd2Fm1iCkHei5B6lUDIoc0QQu7BmrP8jmoRxL1PdDFk7Bx 889oYgru8+d90rDg7QFLMjskP6xtFeMOiIizFT0N8nM4zCtbWRRuAkHxadcX92acea inqqeVPeZV1zIRAeBlZ75tAP7Cnfh77oxIxdE1OGPYKQ/okbsTRUMj+q7n0zGHyy5Z dxqwboxmRSLIszCjKqC1hxFhm0GI+AW2sVu9mLtn4VIkm/eObMo+aRhJLVafO86mPF e3CBciuqwbtULwEtVeNEHazTYGpIQBLeMfaWTQD3QKlq6xjzL5jYsjMHEYERedmZf9 jOJ2UXLaelsNQ== From: Michael Walle Date: Fri, 08 Sep 2023 12:16:45 +0200 Subject: [PATCH v3 27/41] mtd: spi-nor: sst: 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-v3-27-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 INFOx() macros are going away. Convert the flash_info database to the new format. Signed-off-by: Michael Walle --- drivers/mtd/spi-nor/sst.c | 162 +++++++++++++++++++++++++++++-------------= ---- 1 file changed, 104 insertions(+), 58 deletions(-) diff --git a/drivers/mtd/spi-nor/sst.c b/drivers/mtd/spi-nor/sst.c index 1e06c6841a18..77b271abd342 100644 --- a/drivers/mtd/spi-nor/sst.c +++ b/drivers/mtd/spi-nor/sst.c @@ -61,64 +61,110 @@ static const struct spi_nor_fixups sst26vf_nor_fixups = =3D { }; =20 static const struct flash_info sst_nor_parts[] =3D { - { "sst25vf040b", INFO(0xbf258d, 0, 64 * 1024, 8) - FLAGS(SPI_NOR_HAS_LOCK | SPI_NOR_SWP_IS_VOLATILE) - NO_SFDP_FLAGS(SECT_4K) - MFR_FLAGS(SST_WRITE) }, - { "sst25vf080b", INFO(0xbf258e, 0, 64 * 1024, 16) - FLAGS(SPI_NOR_HAS_LOCK | SPI_NOR_SWP_IS_VOLATILE) - NO_SFDP_FLAGS(SECT_4K) - MFR_FLAGS(SST_WRITE) }, - { "sst25vf016b", INFO(0xbf2541, 0, 64 * 1024, 32) - FLAGS(SPI_NOR_HAS_LOCK | SPI_NOR_SWP_IS_VOLATILE) - NO_SFDP_FLAGS(SECT_4K) - MFR_FLAGS(SST_WRITE) }, - { "sst25vf032b", INFO(0xbf254a, 0, 64 * 1024, 64) - FLAGS(SPI_NOR_HAS_LOCK | SPI_NOR_SWP_IS_VOLATILE) - NO_SFDP_FLAGS(SECT_4K) - MFR_FLAGS(SST_WRITE) }, - { "sst25vf064c", INFO(0xbf254b, 0, 64 * 1024, 128) - FLAGS(SPI_NOR_HAS_LOCK | SPI_NOR_4BIT_BP | - SPI_NOR_SWP_IS_VOLATILE) - NO_SFDP_FLAGS(SECT_4K) }, - { "sst25wf512", INFO(0xbf2501, 0, 64 * 1024, 1) - FLAGS(SPI_NOR_HAS_LOCK | SPI_NOR_SWP_IS_VOLATILE) - NO_SFDP_FLAGS(SECT_4K) - MFR_FLAGS(SST_WRITE) }, - { "sst25wf010", INFO(0xbf2502, 0, 64 * 1024, 2) - FLAGS(SPI_NOR_HAS_LOCK | SPI_NOR_SWP_IS_VOLATILE) - NO_SFDP_FLAGS(SECT_4K) - MFR_FLAGS(SST_WRITE) }, - { "sst25wf020", INFO(0xbf2503, 0, 64 * 1024, 4) - FLAGS(SPI_NOR_HAS_LOCK | SPI_NOR_SWP_IS_VOLATILE) - NO_SFDP_FLAGS(SECT_4K) - MFR_FLAGS(SST_WRITE) }, - { "sst25wf020a", INFO(0x621612, 0, 64 * 1024, 4) - FLAGS(SPI_NOR_HAS_LOCK) - NO_SFDP_FLAGS(SECT_4K) }, - { "sst25wf040b", INFO(0x621613, 0, 64 * 1024, 8) - FLAGS(SPI_NOR_HAS_LOCK) - NO_SFDP_FLAGS(SECT_4K) }, - { "sst25wf040", INFO(0xbf2504, 0, 64 * 1024, 8) - FLAGS(SPI_NOR_HAS_LOCK | SPI_NOR_SWP_IS_VOLATILE) - NO_SFDP_FLAGS(SECT_4K) - MFR_FLAGS(SST_WRITE) }, - { "sst25wf080", INFO(0xbf2505, 0, 64 * 1024, 16) - FLAGS(SPI_NOR_HAS_LOCK | SPI_NOR_SWP_IS_VOLATILE) - NO_SFDP_FLAGS(SECT_4K) - MFR_FLAGS(SST_WRITE) }, - { "sst26wf016b", INFO(0xbf2651, 0, 64 * 1024, 32) - NO_SFDP_FLAGS(SECT_4K | SPI_NOR_DUAL_READ | - SPI_NOR_QUAD_READ) }, - { "sst26vf016b", INFO(0xbf2641, 0, 64 * 1024, 32) - NO_SFDP_FLAGS(SECT_4K | SPI_NOR_DUAL_READ) }, - { "sst26vf032b", INFO(0xbf2642, 0, 0, 0) - FLAGS(SPI_NOR_HAS_LOCK | SPI_NOR_SWP_IS_VOLATILE) - .fixups =3D &sst26vf_nor_fixups }, - { "sst26vf064b", INFO(0xbf2643, 0, 64 * 1024, 128) - FLAGS(SPI_NOR_HAS_LOCK | SPI_NOR_SWP_IS_VOLATILE) - NO_SFDP_FLAGS(SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) - .fixups =3D &sst26vf_nor_fixups }, + { + .id =3D SNOR_ID(0xbf, 0x25, 0x8d), + .name =3D "sst25vf040b", + .size =3D SZ_512K, + .flags =3D SPI_NOR_HAS_LOCK | SPI_NOR_SWP_IS_VOLATILE, + .no_sfdp_flags =3D SECT_4K, + .mfr_flags =3D SST_WRITE, + }, { + .id =3D SNOR_ID(0xbf, 0x25, 0x8e), + .name =3D "sst25vf080b", + .size =3D SZ_1M, + .flags =3D SPI_NOR_HAS_LOCK | SPI_NOR_SWP_IS_VOLATILE, + .no_sfdp_flags =3D SECT_4K, + .mfr_flags =3D SST_WRITE, + }, { + .id =3D SNOR_ID(0xbf, 0x25, 0x41), + .name =3D "sst25vf016b", + .size =3D SZ_2M, + .flags =3D SPI_NOR_HAS_LOCK | SPI_NOR_SWP_IS_VOLATILE, + .no_sfdp_flags =3D SECT_4K, + .mfr_flags =3D SST_WRITE, + }, { + .id =3D SNOR_ID(0xbf, 0x25, 0x4a), + .name =3D "sst25vf032b", + .size =3D SZ_4M, + .flags =3D SPI_NOR_HAS_LOCK | SPI_NOR_SWP_IS_VOLATILE, + .no_sfdp_flags =3D SECT_4K, + .mfr_flags =3D SST_WRITE, + }, { + .id =3D SNOR_ID(0xbf, 0x25, 0x4b), + .name =3D "sst25vf064c", + .size =3D SZ_8M, + .flags =3D SPI_NOR_HAS_LOCK | SPI_NOR_4BIT_BP | SPI_NOR_SWP_IS_VOLATILE, + .no_sfdp_flags =3D SECT_4K, + }, { + .id =3D SNOR_ID(0xbf, 0x25, 0x01), + .name =3D "sst25wf512", + .size =3D SZ_64K, + .flags =3D SPI_NOR_HAS_LOCK | SPI_NOR_SWP_IS_VOLATILE, + .no_sfdp_flags =3D SECT_4K, + .mfr_flags =3D SST_WRITE, + }, { + .id =3D SNOR_ID(0xbf, 0x25, 0x02), + .name =3D "sst25wf010", + .size =3D SZ_128K, + .flags =3D SPI_NOR_HAS_LOCK | SPI_NOR_SWP_IS_VOLATILE, + .no_sfdp_flags =3D SECT_4K, + .mfr_flags =3D SST_WRITE, + }, { + .id =3D SNOR_ID(0xbf, 0x25, 0x03), + .name =3D "sst25wf020", + .size =3D SZ_256K, + .flags =3D SPI_NOR_HAS_LOCK | SPI_NOR_SWP_IS_VOLATILE, + .no_sfdp_flags =3D SECT_4K, + .mfr_flags =3D SST_WRITE, + }, { + .id =3D SNOR_ID(0x62, 0x16, 0x12), + .name =3D "sst25wf020a", + .size =3D SZ_256K, + .flags =3D SPI_NOR_HAS_LOCK, + .no_sfdp_flags =3D SECT_4K, + }, { + .id =3D SNOR_ID(0x62, 0x16, 0x13), + .name =3D "sst25wf040b", + .size =3D SZ_512K, + .flags =3D SPI_NOR_HAS_LOCK, + .no_sfdp_flags =3D SECT_4K, + }, { + .id =3D SNOR_ID(0xbf, 0x25, 0x04), + .name =3D "sst25wf040", + .size =3D SZ_512K, + .flags =3D SPI_NOR_HAS_LOCK | SPI_NOR_SWP_IS_VOLATILE, + .no_sfdp_flags =3D SECT_4K, + .mfr_flags =3D SST_WRITE, + }, { + .id =3D SNOR_ID(0xbf, 0x25, 0x05), + .name =3D "sst25wf080", + .size =3D SZ_1M, + .flags =3D SPI_NOR_HAS_LOCK | SPI_NOR_SWP_IS_VOLATILE, + .no_sfdp_flags =3D SECT_4K, + .mfr_flags =3D SST_WRITE, + }, { + .id =3D SNOR_ID(0xbf, 0x26, 0x51), + .name =3D "sst26wf016b", + .size =3D SZ_2M, + .no_sfdp_flags =3D SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ, + }, { + .id =3D SNOR_ID(0xbf, 0x26, 0x41), + .name =3D "sst26vf016b", + .size =3D SZ_2M, + .no_sfdp_flags =3D SECT_4K | SPI_NOR_DUAL_READ, + }, { + .id =3D SNOR_ID(0xbf, 0x26, 0x42), + .name =3D "sst26vf032b", + .flags =3D SPI_NOR_HAS_LOCK | SPI_NOR_SWP_IS_VOLATILE, + .fixups =3D &sst26vf_nor_fixups, + }, { + .id =3D SNOR_ID(0xbf, 0x26, 0x43), + .name =3D "sst26vf064b", + .size =3D SZ_8M, + .flags =3D SPI_NOR_HAS_LOCK | SPI_NOR_SWP_IS_VOLATILE, + .no_sfdp_flags =3D SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ, + .fixups =3D &sst26vf_nor_fixups, + } }; =20 static int sst_nor_write(struct mtd_info *mtd, loff_t to, size_t len, --=20 2.39.2