From patchwork Tue Mar 28 15:40:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miquel Raynal X-Patchwork-Id: 13191309 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E78A7C6FD18 for ; Tue, 28 Mar 2023 15:42:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=OIY9jQ5V2Of77G4tZJU+lTT6MEsFT3oy/+yYgeQ1enc=; b=zdPeF1UNsFJ3Aa mtpsJqz+5o/Imw5c/hXrG1ufn52OTUPmjhOCRk0QfFv+9WCoC5xUHjoophTEy907VSIdjwouhRZlb U73SNiyphGVZIn8IrlrGIVu6zcd6W4ODa05xtIIT65syVRWumePWFKsQeoQ5wnc8Bt/q+4t3FyGlp ds/X9WZair9wFpMwFYe2fFvE1iFQF3M1nmMu+erbLXMQrgljlcefbJnZO6qnld4CkmaQGXV/GfZks 7MliHRbK6/CxwPYv96Jw1fRvLqZ8PwbHFgEJUueCIlgZGTbsiqFcEgERSlblCvu+8wdTIUpNnHOXg Jr1gJSJ3lV5UcOrCl/eg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1phBRl-00Eyfh-2J; Tue, 28 Mar 2023 15:41:17 +0000 Received: from relay3-d.mail.gandi.net ([217.70.183.195]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1phBRh-00EydH-2w; Tue, 28 Mar 2023 15:41:15 +0000 Received: (Authenticated sender: miquel.raynal@bootlin.com) by mail.gandi.net (Postfix) with ESMTPSA id DF5DB60004; Tue, 28 Mar 2023 15:41:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1680018072; 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: in-reply-to:in-reply-to:references:references; bh=r8+C50L6TyjhDk2JejbiwzuldSIgSHE+w4n/RI9WwcQ=; b=Nge901IZ139UsD3MGuFcxgzpK1cdTGtVkQcwLDDAj4QAr9N9eP5CHfapU0Gpkf4W56xOz4 BwVmhNxj3cdq2wc/wMxWkntcHWZOQSL+bLF9x1f3Tp/Ko2S54h9+7zmpjPuTGC3GtPDn4N j8bHYq9X11cdbKCOR8iABSXQGy/BVN7Z8qZWvOdP+8vNhhkTDxahNSF+ihCSSDFGuzscXv xy6CRZMrAXcR66HaUdY/GecJhhGw229VxhxBeBnfx1eKM8B8Ajs7dG+j+56mMc/MXircOq k1t/8vmPSdRcGFcZykicuA/bbIfQ2pWmVFsbCt6cfLXWaIk1TZZt4dpQ77ARaw== From: Miquel Raynal To: Richard Weinberger , Vignesh Raghavendra , Tudor Ambarus , Pratyush Yadav , Michael Walle , Cc: Julien Su , Jaime Liao , Jaime Liao , Alvin Zhou , Thomas Petazzoni , Michal Simek , , Miquel Raynal Subject: [PATCH v5 2/8] mtd: spi-nor: Add a macro to define more banks Date: Tue, 28 Mar 2023 17:40:59 +0200 Message-Id: <20230328154105.448540-3-miquel.raynal@bootlin.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230328154105.448540-1-miquel.raynal@bootlin.com> References: <20230328154105.448540-1-miquel.raynal@bootlin.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230328_084114_079287_4FEA5E79 X-CRM114-Status: UNSURE ( 7.50 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Most of the chips on the market only feature a single bank. However, new chips may support more than a single bank, with the possibility to parallelize some operations. Let's introduce an INFOB() macro which also takes a n_bank parameter. Signed-off-by: Miquel Raynal Reviewed-by: Pratyush Yadav --- drivers/mtd/spi-nor/core.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/mtd/spi-nor/core.h b/drivers/mtd/spi-nor/core.h index db0e458810c7..bf2e64671856 100644 --- a/drivers/mtd/spi-nor/core.h +++ b/drivers/mtd/spi-nor/core.h @@ -555,6 +555,10 @@ struct flash_info { SPI_NOR_ID((_jedec_id), (_ext_id)), \ SPI_NOR_GEOMETRY((_sector_size), (_n_sectors), 1), +#define INFOB(_jedec_id, _ext_id, _sector_size, _n_sectors, _n_banks) \ + SPI_NOR_ID((_jedec_id), (_ext_id)), \ + SPI_NOR_GEOMETRY((_sector_size), (_n_sectors), (_n_banks)), + #define INFO6(_jedec_id, _ext_id, _sector_size, _n_sectors) \ SPI_NOR_ID6((_jedec_id), (_ext_id)), \ SPI_NOR_GEOMETRY((_sector_size), (_n_sectors), 1),