Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp2407232pxb; Thu, 3 Feb 2022 06:06:41 -0800 (PST) X-Google-Smtp-Source: ABdhPJzT6/rZMsQqr210xYCWz/YYfXZUcdcrJXUjtCSm+vejL4XgkTT5NirAF6VLwySy1BVKZ6KG X-Received: by 2002:a50:8a89:: with SMTP id j9mr35153084edj.111.1643897201282; Thu, 03 Feb 2022 06:06:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643897201; cv=none; d=google.com; s=arc-20160816; b=cDiMfSHxQ8CeAkE4OfV7sADTAY6dlFOP/eGkdWktK4EvuD9KRsEpLkmkg2elBb4zS6 9nkrUPh7/qDdGolSC/ncH4pFgDvSxRV1eBOJj44aKW5EbQy/RKaZjsAvQTWtZKBg52rc CdkvCJ1gTXwY3n1eJGVSn2jZYDH9e7+cxL3vb2ULABTNvV2sHmn+SO7zXtT6OfuGIvnP SSTIgmmrMM3GI9YzE6ddxf3zCiMckx9TIhvVrinYSW63K4iCdoFt03oqNkVOkS2OR71s 055ss9j0YuNHuV+Cbu6e2/WsM0EnKHm0iQXJorgC5U9uQZongJbZorXod08Z02uU/IGi d4NA== 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=TY7Wrnm/WHimiGDX0u4wyobL0QT4VxUa6F+zVTftJjU=; b=DLlaUb8hGL5G0RrBYmanUKpeioPyADHsybPjSi87p2/aqrW5ygwE2UQ0ghXj7+MQ7e wF9rPGIvKRWEV9Vn1JJ1Qb75x1WBHoN2Lcj0Nz0EzRp5YB8Bcx9ClXUQs8yV8hjgqXbV 2AK/m5tuu3nYrakqky6PzSZrTWsro6xwjmDLyuGh8iMau2Hq5RprUmQJPP50HvaUGOmJ 6EIkMomLH2Q38t8TRndb+TLfIqiHBvFZnS/JxYyuxpe3ZsL0PJyHcDS2rtZRXCwUfFmF s6tD8fRlMhR6PR3bBBjXoP+ONcH5p3vepL+lMmNlHjATRAj0nmPnWn4bI0cREC8zd6jn qqDA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@walle.cc header.s=mail2016061301 header.b=DDT5KuEp; 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 dp3si4609845ejc.349.2022.02.03.06.06.14; Thu, 03 Feb 2022 06:06:41 -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=DDT5KuEp; 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 S1345292AbiBBO7G (ORCPT + 99 others); Wed, 2 Feb 2022 09:59:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48936 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237463AbiBBO7D (ORCPT ); Wed, 2 Feb 2022 09:59:03 -0500 Received: from ssl.serverraum.org (ssl.serverraum.org [IPv6:2a01:4f8:151:8464::1:2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EC62AC06173B for ; Wed, 2 Feb 2022 06:59:02 -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 1FEF422247; Wed, 2 Feb 2022 15:59:00 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=walle.cc; s=mail2016061301; t=1643813940; 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=TY7Wrnm/WHimiGDX0u4wyobL0QT4VxUa6F+zVTftJjU=; b=DDT5KuEp90oEdhuX6vaJ9ObisD1ds7fRwJ631WZZMi5Nfls8BVzVxCm+BlQrks0GfOcumZ KONVefzg6JiUyOb9k00p1eMpeMuv9/FBdMq7FByhUAc8Psdwp3k+RcPJLO4OD3tHhOYUQ2 RPKBqB2doec5L8PCCb95n0XvgZ1QD7c= 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 , Michael Walle Subject: [PATCH v1 00/14] mtd: spi-nor: move vendor specific code into vendor modules Date: Wed, 2 Feb 2022 15:58:39 +0100 Message-Id: <20220202145853.4187726-1-michael@walle.cc> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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. Please note that this is only compile-time tested. For sake of consistency and better readability of the code flow, I also converted the setup() callback to be optional. Michael Walle (14): mtd: spi-nor: export more function to be used in vendor modules mtd: spi-nor: slightly refactor the spi_nor_setup() mtd: spi-nor: allow a flash to define its own ready() function 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: fix micron_st prefix 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: renumber flags drivers/mtd/spi-nor/core.c | 265 ++------------------------------ drivers/mtd/spi-nor/core.h | 70 ++++----- drivers/mtd/spi-nor/micron-st.c | 225 ++++++++++++++++++++++----- drivers/mtd/spi-nor/spansion.c | 133 ++++++++++++---- drivers/mtd/spi-nor/xilinx.c | 79 +++++++++- include/linux/mtd/spi-nor.h | 18 --- 6 files changed, 417 insertions(+), 373 deletions(-) -- 2.30.2