openbmc.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1 0/3] spi: npcm-fiu: add Arbel NPCM8XX support
@ 2022-07-18  8:11 Tomer Maimon
  2022-07-18  8:11 ` [PATCH v1 1/3] spi: npcm-fiu: Modify direct read dummy configuration Tomer Maimon
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Tomer Maimon @ 2022-07-18  8:11 UTC (permalink / raw)
  To: avifishman70, tali.perry1, joel, venture, yuenn, benjaminfair,
	broonie, robh+dt, krzysztof.kozlowski+dt
  Cc: devicetree, openbmc, Tomer Maimon, linux-kernel, linux-spi

This patch set adds Arbel NPCM8XX Flash Interface Unit (FIU) support to FIU NPCM
driver and modify direct read dummy configuration.

NPCM8XX FIU supports four controllers.

The NPCM FIU driver tested on NPCM845 evaluation board.

Tomer Maimon (3):
  spi: npcm-fiu: Modify direct read dummy configuration
  dt-binding: spi: Add npcm845 compatible to npcm-fiu document
  spi: npcm-fiu: Add NPCM8XX support

 .../bindings/spi/nuvoton,npcm-fiu.txt         | 13 ++++++++-
 drivers/spi/spi-npcm-fiu.c                    | 28 +++++++++++++++++--
 2 files changed, 38 insertions(+), 3 deletions(-)

-- 
2.33.0


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH v1 1/3] spi: npcm-fiu: Modify direct read dummy configuration
  2022-07-18  8:11 [PATCH v1 0/3] spi: npcm-fiu: add Arbel NPCM8XX support Tomer Maimon
@ 2022-07-18  8:11 ` Tomer Maimon
  2022-07-18  8:11 ` [PATCH v1 2/3] dt-binding: spi: Add npcm845 compatible to npcm-fiu document Tomer Maimon
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Tomer Maimon @ 2022-07-18  8:11 UTC (permalink / raw)
  To: avifishman70, tali.perry1, joel, venture, yuenn, benjaminfair,
	broonie, robh+dt, krzysztof.kozlowski+dt
  Cc: devicetree, openbmc, Tomer Maimon, linux-kernel, linux-spi

Modify NPCM BMC FIU direct read dummy configuration that according
spi-mem direct read function.

Signed-off-by: Tomer Maimon <tmaimon77@gmail.com>
---
 drivers/spi/spi-npcm-fiu.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/spi/spi-npcm-fiu.c b/drivers/spi/spi-npcm-fiu.c
index ba67dbed9fb8..d5b4fe7b9b62 100644
--- a/drivers/spi/spi-npcm-fiu.c
+++ b/drivers/spi/spi-npcm-fiu.c
@@ -252,8 +252,7 @@ static void npcm_fiu_set_drd(struct npcm_fiu_spi *fiu,
 	fiu->drd_op.addr.buswidth = op->addr.buswidth;
 	regmap_update_bits(fiu->regmap, NPCM_FIU_DRD_CFG,
 			   NPCM_FIU_DRD_CFG_DBW,
-			   ((op->dummy.nbytes * ilog2(op->addr.buswidth)) / BITS_PER_BYTE)
-			   << NPCM_FIU_DRD_DBW_SHIFT);
+			   op->dummy.nbytes << NPCM_FIU_DRD_DBW_SHIFT);
 	fiu->drd_op.dummy.nbytes = op->dummy.nbytes;
 	regmap_update_bits(fiu->regmap, NPCM_FIU_DRD_CFG,
 			   NPCM_FIU_DRD_CFG_RDCMD, op->cmd.opcode);
-- 
2.33.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH v1 2/3] dt-binding: spi: Add npcm845 compatible to npcm-fiu document
  2022-07-18  8:11 [PATCH v1 0/3] spi: npcm-fiu: add Arbel NPCM8XX support Tomer Maimon
  2022-07-18  8:11 ` [PATCH v1 1/3] spi: npcm-fiu: Modify direct read dummy configuration Tomer Maimon
@ 2022-07-18  8:11 ` Tomer Maimon
  2022-07-18  8:11 ` [PATCH v1 3/3] spi: npcm-fiu: Add NPCM8XX support Tomer Maimon
  2022-07-20 18:07 ` [PATCH v1 0/3] spi: npcm-fiu: add Arbel " Mark Brown
  3 siblings, 0 replies; 5+ messages in thread
From: Tomer Maimon @ 2022-07-18  8:11 UTC (permalink / raw)
  To: avifishman70, tali.perry1, joel, venture, yuenn, benjaminfair,
	broonie, robh+dt, krzysztof.kozlowski+dt
  Cc: devicetree, openbmc, Tomer Maimon, linux-kernel, linux-spi

Add a compatible string and description for Nuvoton BMC NPCM845 FIU.

Signed-off-by: Tomer Maimon <tmaimon77@gmail.com>
---
 .../devicetree/bindings/spi/nuvoton,npcm-fiu.txt    | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/spi/nuvoton,npcm-fiu.txt b/Documentation/devicetree/bindings/spi/nuvoton,npcm-fiu.txt
index a388005842ad..c63ce4cc0a80 100644
--- a/Documentation/devicetree/bindings/spi/nuvoton,npcm-fiu.txt
+++ b/Documentation/devicetree/bindings/spi/nuvoton,npcm-fiu.txt
@@ -6,8 +6,13 @@ The NPCM7XX supports three FIU modules,
 FIU0 and FIUx supports two chip selects,
 FIU3 support four chip select.
 
+The NPCM8XX supports four FIU modules,
+FIU0 and FIUx supports two chip selects,
+FIU1 and FIU3 supports four chip selects.
+
 Required properties:
-  - compatible : "nuvoton,npcm750-fiu" for the NPCM7XX BMC
+  - compatible : "nuvoton,npcm750-fiu" for Poleg NPCM7XX BMC
+			     "nuvoton,npcm845-fiu" for Arbel NPCM8XX BMC
   - #address-cells : should be 1.
   - #size-cells : should be 0.
   - reg : the first contains the register location and length,
@@ -30,6 +35,12 @@ Aliases:
   		fiu1 represent fiu 3 controller
   		fiu2 represent fiu x controller
 
+  In the NPCM8XX BMC:
+  		fiu0 represent fiu 0 controller
+  		fiu1 represent fiu 1 controller
+  		fiu2 represent fiu 3 controller
+  		fiu3 represent fiu x controller
+
 Example:
 fiu3: spi@c00000000 {
 	compatible = "nuvoton,npcm750-fiu";
-- 
2.33.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH v1 3/3] spi: npcm-fiu: Add NPCM8XX support
  2022-07-18  8:11 [PATCH v1 0/3] spi: npcm-fiu: add Arbel NPCM8XX support Tomer Maimon
  2022-07-18  8:11 ` [PATCH v1 1/3] spi: npcm-fiu: Modify direct read dummy configuration Tomer Maimon
  2022-07-18  8:11 ` [PATCH v1 2/3] dt-binding: spi: Add npcm845 compatible to npcm-fiu document Tomer Maimon
@ 2022-07-18  8:11 ` Tomer Maimon
  2022-07-20 18:07 ` [PATCH v1 0/3] spi: npcm-fiu: add Arbel " Mark Brown
  3 siblings, 0 replies; 5+ messages in thread
From: Tomer Maimon @ 2022-07-18  8:11 UTC (permalink / raw)
  To: avifishman70, tali.perry1, joel, venture, yuenn, benjaminfair,
	broonie, robh+dt, krzysztof.kozlowski+dt
  Cc: devicetree, openbmc, Tomer Maimon, linux-kernel, linux-spi

Adding FIU NPCM8XX support to NPCM FIU driver.
NPCM8XX FIU supports four controllers.

As part of adding NPCM8XX support:
- Add NPCM8XX specific compatible string.
- Using an internal burst configuration register instead of a GCR
  register.
- Support FIU1 controller.

Signed-off-by: Tomer Maimon <tmaimon77@gmail.com>
---
 drivers/spi/spi-npcm-fiu.c | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/drivers/spi/spi-npcm-fiu.c b/drivers/spi/spi-npcm-fiu.c
index d5b4fe7b9b62..49f6424e35af 100644
--- a/drivers/spi/spi-npcm-fiu.c
+++ b/drivers/spi/spi-npcm-fiu.c
@@ -36,6 +36,7 @@
 #define NPCM_FIU_UMA_DR1		0x34
 #define NPCM_FIU_UMA_DR2		0x38
 #define NPCM_FIU_UMA_DR3		0x3C
+#define NPCM_FIU_CFG			0x78
 #define NPCM_FIU_MAX_REG_LIMIT		0x80
 
 /* FIU Direct Read Configuration Register */
@@ -151,6 +152,9 @@
 #define NPCM_FIU_UMA_DR3_RB13		GENMASK(15, 8)
 #define NPCM_FIU_UMA_DR3_RB12		GENMASK(7, 0)
 
+/* FIU Configuration Register */
+#define NPCM_FIU_CFG_FIU_FIX		BIT(31)
+
 /* FIU Read Mode */
 enum {
 	DRD_SINGLE_WIRE_MODE	= 0,
@@ -187,6 +191,7 @@ enum {
 	FIU0 = 0,
 	FIU3,
 	FIUX,
+	FIU1,
 };
 
 struct npcm_fiu_info {
@@ -214,6 +219,21 @@ static const struct fiu_data npcm7xx_fiu_data = {
 	.fiu_max = 3,
 };
 
+static const struct npcm_fiu_info npxm8xx_fiu_info[] = {
+	{.name = "FIU0", .fiu_id = FIU0,
+		.max_map_size = MAP_SIZE_128MB, .max_cs = 2},
+	{.name = "FIU3", .fiu_id = FIU3,
+		.max_map_size = MAP_SIZE_128MB, .max_cs = 4},
+	{.name = "FIUX", .fiu_id = FIUX,
+		.max_map_size = MAP_SIZE_16MB, .max_cs = 2},
+	{.name = "FIU1", .fiu_id = FIU1,
+		.max_map_size = MAP_SIZE_16MB, .max_cs = 4} };
+
+static const struct fiu_data npxm8xx_fiu_data = {
+	.npcm_fiu_data_info = npxm8xx_fiu_info,
+	.fiu_max = 4,
+};
+
 struct npcm_fiu_spi;
 
 struct npcm_fiu_chip {
@@ -624,6 +644,10 @@ static int npcm_fiu_dirmap_create(struct spi_mem_dirmap_desc *desc)
 		regmap_update_bits(gcr_regmap, NPCM7XX_INTCR3_OFFSET,
 				   NPCM7XX_INTCR3_FIU_FIX,
 				   NPCM7XX_INTCR3_FIU_FIX);
+	} else {
+		regmap_update_bits(fiu->regmap, NPCM_FIU_CFG,
+				   NPCM_FIU_CFG_FIU_FIX,
+				   NPCM_FIU_CFG_FIU_FIX);
 	}
 
 	if (desc->info.op_tmpl.data.dir == SPI_MEM_DATA_IN) {
@@ -664,6 +688,7 @@ static const struct spi_controller_mem_ops npcm_fiu_mem_ops = {
 
 static const struct of_device_id npcm_fiu_dt_ids[] = {
 	{ .compatible = "nuvoton,npcm750-fiu", .data = &npcm7xx_fiu_data  },
+	{ .compatible = "nuvoton,npcm845-fiu", .data = &npxm8xx_fiu_data  },
 	{ /* sentinel */ }
 };
 
-- 
2.33.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH v1 0/3] spi: npcm-fiu: add Arbel NPCM8XX support
  2022-07-18  8:11 [PATCH v1 0/3] spi: npcm-fiu: add Arbel NPCM8XX support Tomer Maimon
                   ` (2 preceding siblings ...)
  2022-07-18  8:11 ` [PATCH v1 3/3] spi: npcm-fiu: Add NPCM8XX support Tomer Maimon
@ 2022-07-20 18:07 ` Mark Brown
  3 siblings, 0 replies; 5+ messages in thread
From: Mark Brown @ 2022-07-20 18:07 UTC (permalink / raw)
  To: benjaminfair, tali.perry1, robh+dt, krzysztof.kozlowski+dt,
	venture, avifishman70, tmaimon77, yuenn, joel
  Cc: devicetree, openbmc, linux-kernel, linux-spi

On Mon, 18 Jul 2022 11:11:43 +0300, Tomer Maimon wrote:
> This patch set adds Arbel NPCM8XX Flash Interface Unit (FIU) support to FIU NPCM
> driver and modify direct read dummy configuration.
> 
> NPCM8XX FIU supports four controllers.
> 
> The NPCM FIU driver tested on NPCM845 evaluation board.
> 
> [...]

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-next

Thanks!

[1/3] spi: npcm-fiu: Modify direct read dummy configuration
      commit: 7c3193f7890a03fc1b5b979f3f8dc8750ef47b13
[2/3] dt-binding: spi: Add npcm845 compatible to npcm-fiu document
      commit: d50fef8ae939c2b50431fe6a11457e7ff85aea55
[3/3] spi: npcm-fiu: Add NPCM8XX support
      commit: 650b014facca5238e25399f28da1e59747bddb99

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-07-20 18:07 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-18  8:11 [PATCH v1 0/3] spi: npcm-fiu: add Arbel NPCM8XX support Tomer Maimon
2022-07-18  8:11 ` [PATCH v1 1/3] spi: npcm-fiu: Modify direct read dummy configuration Tomer Maimon
2022-07-18  8:11 ` [PATCH v1 2/3] dt-binding: spi: Add npcm845 compatible to npcm-fiu document Tomer Maimon
2022-07-18  8:11 ` [PATCH v1 3/3] spi: npcm-fiu: Add NPCM8XX support Tomer Maimon
2022-07-20 18:07 ` [PATCH v1 0/3] spi: npcm-fiu: add Arbel " Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).