Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp3628795pxb; Mon, 21 Feb 2022 02:14:22 -0800 (PST) X-Google-Smtp-Source: ABdhPJxX962JawsEkGK/KvqIdGikjkrZKENIw0oA4aNcKmTCAitSnqGGBWED/R6DToYok47vlq2P X-Received: by 2002:a17:906:a0ce:b0:6d1:cb30:3b3b with SMTP id bh14-20020a170906a0ce00b006d1cb303b3bmr1515811ejb.582.1645438462303; Mon, 21 Feb 2022 02:14:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645438462; cv=none; d=google.com; s=arc-20160816; b=yLsTKn/7LgABAc0H2XTizED8qg7WrBKIDg7yIoG4dq47FAIW0wqIPD5JIsOqkYnxuM JHOFtZsrP4+HDst8SqaVPiKdXZSas/1mABgv5rKLAibk7bgR0tdCRj7Rc5UuS+1VaRGH pRqeTBTwMT2h/GnvEMruoBVigb8pmnI82gr9oQei15x/If/FSLsun5zwMRhA4avOCyV2 fAFh38xhSgeFRaJQ4SIvRzfDOduopNinu3xChF814STa4gTPKurHiAhBL8dWuv/nEy7r BzFQeZlQe3TLKqQWZzHGl97LOqklCMsyKzP3N6GBvtEFsg2iU1HlRAkXrfSLCNpxbMKt /U5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=vhXcIyrYYOOhtTLar2qt08o1kFLd8n5VCrCCKuuqYdg=; b=Mq5n7Om8G60IdpuzviVzQvmtGfmvYDRgSoHtcPQsBZEMuLR/i5qqMvsoK4ZIUEWl+Q OPZNJO118PURNkvPxYFMreoJdoy0IS9AbujWvnmtKSPYToBI1LQBLAfoNo5gPQD3F9A9 kPZmIAYC3dlWiRGd34c5emwgdRX8jOlKF7laRI+/GIFH18Ut9iameT0TrbMHlGDqyC+e jHfDVP6cb+H9cs/VUQR984RJMf07nZZd+Bl+CPR/uSWuhg62X7pdvtT92YYBbmYx3UWS fgXexGeEs+1tp1WvJ+maf9QGRohurkehElZLVCxz/+nt2qz9DttAmwfJwD6tbMDFB+VE zeRw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@walle.cc header.s=mail2016061301 header.b=kEcjqtpR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ck5si10041411edb.0.2022.02.21.02.13.59; Mon, 21 Feb 2022 02:14:22 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@walle.cc header.s=mail2016061301 header.b=kEcjqtpR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345616AbiBUIyJ (ORCPT + 99 others); Mon, 21 Feb 2022 03:54:09 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:44528 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345625AbiBUIxT (ORCPT ); Mon, 21 Feb 2022 03:53:19 -0500 Received: from ssl.serverraum.org (ssl.serverraum.org [176.9.125.105]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1C2FB192B7 for ; Mon, 21 Feb 2022 00:52:48 -0800 (PST) Received: from mwalle01.kontron.local. (unknown [213.135.10.150]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by ssl.serverraum.org (Postfix) with ESMTPSA id 8DF76223E9; Mon, 21 Feb 2022 09:52:43 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=walle.cc; s=mail2016061301; t=1645433565; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=vhXcIyrYYOOhtTLar2qt08o1kFLd8n5VCrCCKuuqYdg=; b=kEcjqtpRny+mV6S0WqzV2adQV+CoG8z2MbrIHVId4XF2SmF11oMU8O/UP13AoNY48BnaHL pJasnkluLLVpQeGUgcf+e6tEjfEHDNz54xOvzq9KYvc9PB9VWNi18FX6CNY2LkZnzT7/1J 4UmmuDAmDM9LL67Y7yv4EupkWa2Dx84= From: Michael Walle To: linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Tudor Ambarus , Pratyush Yadav , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , yaliang.wang@windriver.com, Michael Walle Subject: [PATCH v3 00/32] mtd: spi-nor: move vendor specific code into vendor modules Date: Mon, 21 Feb 2022 09:52:04 +0100 Message-Id: <20220221085236.1452024-1-michael@walle.cc> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org It turns out that most of the special status register handling is specific for a particular vendor. I.e. Xilinx has some different opcodes for the status register read, Micron has an additional FSR register and Spansion has these flags integrated into the SR. Create a callback to ready() where a flash chip can register its own function. This will let us move all the vendor specific stuff out of the core into the vendor modules. As a preparation step, unify all function and object names in the vendor modules. For the sake of consistency and better readability of the code flow, I also converted the setup() callback to be optional. Please note that this is only compile-time tested. Changes since v2: - use family_nor_ instead of just family_ prefix - fix function doc Changes since v1: - rename/unify function names inside the vendor modules. - make local functions static - fix function doc typo - use late_init hook to set fsr_ready op - Use uppercase and period in comments - Add comments for the vendor flags - move coding style change in spi_nor_sr_ready() into own patch - new patch to add missing parenthesis in S3AN_INFO() - add missing function prefix rename patch for the spansion module Michael Walle (32): mtd: spi-nor: atmel: unify function names mtd: spi-nor: catalyst: unify function names mtd: spi-nor: eon: unify function names mtd: spi-nor: esmt: unify function names mtd: spi-nor: everspin: unify function names mtd: spi-nor: fujitsu: unify function names mtd: spi-nor: gigadevice: unify function names mtd: spi-nor: intel: unify function names mtd: spi-nor: issi: unify function names mtd: spi-nor: macronix: unify function names mtd: spi-nor: micron-st: unify function names mtd: spi-nor: spansion: unify function names mtd: spi-nor: sst: unify function names mtd: spi-nor: winbond: unify function names mtd: spi-nor: xilinx: unify function names mtd: spi-nor: xmc: unify function names mtd: spi-nor: slightly refactor the spi_nor_setup() mtd: spi-nor: allow a flash to define its own ready() function mtd: spi-nor: export more function to be used in vendor modules mtd: spi-nor: guard _page_size parameter in S3AN_INFO() mtd: spi-nor: move all xilinx specifics into xilinx.c mtd: spi-nor: xilinx: rename vendor specific functions and defines mtd: spi-nor: xilinx: correct the debug message mtd: spi-nor: move all micron-st specifics into micron-st.c mtd: spi-nor: micron-st: convert USE_FSR to a manufacturer flag mtd: spi-nor: micron-st: rename vendor specific functions and defines mtd: spi-nor: spansion: slightly rework control flow in late_init() mtd: spi-nor: move all spansion specifics into spansion.c mtd: spi-nor: spansion: convert USE_CLSR to a manufacturer flag mtd: spi-nor: spansion: rename vendor specific functions and defines mtd: spi-nor: slightly change code style in spi_nor_sr_ready() mtd: spi-nor: renumber flags drivers/mtd/spi-nor/atmel.c | 81 +++++----- drivers/mtd/spi-nor/catalyst.c | 6 +- drivers/mtd/spi-nor/core.c | 265 ++----------------------------- drivers/mtd/spi-nor/core.h | 70 ++++---- drivers/mtd/spi-nor/eon.c | 6 +- drivers/mtd/spi-nor/esmt.c | 6 +- drivers/mtd/spi-nor/everspin.c | 6 +- drivers/mtd/spi-nor/fujitsu.c | 6 +- drivers/mtd/spi-nor/gigadevice.c | 6 +- drivers/mtd/spi-nor/intel.c | 6 +- drivers/mtd/spi-nor/issi.c | 10 +- drivers/mtd/spi-nor/macronix.c | 14 +- drivers/mtd/spi-nor/micron-st.c | 258 ++++++++++++++++++++++++------ drivers/mtd/spi-nor/spansion.c | 164 ++++++++++++++----- drivers/mtd/spi-nor/sst.c | 44 ++--- drivers/mtd/spi-nor/winbond.c | 29 ++-- drivers/mtd/spi-nor/xilinx.c | 97 +++++++++-- drivers/mtd/spi-nor/xmc.c | 6 +- include/linux/mtd/spi-nor.h | 18 --- 19 files changed, 576 insertions(+), 522 deletions(-) -- 2.30.2