From patchwork Wed Feb 1 11:35:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miquel Raynal X-Patchwork-Id: 13124175 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 28B9FC636D3 for ; Wed, 1 Feb 2023 11:37:37 +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=6MPrADBkAyYvr+vutrOKjVrsL9m8u4V4/dbKKVNZmws=; b=NOQC7+JKpLIxcQ eBB07oUL2P72SWBtIdvgWAAc86iX3OLpJ+h5MYJA/EWOiqZLrYIFEjygK4PW4yoZWqP5eXHCxhmwx eJlW5u8MsmFgCRWsppqUhNg7FiNwTBn5fEzQEwmWtJz2DgMkA+ZhcdsqT9FVNKh6a7cn8SuDMlCqd 39xfWIPoGZmnvB7UFAjmxL8duS1xBeDoAGS+8PODQLd8pctKjxcjJ2FkqF5bB/QlGw5Kj2aoUoFn2 xbpCSZriB85ooa7tFo8R7ZStIwkXvALSlej2swoOWUoOx0tleyZpYokHHDvc8/pZhOFEUFdO7hxDJ N21LetYywyHijDRGl28Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pNBPt-00BVRB-24; Wed, 01 Feb 2023 11:36:41 +0000 Received: from relay10.mail.gandi.net ([217.70.178.230]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pNBPQ-00BVGB-Ba; Wed, 01 Feb 2023 11:36:15 +0000 Received: (Authenticated sender: miquel.raynal@bootlin.com) by mail.gandi.net (Postfix) with ESMTPSA id 55719240011; Wed, 1 Feb 2023 11:36:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1675251370; 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=ZpXajK+kF4YKgVI5i4Ma7QEwo2zNfp/vWhqn4AuxdI4=; b=RfXKZgvLSoufKzUfPEgocalk9e1WuNDlOFzFHuOxFf8n4ZDQvuU/kkCS4OTU0NRtWvLEhJ NpAWF0F4R+ukARAE1kiPF134wO/pu24BRw1pJuG8L+XE17UOvHK/ZnQyDqSGSZ5BKOi4Bn HfT7+OhctCRb3dNdmMQVcf+vs7zy2E8kPV1RZZwIQ4obTRcWyH5iBQ4KzDIvDRUcYOmMOV iIh8iVz3prHa/uDL562SW3TAFL+KvNl1j0WmAV35wBBYKOcBCOylXdxrmHXpqsBjlYUg1c 2UjjDUuFECodlKOJ172f+43PxJ4+eoK+T1i1jJo3N1KIY5ksykm0VTylO4aQQg== 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 v4 2/8] mtd: spi-nor: Add a macro to define more banks Date: Wed, 1 Feb 2023 12:35:57 +0100 Message-Id: <20230201113603.293758-3-miquel.raynal@bootlin.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230201113603.293758-1-miquel.raynal@bootlin.com> References: <20230201113603.293758-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-20230201_033612_566093_6D7981FF X-CRM114-Status: UNSURE ( 7.98 ) 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 768ccd1a5a8a..888a08c37d8c 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),