linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/11] add support for sam9x60 nand controller
@ 2019-02-13  8:59 Tudor.Ambarus
  2019-02-13  8:59 ` [PATCH 01/11] ARM: at91: add sam9x60 SFR definitions Tudor.Ambarus
                   ` (11 more replies)
  0 siblings, 12 replies; 22+ messages in thread
From: Tudor.Ambarus @ 2019-02-13  8:59 UTC (permalink / raw)
  To: robh+dt, mark.rutland, Nicolas.Ferre, alexandre.belloni,
	Ludovic.Desroches, dwmw2, computersforpeace, bbrezillon,
	marek.vasut, richard, miquel.raynal, lee.jones
  Cc: devicetree, linux-arm-kernel, linux-kernel, linux-mtd, Tudor.Ambarus

From: Tudor Ambarus <tudor.ambarus@microchip.com>

The sam9x60 board defines the CCFG_EBICSA register under SFR,
and not as a MATRIX register, as previous boards do.
NAND Flash I/Os are connected to D16–D23, thus
SFR_CCFG_EBICSA.NFD0_ON_D16 is set to 1.

Tested using mtd-utils.

- patches [1, 7] add support for the sam9x60 nand controller. I would
  suggest to get them through linux-mtd tree, if all agree.
- patch 8 can be taken by Alexandre
- patch 9 - SPDX change, can be taken by Lee
- patch 10 - SPDX change, can be taken by Alexandre
- patch 11 - SPDX change, should go through linux-mtd

dt compatible string for "microchip,sam9x60-sfr" has already been
submited at https://patchwork.kernel.org/patch/10799831/

Tudor Ambarus (11):
  ARM: at91: add sam9x60 SFR definitions
  memory: atmel-ebi: add generic name for ebi regmap
  dt-bindings: memory: atmel-ebi: add sam9x60 compatible
  memory: atmel-ebi: add sam9x60 EBI support
  mtd: rawnand: atmel: add generic name for EBICSA regmap
  dt-bindings: mtd: atmel-nand: add sam9x60 compatible
  mtd: rawnand: atmel: add sam9x60 nand controller support
  memory: atmel-ebi: move NUM_CS definition inside atmel-ebi
  mfd: syscon: atmel: switch to SPDX license identifiers
  memory: atmel-ebi: switch to SPDX license identifiers
  mtd: rawnand: atmel: switch to SPDX license identifiers

 .../bindings/memory-controllers/atmel,ebi.txt      |   1 +
 .../devicetree/bindings/mtd/atmel-nand.txt         |   1 +
 drivers/memory/atmel-ebi.c                         |  48 ++++++---
 drivers/mtd/nand/raw/atmel/nand-controller.c       | 117 ++++++++++++++++-----
 drivers/mtd/nand/raw/atmel/pmecc.c                 |   5 +-
 drivers/mtd/nand/raw/atmel/pmecc.h                 |   6 +-
 include/linux/mfd/syscon/atmel-matrix.h            |   7 +-
 include/linux/mfd/syscon/atmel-mc.h                |   6 +-
 include/linux/mfd/syscon/atmel-smc.h               |   5 +-
 include/linux/mfd/syscon/atmel-st.h                |   6 +-
 include/soc/at91/atmel-sfr.h                       |  34 ++++--
 11 files changed, 161 insertions(+), 75 deletions(-)

-- 
2.9.5


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

* [PATCH 01/11] ARM: at91: add sam9x60 SFR definitions
  2019-02-13  8:59 [PATCH 00/11] add support for sam9x60 nand controller Tudor.Ambarus
@ 2019-02-13  8:59 ` Tudor.Ambarus
  2019-02-13 10:52   ` Alexandre Belloni
  2019-02-13  8:59 ` [PATCH 02/11] memory: atmel-ebi: add generic name for ebi regmap Tudor.Ambarus
                   ` (10 subsequent siblings)
  11 siblings, 1 reply; 22+ messages in thread
From: Tudor.Ambarus @ 2019-02-13  8:59 UTC (permalink / raw)
  To: robh+dt, mark.rutland, Nicolas.Ferre, alexandre.belloni,
	Ludovic.Desroches, dwmw2, computersforpeace, bbrezillon,
	marek.vasut, richard, miquel.raynal, lee.jones
  Cc: devicetree, linux-arm-kernel, linux-kernel, linux-mtd, Tudor.Ambarus

From: Tudor Ambarus <tudor.ambarus@microchip.com>

Keep generic names, as there are no conflicts with previous
SFR definitions.

While touching bits, update AT91_OHCIICR_USB_SUSPEND to use
GENMASK, replace unused AT91_OHCIICR_SUSPEND_A/B/C with a more
generic macro, align values on tab-width.

Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
---
 include/soc/at91/atmel-sfr.h | 34 +++++++++++++++++++++++++++-------
 1 file changed, 27 insertions(+), 7 deletions(-)

diff --git a/include/soc/at91/atmel-sfr.h b/include/soc/at91/atmel-sfr.h
index 482337af06b8..532fd784e86c 100644
--- a/include/soc/at91/atmel-sfr.h
+++ b/include/soc/at91/atmel-sfr.h
@@ -14,21 +14,41 @@
 #define _LINUX_MFD_SYSCON_ATMEL_SFR_H
 
 #define AT91_SFR_DDRCFG		0x04	/* DDR Configuration Register */
+#define AT91_SFR_CCFG_EBICSA	0x04	/* EBI Chip Select Register */
 /* 0x08 ~ 0x0c: Reserved */
 #define AT91_SFR_OHCIICR	0x10	/* OHCI INT Configuration Register */
 #define AT91_SFR_OHCIISR	0x14	/* OHCI INT Status Register */
 #define AT91_SFR_UTMICKTRIM	0x30	/* UTMI Clock Trimming Register */
+#define AT91_SFR_UTMISWAP	0x3c	/* UTMI DP/DM Pin Swapping Register */
+#define AT91_SFR_LS		0x7c	/* Light Sleep Register */
 #define AT91_SFR_I2SCLKSEL	0x90	/* I2SC Register */
+#define AT91_SFR_WPMR		0xe4	/* Write Protection Mode Register */
 
 /* Field definitions */
-#define AT91_OHCIICR_SUSPEND_A	BIT(8)
-#define AT91_OHCIICR_SUSPEND_B	BIT(9)
-#define AT91_OHCIICR_SUSPEND_C	BIT(10)
+#define AT91_SFR_CCFG_EBI_CSA(cs, val)		((val) << (cs))
+#define AT91_SFR_CCFG_EBI_DBPUC			BIT(8)
+#define AT91_SFR_CCFG_EBI_DBPDC			BIT(9)
+#define AT91_SFR_CCFG_EBI_DRIVE			BIT(17)
+#define AT91_SFR_CCFG_NFD0_ON_D16		BIT(24)
+#define AT91_SFR_CCFG_DDR_MP_EN			BIT(25)
 
-#define AT91_OHCIICR_USB_SUSPEND	(AT91_OHCIICR_SUSPEND_A | \
-					 AT91_OHCIICR_SUSPEND_B | \
-					 AT91_OHCIICR_SUSPEND_C)
+#define AT91_SFR_OHCIICR_RES(x)			BIT(x)
+#define AT91_SFR_OHCIICR_ARIE			BIT(4)
+#define AT91_SFR_OHCIICR_APPSTART		BIT(5)
+#define AT91_SFR_OHCIICR_USB_SUSP(x)		BIT(8 + (x))
+#define AT91_SFR_OHCIICR_UDPPUDIS		BIT(23)
+#define AT91_OHCIICR_USB_SUSPEND		GENMASK(10, 8)
 
-#define AT91_UTMICKTRIM_FREQ	GENMASK(1, 0)
+#define AT91_SFR_OHCIISR_RIS(x)			BIT(x)
+
+#define AT91_UTMICKTRIM_FREQ			GENMASK(1, 0)
+
+#define AT91_SFR_UTMISWAP_PORT(x)		BIT(x)
+
+#define AT91_SFR_LS_VALUE(x)			BIT(x)
+#define AT91_SFR_LS_MEM_POWER_GATING_ULP1_EN	BIT(16)
+
+#define AT91_SFR_WPMR_WPEN			BIT(0)
+#define AT91_SFR_WPMR_WPKEY_MASK		GENMASK(31, 8)
 
 #endif /* _LINUX_MFD_SYSCON_ATMEL_SFR_H */
-- 
2.9.5


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

* [PATCH 02/11] memory: atmel-ebi: add generic name for ebi regmap
  2019-02-13  8:59 [PATCH 00/11] add support for sam9x60 nand controller Tudor.Ambarus
  2019-02-13  8:59 ` [PATCH 01/11] ARM: at91: add sam9x60 SFR definitions Tudor.Ambarus
@ 2019-02-13  8:59 ` Tudor.Ambarus
  2019-02-13 10:53   ` Alexandre Belloni
  2019-02-13  8:59 ` [PATCH 03/11] dt-bindings: memory: atmel-ebi: add sam9x60 compatible Tudor.Ambarus
                   ` (9 subsequent siblings)
  11 siblings, 1 reply; 22+ messages in thread
From: Tudor.Ambarus @ 2019-02-13  8:59 UTC (permalink / raw)
  To: robh+dt, mark.rutland, Nicolas.Ferre, alexandre.belloni,
	Ludovic.Desroches, dwmw2, computersforpeace, bbrezillon,
	marek.vasut, richard, miquel.raynal, lee.jones
  Cc: devicetree, linux-arm-kernel, linux-kernel, linux-mtd, Tudor.Ambarus

From: Tudor Ambarus <tudor.ambarus@microchip.com>

The sam9x60 board defines the CCFG_EBICSA register under SFR,
and not as a MATRIX register, as previous boards do. Add a
more generic name for the EBI regmap as a prerequisite for
sam9x60 ebi support.

Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
---
 drivers/memory/atmel-ebi.c | 23 ++++++++++++++++-------
 1 file changed, 16 insertions(+), 7 deletions(-)

diff --git a/drivers/memory/atmel-ebi.c b/drivers/memory/atmel-ebi.c
index c3748b414c27..b45914cfa212 100644
--- a/drivers/memory/atmel-ebi.c
+++ b/drivers/memory/atmel-ebi.c
@@ -36,6 +36,7 @@ struct atmel_ebi_dev {
 struct atmel_ebi_caps {
 	unsigned int available_cs;
 	unsigned int ebi_csa_offs;
+	const char *regmap_name;
 	void (*get_config)(struct atmel_ebi_dev *ebid,
 			   struct atmel_ebi_dev_config *conf);
 	int (*xlate_config)(struct atmel_ebi_dev *ebid,
@@ -47,7 +48,7 @@ struct atmel_ebi_caps {
 
 struct atmel_ebi {
 	struct clk *clk;
-	struct regmap *matrix;
+	struct regmap *regmap;
 	struct  {
 		struct regmap *regmap;
 		struct clk *clk;
@@ -357,7 +358,7 @@ static int atmel_ebi_dev_setup(struct atmel_ebi *ebi, struct device_node *np,
 		 * one "atmel,smc-" property is present.
 		 */
 		if (ebi->caps->ebi_csa_offs && apply)
-			regmap_update_bits(ebi->matrix,
+			regmap_update_bits(ebi->regmap,
 					   ebi->caps->ebi_csa_offs,
 					   BIT(cs), 0);
 
@@ -372,6 +373,7 @@ static int atmel_ebi_dev_setup(struct atmel_ebi *ebi, struct device_node *np,
 static const struct atmel_ebi_caps at91sam9260_ebi_caps = {
 	.available_cs = 0xff,
 	.ebi_csa_offs = AT91SAM9260_MATRIX_EBICSA,
+	.regmap_name = "atmel,matrix",
 	.get_config = at91sam9_ebi_get_config,
 	.xlate_config = atmel_ebi_xslate_smc_config,
 	.apply_config = at91sam9_ebi_apply_config,
@@ -380,6 +382,7 @@ static const struct atmel_ebi_caps at91sam9260_ebi_caps = {
 static const struct atmel_ebi_caps at91sam9261_ebi_caps = {
 	.available_cs = 0xff,
 	.ebi_csa_offs = AT91SAM9261_MATRIX_EBICSA,
+	.regmap_name = "atmel,matrix",
 	.get_config = at91sam9_ebi_get_config,
 	.xlate_config = atmel_ebi_xslate_smc_config,
 	.apply_config = at91sam9_ebi_apply_config,
@@ -388,6 +391,7 @@ static const struct atmel_ebi_caps at91sam9261_ebi_caps = {
 static const struct atmel_ebi_caps at91sam9263_ebi0_caps = {
 	.available_cs = 0x3f,
 	.ebi_csa_offs = AT91SAM9263_MATRIX_EBI0CSA,
+	.regmap_name = "atmel,matrix",
 	.get_config = at91sam9_ebi_get_config,
 	.xlate_config = atmel_ebi_xslate_smc_config,
 	.apply_config = at91sam9_ebi_apply_config,
@@ -396,6 +400,7 @@ static const struct atmel_ebi_caps at91sam9263_ebi0_caps = {
 static const struct atmel_ebi_caps at91sam9263_ebi1_caps = {
 	.available_cs = 0x7,
 	.ebi_csa_offs = AT91SAM9263_MATRIX_EBI1CSA,
+	.regmap_name = "atmel,matrix",
 	.get_config = at91sam9_ebi_get_config,
 	.xlate_config = atmel_ebi_xslate_smc_config,
 	.apply_config = at91sam9_ebi_apply_config,
@@ -404,6 +409,7 @@ static const struct atmel_ebi_caps at91sam9263_ebi1_caps = {
 static const struct atmel_ebi_caps at91sam9rl_ebi_caps = {
 	.available_cs = 0x3f,
 	.ebi_csa_offs = AT91SAM9RL_MATRIX_EBICSA,
+	.regmap_name = "atmel,matrix",
 	.get_config = at91sam9_ebi_get_config,
 	.xlate_config = atmel_ebi_xslate_smc_config,
 	.apply_config = at91sam9_ebi_apply_config,
@@ -412,6 +418,7 @@ static const struct atmel_ebi_caps at91sam9rl_ebi_caps = {
 static const struct atmel_ebi_caps at91sam9g45_ebi_caps = {
 	.available_cs = 0x3f,
 	.ebi_csa_offs = AT91SAM9G45_MATRIX_EBICSA,
+	.regmap_name = "atmel,matrix",
 	.get_config = at91sam9_ebi_get_config,
 	.xlate_config = atmel_ebi_xslate_smc_config,
 	.apply_config = at91sam9_ebi_apply_config,
@@ -420,6 +427,7 @@ static const struct atmel_ebi_caps at91sam9g45_ebi_caps = {
 static const struct atmel_ebi_caps at91sam9x5_ebi_caps = {
 	.available_cs = 0x3f,
 	.ebi_csa_offs = AT91SAM9X5_MATRIX_EBICSA,
+	.regmap_name = "atmel,matrix",
 	.get_config = at91sam9_ebi_get_config,
 	.xlate_config = atmel_ebi_xslate_smc_config,
 	.apply_config = at91sam9_ebi_apply_config,
@@ -543,13 +551,14 @@ static int atmel_ebi_probe(struct platform_device *pdev)
 
 	/*
 	 * The sama5d3 does not provide an EBICSA register and thus does need
-	 * to access the matrix registers.
+	 * to access it.
 	 */
 	if (ebi->caps->ebi_csa_offs) {
-		ebi->matrix =
-			syscon_regmap_lookup_by_phandle(np, "atmel,matrix");
-		if (IS_ERR(ebi->matrix))
-			return PTR_ERR(ebi->matrix);
+		ebi->regmap =
+			syscon_regmap_lookup_by_phandle(np,
+							ebi->caps->regmap_name);
+		if (IS_ERR(ebi->regmap))
+			return PTR_ERR(ebi->regmap);
 	}
 
 	ret = of_property_read_u32(np, "#address-cells", &val);
-- 
2.9.5


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

* [PATCH 03/11] dt-bindings: memory: atmel-ebi: add sam9x60 compatible
  2019-02-13  8:59 [PATCH 00/11] add support for sam9x60 nand controller Tudor.Ambarus
  2019-02-13  8:59 ` [PATCH 01/11] ARM: at91: add sam9x60 SFR definitions Tudor.Ambarus
  2019-02-13  8:59 ` [PATCH 02/11] memory: atmel-ebi: add generic name for ebi regmap Tudor.Ambarus
@ 2019-02-13  8:59 ` Tudor.Ambarus
  2019-02-13 10:53   ` Alexandre Belloni
  2019-02-28 18:24   ` Rob Herring
  2019-02-13  8:59 ` [PATCH 04/11] memory: atmel-ebi: add sam9x60 EBI support Tudor.Ambarus
                   ` (8 subsequent siblings)
  11 siblings, 2 replies; 22+ messages in thread
From: Tudor.Ambarus @ 2019-02-13  8:59 UTC (permalink / raw)
  To: robh+dt, mark.rutland, Nicolas.Ferre, alexandre.belloni,
	Ludovic.Desroches, dwmw2, computersforpeace, bbrezillon,
	marek.vasut, richard, miquel.raynal, lee.jones
  Cc: devicetree, linux-arm-kernel, linux-kernel, linux-mtd, Tudor.Ambarus

From: Tudor Ambarus <tudor.ambarus@microchip.com>

Add compatibility string for the sam9x60 EBI.

Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
---
 Documentation/devicetree/bindings/memory-controllers/atmel,ebi.txt | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/memory-controllers/atmel,ebi.txt b/Documentation/devicetree/bindings/memory-controllers/atmel,ebi.txt
index 9bb5f57e2066..94bf7896a688 100644
--- a/Documentation/devicetree/bindings/memory-controllers/atmel,ebi.txt
+++ b/Documentation/devicetree/bindings/memory-controllers/atmel,ebi.txt
@@ -15,6 +15,7 @@ Required properties:
 			"atmel,at91sam9g45-ebi"
 			"atmel,at91sam9x5-ebi"
 			"atmel,sama5d3-ebi"
+			"microchip,sam9x60-ebi"
 
 - reg:			Contains offset/length value for EBI memory mapping.
 			This property might contain several entries if the EBI
-- 
2.9.5


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

* [PATCH 04/11] memory: atmel-ebi: add sam9x60 EBI support
  2019-02-13  8:59 [PATCH 00/11] add support for sam9x60 nand controller Tudor.Ambarus
                   ` (2 preceding siblings ...)
  2019-02-13  8:59 ` [PATCH 03/11] dt-bindings: memory: atmel-ebi: add sam9x60 compatible Tudor.Ambarus
@ 2019-02-13  8:59 ` Tudor.Ambarus
  2019-02-13 10:54   ` Alexandre Belloni
  2019-02-13  8:59 ` [PATCH 05/11] mtd: rawnand: atmel: add generic name for EBICSA regmap Tudor.Ambarus
                   ` (7 subsequent siblings)
  11 siblings, 1 reply; 22+ messages in thread
From: Tudor.Ambarus @ 2019-02-13  8:59 UTC (permalink / raw)
  To: robh+dt, mark.rutland, Nicolas.Ferre, alexandre.belloni,
	Ludovic.Desroches, dwmw2, computersforpeace, bbrezillon,
	marek.vasut, richard, miquel.raynal, lee.jones
  Cc: devicetree, linux-arm-kernel, linux-kernel, linux-mtd, Tudor.Ambarus

From: Tudor Ambarus <tudor.ambarus@microchip.com>

The sam9x60 board defines the CCFG_EBICSA register under SFR,
and not as a MATRIX register, as previous boards do.

Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
---
 drivers/memory/atmel-ebi.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/drivers/memory/atmel-ebi.c b/drivers/memory/atmel-ebi.c
index b45914cfa212..0322df9dc249 100644
--- a/drivers/memory/atmel-ebi.c
+++ b/drivers/memory/atmel-ebi.c
@@ -17,6 +17,7 @@
 #include <linux/init.h>
 #include <linux/of_device.h>
 #include <linux/regmap.h>
+#include <soc/at91/atmel-sfr.h>
 
 struct atmel_ebi_dev_config {
 	int cs;
@@ -440,6 +441,15 @@ static const struct atmel_ebi_caps sama5d3_ebi_caps = {
 	.apply_config = sama5_ebi_apply_config,
 };
 
+static const struct atmel_ebi_caps sam9x60_ebi_caps = {
+	.available_cs = 0x3f,
+	.ebi_csa_offs = AT91_SFR_CCFG_EBICSA,
+	.regmap_name = "microchip,sfr",
+	.get_config = at91sam9_ebi_get_config,
+	.xlate_config = atmel_ebi_xslate_smc_config,
+	.apply_config = at91sam9_ebi_apply_config,
+};
+
 static const struct of_device_id atmel_ebi_id_table[] = {
 	{
 		.compatible = "atmel,at91sam9260-ebi",
@@ -473,6 +483,10 @@ static const struct of_device_id atmel_ebi_id_table[] = {
 		.compatible = "atmel,sama5d3-ebi",
 		.data = &sama5d3_ebi_caps,
 	},
+	{
+		.compatible = "microchip,sam9x60-ebi",
+		.data = &sam9x60_ebi_caps,
+	},
 	{ /* sentinel */ }
 };
 
-- 
2.9.5


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

* [PATCH 05/11] mtd: rawnand: atmel: add generic name for EBICSA regmap
  2019-02-13  8:59 [PATCH 00/11] add support for sam9x60 nand controller Tudor.Ambarus
                   ` (3 preceding siblings ...)
  2019-02-13  8:59 ` [PATCH 04/11] memory: atmel-ebi: add sam9x60 EBI support Tudor.Ambarus
@ 2019-02-13  8:59 ` Tudor.Ambarus
  2019-02-13  9:00 ` [PATCH 06/11] dt-bindings: mtd: atmel-nand: add sam9x60 compatible Tudor.Ambarus
                   ` (6 subsequent siblings)
  11 siblings, 0 replies; 22+ messages in thread
From: Tudor.Ambarus @ 2019-02-13  8:59 UTC (permalink / raw)
  To: robh+dt, mark.rutland, Nicolas.Ferre, alexandre.belloni,
	Ludovic.Desroches, dwmw2, computersforpeace, bbrezillon,
	marek.vasut, richard, miquel.raynal, lee.jones
  Cc: devicetree, linux-arm-kernel, linux-kernel, linux-mtd, Tudor.Ambarus

From: Tudor Ambarus <tudor.ambarus@microchip.com>

The sam9x60 board defines the CCFG_EBICSA register under SFR,
and not as a MATRIX register, as previous boards do. Add a
more generic name for the EBICSA regmap, as a prerequisite for
sam9x60 nand controller support.

Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
---
 drivers/mtd/nand/raw/atmel/nand-controller.c | 28 +++++++++++++++++-----------
 1 file changed, 17 insertions(+), 11 deletions(-)

diff --git a/drivers/mtd/nand/raw/atmel/nand-controller.c b/drivers/mtd/nand/raw/atmel/nand-controller.c
index 5781fcf6b76c..6aef98b7338a 100644
--- a/drivers/mtd/nand/raw/atmel/nand-controller.c
+++ b/drivers/mtd/nand/raw/atmel/nand-controller.c
@@ -211,6 +211,7 @@ struct atmel_nand_controller_caps {
 	bool legacy_of_bindings;
 	u32 ale_offs;
 	u32 cle_offs;
+	const char *ebi_csa_regmap_name;
 	const struct atmel_nand_controller_ops *ops;
 };
 
@@ -233,7 +234,7 @@ to_nand_controller(struct nand_controller *ctl)
 
 struct atmel_smc_nand_controller {
 	struct atmel_nand_controller base;
-	struct regmap *matrix;
+	struct regmap *ebi_csa_regmap;
 	unsigned int ebi_csa_offs;
 };
 
@@ -1507,12 +1508,12 @@ static void atmel_smc_nand_init(struct atmel_nand_controller *nc,
 	atmel_nand_init(nc, nand);
 
 	smc_nc = to_smc_nand_controller(chip->controller);
-	if (!smc_nc->matrix)
+	if (!smc_nc->ebi_csa_regmap)
 		return;
 
 	/* Attach the CS to the NAND Flash logic. */
 	for (i = 0; i < nand->numcs; i++)
-		regmap_update_bits(smc_nc->matrix, smc_nc->ebi_csa_offs,
+		regmap_update_bits(smc_nc->ebi_csa_regmap, smc_nc->ebi_csa_offs,
 				   BIT(nand->cs[i].id), BIT(nand->cs[i].id));
 }
 
@@ -1833,7 +1834,7 @@ static void atmel_nand_controller_cleanup(struct atmel_nand_controller *nc)
 	clk_put(nc->mck);
 }
 
-static const struct of_device_id atmel_matrix_of_ids[] = {
+static const struct of_device_id atmel_ebi_csa_regmap_of_ids[] = {
 	{
 		.compatible = "atmel,at91sam9260-matrix",
 		.data = (void *)AT91SAM9260_MATRIX_EBICSA,
@@ -1982,25 +1983,26 @@ atmel_smc_nand_controller_init(struct atmel_smc_nand_controller *nc)
 	struct device_node *np;
 	int ret;
 
-	/* We do not retrieve the matrix syscon when parsing old DTs. */
+	/* We do not retrieve the EBICSA regmap when parsing old DTs. */
 	if (nc->base.caps->legacy_of_bindings)
 		return 0;
 
-	np = of_parse_phandle(dev->parent->of_node, "atmel,matrix", 0);
+	np = of_parse_phandle(dev->parent->of_node,
+			      nc->base.caps->ebi_csa_regmap_name, 0);
 	if (!np)
 		return 0;
 
-	match = of_match_node(atmel_matrix_of_ids, np);
+	match = of_match_node(atmel_ebi_csa_regmap_of_ids, np);
 	if (!match) {
 		of_node_put(np);
 		return 0;
 	}
 
-	nc->matrix = syscon_node_to_regmap(np);
+	nc->ebi_csa_regmap = syscon_node_to_regmap(np);
 	of_node_put(np);
-	if (IS_ERR(nc->matrix)) {
-		ret = PTR_ERR(nc->matrix);
-		dev_err(dev, "Could not get Matrix regmap (err = %d)\n", ret);
+	if (IS_ERR(nc->ebi_csa_regmap)) {
+		ret = PTR_ERR(nc->ebi_csa_regmap);
+		dev_err(dev, "Could not get EBICSA regmap (err = %d)\n", ret);
 		return ret;
 	}
 
@@ -2341,6 +2343,7 @@ static const struct atmel_nand_controller_ops at91rm9200_nc_ops = {
 static const struct atmel_nand_controller_caps atmel_rm9200_nc_caps = {
 	.ale_offs = BIT(21),
 	.cle_offs = BIT(22),
+	.ebi_csa_regmap_name = "atmel,matrix",
 	.ops = &at91rm9200_nc_ops,
 };
 
@@ -2355,12 +2358,14 @@ static const struct atmel_nand_controller_ops atmel_smc_nc_ops = {
 static const struct atmel_nand_controller_caps atmel_sam9260_nc_caps = {
 	.ale_offs = BIT(21),
 	.cle_offs = BIT(22),
+	.ebi_csa_regmap_name = "atmel,matrix",
 	.ops = &atmel_smc_nc_ops,
 };
 
 static const struct atmel_nand_controller_caps atmel_sam9261_nc_caps = {
 	.ale_offs = BIT(22),
 	.cle_offs = BIT(21),
+	.ebi_csa_regmap_name = "atmel,matrix",
 	.ops = &atmel_smc_nc_ops,
 };
 
@@ -2368,6 +2373,7 @@ static const struct atmel_nand_controller_caps atmel_sam9g45_nc_caps = {
 	.has_dma = true,
 	.ale_offs = BIT(21),
 	.cle_offs = BIT(22),
+	.ebi_csa_regmap_name = "atmel,matrix",
 	.ops = &atmel_smc_nc_ops,
 };
 
-- 
2.9.5


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

* [PATCH 06/11] dt-bindings: mtd: atmel-nand: add sam9x60 compatible
  2019-02-13  8:59 [PATCH 00/11] add support for sam9x60 nand controller Tudor.Ambarus
                   ` (4 preceding siblings ...)
  2019-02-13  8:59 ` [PATCH 05/11] mtd: rawnand: atmel: add generic name for EBICSA regmap Tudor.Ambarus
@ 2019-02-13  9:00 ` Tudor.Ambarus
  2019-02-28 18:24   ` Rob Herring
  2019-02-13  9:00 ` [PATCH 07/11] mtd: rawnand: atmel: add sam9x60 nand controller support Tudor.Ambarus
                   ` (5 subsequent siblings)
  11 siblings, 1 reply; 22+ messages in thread
From: Tudor.Ambarus @ 2019-02-13  9:00 UTC (permalink / raw)
  To: robh+dt, mark.rutland, Nicolas.Ferre, alexandre.belloni,
	Ludovic.Desroches, dwmw2, computersforpeace, bbrezillon,
	marek.vasut, richard, miquel.raynal, lee.jones
  Cc: devicetree, linux-arm-kernel, linux-kernel, linux-mtd, Tudor.Ambarus

From: Tudor Ambarus <tudor.ambarus@microchip.com>

Add compatibility string for the sam9x60 nand controller.

Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
---
 Documentation/devicetree/bindings/mtd/atmel-nand.txt | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/mtd/atmel-nand.txt b/Documentation/devicetree/bindings/mtd/atmel-nand.txt
index 9bb66e476672..68b51dc58816 100644
--- a/Documentation/devicetree/bindings/mtd/atmel-nand.txt
+++ b/Documentation/devicetree/bindings/mtd/atmel-nand.txt
@@ -14,6 +14,7 @@ Required properties:
 	"atmel,at91sam9261-nand-controller"
 	"atmel,at91sam9g45-nand-controller"
 	"atmel,sama5d3-nand-controller"
+	"microchip,sam9x60-nand-controller"
 - ranges: empty ranges property to forward EBI ranges definitions.
 - #address-cells: should be set to 2.
 - #size-cells: should be set to 1.
-- 
2.9.5


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

* [PATCH 07/11] mtd: rawnand: atmel: add sam9x60 nand controller support
  2019-02-13  8:59 [PATCH 00/11] add support for sam9x60 nand controller Tudor.Ambarus
                   ` (5 preceding siblings ...)
  2019-02-13  9:00 ` [PATCH 06/11] dt-bindings: mtd: atmel-nand: add sam9x60 compatible Tudor.Ambarus
@ 2019-02-13  9:00 ` Tudor.Ambarus
  2019-02-13 10:39   ` Alexandre Belloni
  2019-02-13  9:00 ` [PATCH 08/11] memory: atmel-ebi: move NUM_CS definition inside atmel-ebi Tudor.Ambarus
                   ` (4 subsequent siblings)
  11 siblings, 1 reply; 22+ messages in thread
From: Tudor.Ambarus @ 2019-02-13  9:00 UTC (permalink / raw)
  To: robh+dt, mark.rutland, Nicolas.Ferre, alexandre.belloni,
	Ludovic.Desroches, dwmw2, computersforpeace, bbrezillon,
	marek.vasut, richard, miquel.raynal, lee.jones
  Cc: devicetree, linux-arm-kernel, linux-kernel, linux-mtd, Tudor.Ambarus

From: Tudor Ambarus <tudor.ambarus@microchip.com>

The sam9x60 board defines the CCFG_EBICSA register under SFR,
and not as a MATRIX register, as previous boards do.

NAND Flash I/Os are connected to D16–D23, thus
SFR_CCFG_EBICSA.NFD0_ON_D16 is set to 1.

Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
---
 drivers/mtd/nand/raw/atmel/nand-controller.c | 86 ++++++++++++++++++++++++----
 1 file changed, 74 insertions(+), 12 deletions(-)

diff --git a/drivers/mtd/nand/raw/atmel/nand-controller.c b/drivers/mtd/nand/raw/atmel/nand-controller.c
index 6aef98b7338a..ff85be0e2de3 100644
--- a/drivers/mtd/nand/raw/atmel/nand-controller.c
+++ b/drivers/mtd/nand/raw/atmel/nand-controller.c
@@ -65,6 +65,7 @@
 #include <linux/iopoll.h>
 #include <linux/platform_device.h>
 #include <linux/regmap.h>
+#include <soc/at91/atmel-sfr.h>
 
 #include "pmecc.h"
 
@@ -232,10 +233,15 @@ to_nand_controller(struct nand_controller *ctl)
 	return container_of(ctl, struct atmel_nand_controller, base);
 }
 
+struct atmel_smc_nand_ebi_csa_cfg {
+	u32 offs;
+	u32 nfd0_on_d16;
+};
+
 struct atmel_smc_nand_controller {
 	struct atmel_nand_controller base;
 	struct regmap *ebi_csa_regmap;
-	unsigned int ebi_csa_offs;
+	struct atmel_smc_nand_ebi_csa_cfg *ebi_csa;
 };
 
 static inline struct atmel_smc_nand_controller *
@@ -1513,8 +1519,15 @@ static void atmel_smc_nand_init(struct atmel_nand_controller *nc,
 
 	/* Attach the CS to the NAND Flash logic. */
 	for (i = 0; i < nand->numcs; i++)
-		regmap_update_bits(smc_nc->ebi_csa_regmap, smc_nc->ebi_csa_offs,
+		regmap_update_bits(smc_nc->ebi_csa_regmap,
+				   smc_nc->ebi_csa->offs,
 				   BIT(nand->cs[i].id), BIT(nand->cs[i].id));
+
+	if (smc_nc->ebi_csa->nfd0_on_d16)
+		regmap_update_bits(smc_nc->ebi_csa_regmap,
+				   smc_nc->ebi_csa->offs,
+				   smc_nc->ebi_csa->nfd0_on_d16,
+				   smc_nc->ebi_csa->nfd0_on_d16);
 }
 
 static void atmel_hsmc_nand_init(struct atmel_nand_controller *nc,
@@ -1834,34 +1847,71 @@ static void atmel_nand_controller_cleanup(struct atmel_nand_controller *nc)
 	clk_put(nc->mck);
 }
 
+static const struct atmel_smc_nand_ebi_csa_cfg at91sam9260_ebi_csa = {
+	.offs = AT91SAM9260_MATRIX_EBICSA,
+};
+
+static const struct atmel_smc_nand_ebi_csa_cfg at91sam9261_ebi_csa = {
+	.offs = AT91SAM9261_MATRIX_EBICSA,
+};
+
+static const struct atmel_smc_nand_ebi_csa_cfg at91sam9263_ebi_csa = {
+	.offs = AT91SAM9263_MATRIX_EBI0CSA,
+};
+
+static const struct atmel_smc_nand_ebi_csa_cfg at91sam9rl_ebi_csa = {
+	.offs = AT91SAM9RL_MATRIX_EBICSA,
+};
+
+static const struct atmel_smc_nand_ebi_csa_cfg at91sam9g45_ebi_csa = {
+	.offs = AT91SAM9G45_MATRIX_EBICSA,
+};
+
+static const struct atmel_smc_nand_ebi_csa_cfg at91sam9n12_ebi_csa = {
+	.offs = AT91SAM9N12_MATRIX_EBICSA,
+};
+
+static const struct atmel_smc_nand_ebi_csa_cfg at91sam9x5_ebi_csa = {
+	.offs = AT91SAM9X5_MATRIX_EBICSA,
+};
+
+static const struct atmel_smc_nand_ebi_csa_cfg sam9x60_ebi_csa = {
+	.offs = AT91_SFR_CCFG_EBICSA,
+	.nfd0_on_d16 = AT91_SFR_CCFG_NFD0_ON_D16,
+};
+
 static const struct of_device_id atmel_ebi_csa_regmap_of_ids[] = {
 	{
 		.compatible = "atmel,at91sam9260-matrix",
-		.data = (void *)AT91SAM9260_MATRIX_EBICSA,
+		.data = &at91sam9260_ebi_csa,
 	},
 	{
 		.compatible = "atmel,at91sam9261-matrix",
-		.data = (void *)AT91SAM9261_MATRIX_EBICSA,
+		.data = &at91sam9261_ebi_csa,
 	},
 	{
 		.compatible = "atmel,at91sam9263-matrix",
-		.data = (void *)AT91SAM9263_MATRIX_EBI0CSA,
+		.data = &at91sam9263_ebi_csa,
 	},
 	{
 		.compatible = "atmel,at91sam9rl-matrix",
-		.data = (void *)AT91SAM9RL_MATRIX_EBICSA,
+		.data = &at91sam9rl_ebi_csa,
 	},
 	{
 		.compatible = "atmel,at91sam9g45-matrix",
-		.data = (void *)AT91SAM9G45_MATRIX_EBICSA,
+		.data = &at91sam9g45_ebi_csa,
 	},
 	{
 		.compatible = "atmel,at91sam9n12-matrix",
-		.data = (void *)AT91SAM9N12_MATRIX_EBICSA,
+		.data = &at91sam9n12_ebi_csa,
 	},
 	{
 		.compatible = "atmel,at91sam9x5-matrix",
-		.data = (void *)AT91SAM9X5_MATRIX_EBICSA,
+		.data = &at91sam9x5_ebi_csa,
+	},
+	{
+		.compatible = "microchip,sam9x60-sfr",
+		.data = &sam9x60_ebi_csa,
 	},
 	{ /* sentinel */ },
 };
@@ -2006,15 +2056,15 @@ atmel_smc_nand_controller_init(struct atmel_smc_nand_controller *nc)
 		return ret;
 	}
 
-	nc->ebi_csa_offs = (uintptr_t)match->data;
+	nc->ebi_csa = (struct atmel_smc_nand_ebi_csa_cfg *)match->data;
 
 	/*
 	 * The at91sam9263 has 2 EBIs, if the NAND controller is under EBI1
-	 * add 4 to ->ebi_csa_offs.
+	 * add 4 to ->ebi_csa->offs.
 	 */
 	if (of_device_is_compatible(dev->parent->of_node,
 				    "atmel,at91sam9263-ebi1"))
-		nc->ebi_csa_offs += 4;
+		nc->ebi_csa->offs += 4;
 
 	return 0;
 }
@@ -2377,6 +2427,14 @@ static const struct atmel_nand_controller_caps atmel_sam9g45_nc_caps = {
 	.ops = &atmel_smc_nc_ops,
 };
 
+static const struct atmel_nand_controller_caps microchip_sam9x60_nc_caps = {
+	.has_dma = true,
+	.ale_offs = BIT(21),
+	.cle_offs = BIT(22),
+	.ebi_csa_regmap_name = "microchip,sfr",
+	.ops = &atmel_smc_nc_ops,
+};
+
 /* Only used to parse old bindings. */
 static const struct atmel_nand_controller_caps atmel_rm9200_nand_caps = {
 	.ale_offs = BIT(21),
@@ -2421,6 +2479,10 @@ static const struct of_device_id atmel_nand_controller_of_ids[] = {
 		.compatible = "atmel,sama5d3-nand-controller",
 		.data = &atmel_sama5_nc_caps,
 	},
+	{
+		.compatible = "microchip,sam9x60-nand-controller",
+		.data = &microchip_sam9x60_nc_caps,
+	},
 	/* Support for old/deprecated bindings: */
 	{
 		.compatible = "atmel,at91rm9200-nand",
-- 
2.9.5


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

* [PATCH 08/11] memory: atmel-ebi: move NUM_CS definition inside atmel-ebi
  2019-02-13  8:59 [PATCH 00/11] add support for sam9x60 nand controller Tudor.Ambarus
                   ` (6 preceding siblings ...)
  2019-02-13  9:00 ` [PATCH 07/11] mtd: rawnand: atmel: add sam9x60 nand controller support Tudor.Ambarus
@ 2019-02-13  9:00 ` Tudor.Ambarus
  2019-02-13  9:00 ` [PATCH 09/11] mfd: syscon: atmel: switch to SPDX license identifiers Tudor.Ambarus
                   ` (3 subsequent siblings)
  11 siblings, 0 replies; 22+ messages in thread
From: Tudor.Ambarus @ 2019-02-13  9:00 UTC (permalink / raw)
  To: robh+dt, mark.rutland, Nicolas.Ferre, alexandre.belloni,
	Ludovic.Desroches, dwmw2, computersforpeace, bbrezillon,
	marek.vasut, richard, miquel.raynal, lee.jones
  Cc: devicetree, linux-arm-kernel, linux-kernel, linux-mtd, Tudor.Ambarus

From: Tudor Ambarus <tudor.ambarus@microchip.com>

The total number of cs lines is described by the EBI controller
and not by the matrix. Move the definition for the number of cs
inside ebi driver. Drop "matrix" from its name.

Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
---
 drivers/memory/atmel-ebi.c              | 6 ++++--
 include/linux/mfd/syscon/atmel-matrix.h | 1 -
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/memory/atmel-ebi.c b/drivers/memory/atmel-ebi.c
index 0322df9dc249..8515196c2b03 100644
--- a/drivers/memory/atmel-ebi.c
+++ b/drivers/memory/atmel-ebi.c
@@ -19,6 +19,8 @@
 #include <linux/regmap.h>
 #include <soc/at91/atmel-sfr.h>
 
+#define AT91_EBI_NUM_CS		8
+
 struct atmel_ebi_dev_config {
 	int cs;
 	struct atmel_smc_cs_conf smcconf;
@@ -314,7 +316,7 @@ static int atmel_ebi_dev_setup(struct atmel_ebi *ebi, struct device_node *np,
 		if (ret)
 			return ret;
 
-		if (cs >= AT91_MATRIX_EBI_NUM_CS ||
+		if (cs >= AT91_EBI_NUM_CS ||
 		    !(ebi->caps->available_cs & BIT(cs))) {
 			dev_err(dev, "invalid reg property in %pOF\n", np);
 			return -EINVAL;
@@ -344,7 +346,7 @@ static int atmel_ebi_dev_setup(struct atmel_ebi *ebi, struct device_node *np,
 		apply = true;
 
 	i = 0;
-	for_each_set_bit(cs, &cslines, AT91_MATRIX_EBI_NUM_CS) {
+	for_each_set_bit(cs, &cslines, AT91_EBI_NUM_CS) {
 		ebid->configs[i].cs = cs;
 
 		if (apply) {
diff --git a/include/linux/mfd/syscon/atmel-matrix.h b/include/linux/mfd/syscon/atmel-matrix.h
index 8293c3e2a82a..1e2cd118e4e3 100644
--- a/include/linux/mfd/syscon/atmel-matrix.h
+++ b/include/linux/mfd/syscon/atmel-matrix.h
@@ -110,7 +110,6 @@
 #define AT91_MATRIX_DDR_IOSR			BIT(18)
 #define AT91_MATRIX_NFD0_SELECT			BIT(24)
 #define AT91_MATRIX_DDR_MP_EN			BIT(25)
-#define AT91_MATRIX_EBI_NUM_CS			8
 
 #define AT91_MATRIX_USBPUCR_PUON		BIT(30)
 
-- 
2.9.5


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

* [PATCH 09/11] mfd: syscon: atmel: switch to SPDX license identifiers
  2019-02-13  8:59 [PATCH 00/11] add support for sam9x60 nand controller Tudor.Ambarus
                   ` (7 preceding siblings ...)
  2019-02-13  9:00 ` [PATCH 08/11] memory: atmel-ebi: move NUM_CS definition inside atmel-ebi Tudor.Ambarus
@ 2019-02-13  9:00 ` Tudor.Ambarus
  2019-04-03 10:08   ` Lee Jones
  2019-02-13  9:00 ` [PATCH 10/11] memory: atmel-ebi: " Tudor.Ambarus
                   ` (2 subsequent siblings)
  11 siblings, 1 reply; 22+ messages in thread
From: Tudor.Ambarus @ 2019-02-13  9:00 UTC (permalink / raw)
  To: robh+dt, mark.rutland, Nicolas.Ferre, alexandre.belloni,
	Ludovic.Desroches, dwmw2, computersforpeace, bbrezillon,
	marek.vasut, richard, miquel.raynal, lee.jones
  Cc: devicetree, linux-arm-kernel, linux-kernel, linux-mtd, Tudor.Ambarus

From: Tudor Ambarus <tudor.ambarus@microchip.com>

Adopt the SPDX license identifiers to ease license compliance
management.

Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
---
 include/linux/mfd/syscon/atmel-matrix.h | 6 +-----
 include/linux/mfd/syscon/atmel-mc.h     | 6 +-----
 include/linux/mfd/syscon/atmel-smc.h    | 5 +----
 include/linux/mfd/syscon/atmel-st.h     | 6 +-----
 4 files changed, 4 insertions(+), 19 deletions(-)

diff --git a/include/linux/mfd/syscon/atmel-matrix.h b/include/linux/mfd/syscon/atmel-matrix.h
index 1e2cd118e4e3..20c25665216a 100644
--- a/include/linux/mfd/syscon/atmel-matrix.h
+++ b/include/linux/mfd/syscon/atmel-matrix.h
@@ -1,12 +1,8 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
 /*
  *  Copyright (C) 2014 Atmel Corporation.
  *
  * Memory Controllers (MATRIX, EBI) - System peripherals registers.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
  */
 
 #ifndef _LINUX_MFD_SYSCON_ATMEL_MATRIX_H
diff --git a/include/linux/mfd/syscon/atmel-mc.h b/include/linux/mfd/syscon/atmel-mc.h
index afd9b8f1e363..99c56205c410 100644
--- a/include/linux/mfd/syscon/atmel-mc.h
+++ b/include/linux/mfd/syscon/atmel-mc.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
 /*
  * Copyright (C) 2005 Ivan Kokshaysky
  * Copyright (C) SAN People
@@ -5,11 +6,6 @@
  * Memory Controllers (MC, EBI, SMC, SDRAMC, BFC) - System peripherals
  * registers.
  * Based on AT91RM9200 datasheet revision E.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
  */
 
 #ifndef _LINUX_MFD_SYSCON_ATMEL_MC_H_
diff --git a/include/linux/mfd/syscon/atmel-smc.h b/include/linux/mfd/syscon/atmel-smc.h
index 7a367f34b66a..e9e24f4c4578 100644
--- a/include/linux/mfd/syscon/atmel-smc.h
+++ b/include/linux/mfd/syscon/atmel-smc.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
 /*
  * Atmel SMC (Static Memory Controller) register offsets and bit definitions.
  *
@@ -5,10 +6,6 @@
  * Copyright (C) 2014 Free Electrons
  *
  * Author: Boris Brezillon <boris.brezillon@free-electrons.com>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
  */
 
 #ifndef _LINUX_MFD_SYSCON_ATMEL_SMC_H_
diff --git a/include/linux/mfd/syscon/atmel-st.h b/include/linux/mfd/syscon/atmel-st.h
index 8acf1ec1fa32..5b6013d0c440 100644
--- a/include/linux/mfd/syscon/atmel-st.h
+++ b/include/linux/mfd/syscon/atmel-st.h
@@ -1,14 +1,10 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
 /*
  * Copyright (C) 2005 Ivan Kokshaysky
  * Copyright (C) SAN People
  *
  * System Timer (ST) - System peripherals registers.
  * Based on AT91RM9200 datasheet revision E.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
  */
 
 #ifndef _LINUX_MFD_SYSCON_ATMEL_ST_H
-- 
2.9.5


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

* [PATCH 10/11] memory: atmel-ebi: switch to SPDX license identifiers
  2019-02-13  8:59 [PATCH 00/11] add support for sam9x60 nand controller Tudor.Ambarus
                   ` (8 preceding siblings ...)
  2019-02-13  9:00 ` [PATCH 09/11] mfd: syscon: atmel: switch to SPDX license identifiers Tudor.Ambarus
@ 2019-02-13  9:00 ` Tudor.Ambarus
  2019-02-13  9:00 ` [PATCH 11/11] mtd: rawnand: atmel: " Tudor.Ambarus
  2019-04-01 15:24 ` [PATCH 00/11] add support for sam9x60 nand controller Miquel Raynal
  11 siblings, 0 replies; 22+ messages in thread
From: Tudor.Ambarus @ 2019-02-13  9:00 UTC (permalink / raw)
  To: robh+dt, mark.rutland, Nicolas.Ferre, alexandre.belloni,
	Ludovic.Desroches, dwmw2, computersforpeace, bbrezillon,
	marek.vasut, richard, miquel.raynal, lee.jones
  Cc: devicetree, linux-arm-kernel, linux-kernel, linux-mtd, Tudor.Ambarus

From: Tudor Ambarus <tudor.ambarus@microchip.com>

Adopt the SPDX license identifiers to ease license compliance
management.

Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
---
 drivers/memory/atmel-ebi.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/memory/atmel-ebi.c b/drivers/memory/atmel-ebi.c
index 8515196c2b03..14386d0b5f57 100644
--- a/drivers/memory/atmel-ebi.c
+++ b/drivers/memory/atmel-ebi.c
@@ -1,12 +1,9 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
  * EBI driver for Atmel chips
  * inspired by the fsl weim bus driver
  *
  * Copyright (C) 2013 Jean-Jacques Hiblot <jjhiblot@traphandler.com>
- *
- * This file is licensed under the terms of the GNU General Public
- * License version 2. This program is licensed "as is" without any
- * warranty of any kind, whether express or implied.
  */
 
 #include <linux/clk.h>
-- 
2.9.5


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

* [PATCH 11/11] mtd: rawnand: atmel: switch to SPDX license identifiers
  2019-02-13  8:59 [PATCH 00/11] add support for sam9x60 nand controller Tudor.Ambarus
                   ` (9 preceding siblings ...)
  2019-02-13  9:00 ` [PATCH 10/11] memory: atmel-ebi: " Tudor.Ambarus
@ 2019-02-13  9:00 ` Tudor.Ambarus
  2019-04-01 15:24 ` [PATCH 00/11] add support for sam9x60 nand controller Miquel Raynal
  11 siblings, 0 replies; 22+ messages in thread
From: Tudor.Ambarus @ 2019-02-13  9:00 UTC (permalink / raw)
  To: robh+dt, mark.rutland, Nicolas.Ferre, alexandre.belloni,
	Ludovic.Desroches, dwmw2, computersforpeace, bbrezillon,
	marek.vasut, richard, miquel.raynal, lee.jones
  Cc: devicetree, linux-arm-kernel, linux-kernel, linux-mtd, Tudor.Ambarus

From: Tudor Ambarus <tudor.ambarus@microchip.com>

Adopt the SPDX license identifiers to ease license compliance
management.

Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
---
 drivers/mtd/nand/raw/atmel/nand-controller.c | 5 +----
 drivers/mtd/nand/raw/atmel/pmecc.c           | 5 +----
 drivers/mtd/nand/raw/atmel/pmecc.h           | 6 +-----
 3 files changed, 3 insertions(+), 13 deletions(-)

diff --git a/drivers/mtd/nand/raw/atmel/nand-controller.c b/drivers/mtd/nand/raw/atmel/nand-controller.c
index ff85be0e2de3..3205b705d734 100644
--- a/drivers/mtd/nand/raw/atmel/nand-controller.c
+++ b/drivers/mtd/nand/raw/atmel/nand-controller.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
  * Copyright 2017 ATMEL
  * Copyright 2017 Free Electrons
@@ -29,10 +30,6 @@
  *   Add Nand Flash Controller support for SAMA5 SoC
  *	Copyright 2013 ATMEL, Josh Wu (josh.wu@atmel.com)
  *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
  * A few words about the naming convention in this file. This convention
  * applies to structure and function names.
  *
diff --git a/drivers/mtd/nand/raw/atmel/pmecc.c b/drivers/mtd/nand/raw/atmel/pmecc.c
index 9d3997840889..cbb023bf00f7 100644
--- a/drivers/mtd/nand/raw/atmel/pmecc.c
+++ b/drivers/mtd/nand/raw/atmel/pmecc.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
  * Copyright 2017 ATMEL
  * Copyright 2017 Free Electrons
@@ -28,10 +29,6 @@
  *   Add Nand Flash Controller support for SAMA5 SoC
  *	Copyright 2013 ATMEL, Josh Wu (josh.wu@atmel.com)
  *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
  * The PMECC is an hardware assisted BCH engine, which means part of the
  * ECC algorithm is left to the software. The hardware/software repartition
  * is explained in the "PMECC Controller Functional Description" chapter in
diff --git a/drivers/mtd/nand/raw/atmel/pmecc.h b/drivers/mtd/nand/raw/atmel/pmecc.h
index 808f1be0d6ad..7851c05126cf 100644
--- a/drivers/mtd/nand/raw/atmel/pmecc.h
+++ b/drivers/mtd/nand/raw/atmel/pmecc.h
@@ -1,3 +1,4 @@
+/* SPDX-License-Identifier: GPL-2.0 */
 /*
  * © Copyright 2016 ATMEL
  * © Copyright 2016 Free Electrons
@@ -28,11 +29,6 @@
  *
  *    Add Nand Flash Controller support for SAMA5 SoC
  *        © Copyright 2013 ATMEL, Josh Wu (josh.wu@atmel.com)
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
  */
 
 #ifndef ATMEL_PMECC_H
-- 
2.9.5


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

* Re: [PATCH 07/11] mtd: rawnand: atmel: add sam9x60 nand controller support
  2019-02-13  9:00 ` [PATCH 07/11] mtd: rawnand: atmel: add sam9x60 nand controller support Tudor.Ambarus
@ 2019-02-13 10:39   ` Alexandre Belloni
  2019-02-13 10:54     ` Tudor.Ambarus
  0 siblings, 1 reply; 22+ messages in thread
From: Alexandre Belloni @ 2019-02-13 10:39 UTC (permalink / raw)
  To: Tudor.Ambarus
  Cc: robh+dt, mark.rutland, Nicolas.Ferre, Ludovic.Desroches, dwmw2,
	computersforpeace, bbrezillon, marek.vasut, richard,
	miquel.raynal, lee.jones, devicetree, linux-arm-kernel,
	linux-kernel, linux-mtd

Hi,

On 13/02/2019 09:00:05+0000, Tudor.Ambarus@microchip.com wrote:
> -	nc->ebi_csa_offs = (uintptr_t)match->data;
> +	nc->ebi_csa = (struct atmel_smc_nand_ebi_csa_cfg *)match->data;
>  

This cast is probably not necessary anymore as this cast a pointer to a
pointer.


-- 
Alexandre Belloni, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

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

* Re: [PATCH 01/11] ARM: at91: add sam9x60 SFR definitions
  2019-02-13  8:59 ` [PATCH 01/11] ARM: at91: add sam9x60 SFR definitions Tudor.Ambarus
@ 2019-02-13 10:52   ` Alexandre Belloni
  0 siblings, 0 replies; 22+ messages in thread
From: Alexandre Belloni @ 2019-02-13 10:52 UTC (permalink / raw)
  To: Tudor.Ambarus
  Cc: robh+dt, mark.rutland, Nicolas.Ferre, Ludovic.Desroches, dwmw2,
	computersforpeace, bbrezillon, marek.vasut, richard,
	miquel.raynal, lee.jones, devicetree, linux-arm-kernel,
	linux-kernel, linux-mtd

On 13/02/2019 08:59:44+0000, Tudor.Ambarus@microchip.com wrote:
> From: Tudor Ambarus <tudor.ambarus@microchip.com>
> 
> Keep generic names, as there are no conflicts with previous
> SFR definitions.
> 
> While touching bits, update AT91_OHCIICR_USB_SUSPEND to use
> GENMASK, replace unused AT91_OHCIICR_SUSPEND_A/B/C with a more
> generic macro, align values on tab-width.
> 
> Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
Acked-by: Alexandre Belloni <alexandre.belloni@bootlin.com>

> ---
>  include/soc/at91/atmel-sfr.h | 34 +++++++++++++++++++++++++++-------
>  1 file changed, 27 insertions(+), 7 deletions(-)
> 
> diff --git a/include/soc/at91/atmel-sfr.h b/include/soc/at91/atmel-sfr.h
> index 482337af06b8..532fd784e86c 100644
> --- a/include/soc/at91/atmel-sfr.h
> +++ b/include/soc/at91/atmel-sfr.h
> @@ -14,21 +14,41 @@
>  #define _LINUX_MFD_SYSCON_ATMEL_SFR_H
>  
>  #define AT91_SFR_DDRCFG		0x04	/* DDR Configuration Register */
> +#define AT91_SFR_CCFG_EBICSA	0x04	/* EBI Chip Select Register */
>  /* 0x08 ~ 0x0c: Reserved */
>  #define AT91_SFR_OHCIICR	0x10	/* OHCI INT Configuration Register */
>  #define AT91_SFR_OHCIISR	0x14	/* OHCI INT Status Register */
>  #define AT91_SFR_UTMICKTRIM	0x30	/* UTMI Clock Trimming Register */
> +#define AT91_SFR_UTMISWAP	0x3c	/* UTMI DP/DM Pin Swapping Register */
> +#define AT91_SFR_LS		0x7c	/* Light Sleep Register */
>  #define AT91_SFR_I2SCLKSEL	0x90	/* I2SC Register */
> +#define AT91_SFR_WPMR		0xe4	/* Write Protection Mode Register */
>  
>  /* Field definitions */
> -#define AT91_OHCIICR_SUSPEND_A	BIT(8)
> -#define AT91_OHCIICR_SUSPEND_B	BIT(9)
> -#define AT91_OHCIICR_SUSPEND_C	BIT(10)
> +#define AT91_SFR_CCFG_EBI_CSA(cs, val)		((val) << (cs))
> +#define AT91_SFR_CCFG_EBI_DBPUC			BIT(8)
> +#define AT91_SFR_CCFG_EBI_DBPDC			BIT(9)
> +#define AT91_SFR_CCFG_EBI_DRIVE			BIT(17)
> +#define AT91_SFR_CCFG_NFD0_ON_D16		BIT(24)
> +#define AT91_SFR_CCFG_DDR_MP_EN			BIT(25)
>  
> -#define AT91_OHCIICR_USB_SUSPEND	(AT91_OHCIICR_SUSPEND_A | \
> -					 AT91_OHCIICR_SUSPEND_B | \
> -					 AT91_OHCIICR_SUSPEND_C)
> +#define AT91_SFR_OHCIICR_RES(x)			BIT(x)
> +#define AT91_SFR_OHCIICR_ARIE			BIT(4)
> +#define AT91_SFR_OHCIICR_APPSTART		BIT(5)
> +#define AT91_SFR_OHCIICR_USB_SUSP(x)		BIT(8 + (x))
> +#define AT91_SFR_OHCIICR_UDPPUDIS		BIT(23)
> +#define AT91_OHCIICR_USB_SUSPEND		GENMASK(10, 8)
>  
> -#define AT91_UTMICKTRIM_FREQ	GENMASK(1, 0)
> +#define AT91_SFR_OHCIISR_RIS(x)			BIT(x)
> +
> +#define AT91_UTMICKTRIM_FREQ			GENMASK(1, 0)
> +
> +#define AT91_SFR_UTMISWAP_PORT(x)		BIT(x)
> +
> +#define AT91_SFR_LS_VALUE(x)			BIT(x)
> +#define AT91_SFR_LS_MEM_POWER_GATING_ULP1_EN	BIT(16)
> +
> +#define AT91_SFR_WPMR_WPEN			BIT(0)
> +#define AT91_SFR_WPMR_WPKEY_MASK		GENMASK(31, 8)
>  
>  #endif /* _LINUX_MFD_SYSCON_ATMEL_SFR_H */
> -- 
> 2.9.5
> 

-- 
Alexandre Belloni, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

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

* Re: [PATCH 02/11] memory: atmel-ebi: add generic name for ebi regmap
  2019-02-13  8:59 ` [PATCH 02/11] memory: atmel-ebi: add generic name for ebi regmap Tudor.Ambarus
@ 2019-02-13 10:53   ` Alexandre Belloni
  0 siblings, 0 replies; 22+ messages in thread
From: Alexandre Belloni @ 2019-02-13 10:53 UTC (permalink / raw)
  To: Tudor.Ambarus
  Cc: robh+dt, mark.rutland, Nicolas.Ferre, Ludovic.Desroches, dwmw2,
	computersforpeace, bbrezillon, marek.vasut, richard,
	miquel.raynal, lee.jones, devicetree, linux-arm-kernel,
	linux-kernel, linux-mtd

On 13/02/2019 08:59:48+0000, Tudor.Ambarus@microchip.com wrote:
> From: Tudor Ambarus <tudor.ambarus@microchip.com>
> 
> The sam9x60 board defines the CCFG_EBICSA register under SFR,
> and not as a MATRIX register, as previous boards do. Add a
> more generic name for the EBI regmap as a prerequisite for
> sam9x60 ebi support.
> 
> Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
Acked-by: Alexandre Belloni <alexandre.belloni@bootlin.com>

> ---
>  drivers/memory/atmel-ebi.c | 23 ++++++++++++++++-------
>  1 file changed, 16 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/memory/atmel-ebi.c b/drivers/memory/atmel-ebi.c
> index c3748b414c27..b45914cfa212 100644
> --- a/drivers/memory/atmel-ebi.c
> +++ b/drivers/memory/atmel-ebi.c
> @@ -36,6 +36,7 @@ struct atmel_ebi_dev {
>  struct atmel_ebi_caps {
>  	unsigned int available_cs;
>  	unsigned int ebi_csa_offs;
> +	const char *regmap_name;
>  	void (*get_config)(struct atmel_ebi_dev *ebid,
>  			   struct atmel_ebi_dev_config *conf);
>  	int (*xlate_config)(struct atmel_ebi_dev *ebid,
> @@ -47,7 +48,7 @@ struct atmel_ebi_caps {
>  
>  struct atmel_ebi {
>  	struct clk *clk;
> -	struct regmap *matrix;
> +	struct regmap *regmap;
>  	struct  {
>  		struct regmap *regmap;
>  		struct clk *clk;
> @@ -357,7 +358,7 @@ static int atmel_ebi_dev_setup(struct atmel_ebi *ebi, struct device_node *np,
>  		 * one "atmel,smc-" property is present.
>  		 */
>  		if (ebi->caps->ebi_csa_offs && apply)
> -			regmap_update_bits(ebi->matrix,
> +			regmap_update_bits(ebi->regmap,
>  					   ebi->caps->ebi_csa_offs,
>  					   BIT(cs), 0);
>  
> @@ -372,6 +373,7 @@ static int atmel_ebi_dev_setup(struct atmel_ebi *ebi, struct device_node *np,
>  static const struct atmel_ebi_caps at91sam9260_ebi_caps = {
>  	.available_cs = 0xff,
>  	.ebi_csa_offs = AT91SAM9260_MATRIX_EBICSA,
> +	.regmap_name = "atmel,matrix",
>  	.get_config = at91sam9_ebi_get_config,
>  	.xlate_config = atmel_ebi_xslate_smc_config,
>  	.apply_config = at91sam9_ebi_apply_config,
> @@ -380,6 +382,7 @@ static const struct atmel_ebi_caps at91sam9260_ebi_caps = {
>  static const struct atmel_ebi_caps at91sam9261_ebi_caps = {
>  	.available_cs = 0xff,
>  	.ebi_csa_offs = AT91SAM9261_MATRIX_EBICSA,
> +	.regmap_name = "atmel,matrix",
>  	.get_config = at91sam9_ebi_get_config,
>  	.xlate_config = atmel_ebi_xslate_smc_config,
>  	.apply_config = at91sam9_ebi_apply_config,
> @@ -388,6 +391,7 @@ static const struct atmel_ebi_caps at91sam9261_ebi_caps = {
>  static const struct atmel_ebi_caps at91sam9263_ebi0_caps = {
>  	.available_cs = 0x3f,
>  	.ebi_csa_offs = AT91SAM9263_MATRIX_EBI0CSA,
> +	.regmap_name = "atmel,matrix",
>  	.get_config = at91sam9_ebi_get_config,
>  	.xlate_config = atmel_ebi_xslate_smc_config,
>  	.apply_config = at91sam9_ebi_apply_config,
> @@ -396,6 +400,7 @@ static const struct atmel_ebi_caps at91sam9263_ebi0_caps = {
>  static const struct atmel_ebi_caps at91sam9263_ebi1_caps = {
>  	.available_cs = 0x7,
>  	.ebi_csa_offs = AT91SAM9263_MATRIX_EBI1CSA,
> +	.regmap_name = "atmel,matrix",
>  	.get_config = at91sam9_ebi_get_config,
>  	.xlate_config = atmel_ebi_xslate_smc_config,
>  	.apply_config = at91sam9_ebi_apply_config,
> @@ -404,6 +409,7 @@ static const struct atmel_ebi_caps at91sam9263_ebi1_caps = {
>  static const struct atmel_ebi_caps at91sam9rl_ebi_caps = {
>  	.available_cs = 0x3f,
>  	.ebi_csa_offs = AT91SAM9RL_MATRIX_EBICSA,
> +	.regmap_name = "atmel,matrix",
>  	.get_config = at91sam9_ebi_get_config,
>  	.xlate_config = atmel_ebi_xslate_smc_config,
>  	.apply_config = at91sam9_ebi_apply_config,
> @@ -412,6 +418,7 @@ static const struct atmel_ebi_caps at91sam9rl_ebi_caps = {
>  static const struct atmel_ebi_caps at91sam9g45_ebi_caps = {
>  	.available_cs = 0x3f,
>  	.ebi_csa_offs = AT91SAM9G45_MATRIX_EBICSA,
> +	.regmap_name = "atmel,matrix",
>  	.get_config = at91sam9_ebi_get_config,
>  	.xlate_config = atmel_ebi_xslate_smc_config,
>  	.apply_config = at91sam9_ebi_apply_config,
> @@ -420,6 +427,7 @@ static const struct atmel_ebi_caps at91sam9g45_ebi_caps = {
>  static const struct atmel_ebi_caps at91sam9x5_ebi_caps = {
>  	.available_cs = 0x3f,
>  	.ebi_csa_offs = AT91SAM9X5_MATRIX_EBICSA,
> +	.regmap_name = "atmel,matrix",
>  	.get_config = at91sam9_ebi_get_config,
>  	.xlate_config = atmel_ebi_xslate_smc_config,
>  	.apply_config = at91sam9_ebi_apply_config,
> @@ -543,13 +551,14 @@ static int atmel_ebi_probe(struct platform_device *pdev)
>  
>  	/*
>  	 * The sama5d3 does not provide an EBICSA register and thus does need
> -	 * to access the matrix registers.
> +	 * to access it.
>  	 */
>  	if (ebi->caps->ebi_csa_offs) {
> -		ebi->matrix =
> -			syscon_regmap_lookup_by_phandle(np, "atmel,matrix");
> -		if (IS_ERR(ebi->matrix))
> -			return PTR_ERR(ebi->matrix);
> +		ebi->regmap =
> +			syscon_regmap_lookup_by_phandle(np,
> +							ebi->caps->regmap_name);
> +		if (IS_ERR(ebi->regmap))
> +			return PTR_ERR(ebi->regmap);
>  	}
>  
>  	ret = of_property_read_u32(np, "#address-cells", &val);
> -- 
> 2.9.5
> 

-- 
Alexandre Belloni, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

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

* Re: [PATCH 03/11] dt-bindings: memory: atmel-ebi: add sam9x60 compatible
  2019-02-13  8:59 ` [PATCH 03/11] dt-bindings: memory: atmel-ebi: add sam9x60 compatible Tudor.Ambarus
@ 2019-02-13 10:53   ` Alexandre Belloni
  2019-02-28 18:24   ` Rob Herring
  1 sibling, 0 replies; 22+ messages in thread
From: Alexandre Belloni @ 2019-02-13 10:53 UTC (permalink / raw)
  To: Tudor.Ambarus
  Cc: robh+dt, mark.rutland, Nicolas.Ferre, Ludovic.Desroches, dwmw2,
	computersforpeace, bbrezillon, marek.vasut, richard,
	miquel.raynal, lee.jones, devicetree, linux-arm-kernel,
	linux-kernel, linux-mtd

On 13/02/2019 08:59:52+0000, Tudor.Ambarus@microchip.com wrote:
> From: Tudor Ambarus <tudor.ambarus@microchip.com>
> 
> Add compatibility string for the sam9x60 EBI.
> 
> Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
Acked-by: Alexandre Belloni <alexandre.belloni@bootlin.com>

> ---
>  Documentation/devicetree/bindings/memory-controllers/atmel,ebi.txt | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/Documentation/devicetree/bindings/memory-controllers/atmel,ebi.txt b/Documentation/devicetree/bindings/memory-controllers/atmel,ebi.txt
> index 9bb5f57e2066..94bf7896a688 100644
> --- a/Documentation/devicetree/bindings/memory-controllers/atmel,ebi.txt
> +++ b/Documentation/devicetree/bindings/memory-controllers/atmel,ebi.txt
> @@ -15,6 +15,7 @@ Required properties:
>  			"atmel,at91sam9g45-ebi"
>  			"atmel,at91sam9x5-ebi"
>  			"atmel,sama5d3-ebi"
> +			"microchip,sam9x60-ebi"
>  
>  - reg:			Contains offset/length value for EBI memory mapping.
>  			This property might contain several entries if the EBI
> -- 
> 2.9.5
> 

-- 
Alexandre Belloni, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

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

* Re: [PATCH 04/11] memory: atmel-ebi: add sam9x60 EBI support
  2019-02-13  8:59 ` [PATCH 04/11] memory: atmel-ebi: add sam9x60 EBI support Tudor.Ambarus
@ 2019-02-13 10:54   ` Alexandre Belloni
  0 siblings, 0 replies; 22+ messages in thread
From: Alexandre Belloni @ 2019-02-13 10:54 UTC (permalink / raw)
  To: Tudor.Ambarus
  Cc: robh+dt, mark.rutland, Nicolas.Ferre, Ludovic.Desroches, dwmw2,
	computersforpeace, bbrezillon, marek.vasut, richard,
	miquel.raynal, lee.jones, devicetree, linux-arm-kernel,
	linux-kernel, linux-mtd

On 13/02/2019 08:59:55+0000, Tudor.Ambarus@microchip.com wrote:
> From: Tudor Ambarus <tudor.ambarus@microchip.com>
> 
> The sam9x60 board defines the CCFG_EBICSA register under SFR,
> and not as a MATRIX register, as previous boards do.
> 
> Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
Acked-by: Alexandre Belloni <alexandre.belloni@bootlin.com>

> ---
>  drivers/memory/atmel-ebi.c | 14 ++++++++++++++
>  1 file changed, 14 insertions(+)
> 
> diff --git a/drivers/memory/atmel-ebi.c b/drivers/memory/atmel-ebi.c
> index b45914cfa212..0322df9dc249 100644
> --- a/drivers/memory/atmel-ebi.c
> +++ b/drivers/memory/atmel-ebi.c
> @@ -17,6 +17,7 @@
>  #include <linux/init.h>
>  #include <linux/of_device.h>
>  #include <linux/regmap.h>
> +#include <soc/at91/atmel-sfr.h>
>  
>  struct atmel_ebi_dev_config {
>  	int cs;
> @@ -440,6 +441,15 @@ static const struct atmel_ebi_caps sama5d3_ebi_caps = {
>  	.apply_config = sama5_ebi_apply_config,
>  };
>  
> +static const struct atmel_ebi_caps sam9x60_ebi_caps = {
> +	.available_cs = 0x3f,
> +	.ebi_csa_offs = AT91_SFR_CCFG_EBICSA,
> +	.regmap_name = "microchip,sfr",
> +	.get_config = at91sam9_ebi_get_config,
> +	.xlate_config = atmel_ebi_xslate_smc_config,
> +	.apply_config = at91sam9_ebi_apply_config,
> +};
> +
>  static const struct of_device_id atmel_ebi_id_table[] = {
>  	{
>  		.compatible = "atmel,at91sam9260-ebi",
> @@ -473,6 +483,10 @@ static const struct of_device_id atmel_ebi_id_table[] = {
>  		.compatible = "atmel,sama5d3-ebi",
>  		.data = &sama5d3_ebi_caps,
>  	},
> +	{
> +		.compatible = "microchip,sam9x60-ebi",
> +		.data = &sam9x60_ebi_caps,
> +	},
>  	{ /* sentinel */ }
>  };
>  
> -- 
> 2.9.5
> 

-- 
Alexandre Belloni, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

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

* Re: [PATCH 07/11] mtd: rawnand: atmel: add sam9x60 nand controller support
  2019-02-13 10:39   ` Alexandre Belloni
@ 2019-02-13 10:54     ` Tudor.Ambarus
  0 siblings, 0 replies; 22+ messages in thread
From: Tudor.Ambarus @ 2019-02-13 10:54 UTC (permalink / raw)
  To: alexandre.belloni
  Cc: robh+dt, mark.rutland, Nicolas.Ferre, Ludovic.Desroches, dwmw2,
	computersforpeace, bbrezillon, marek.vasut, richard,
	miquel.raynal, lee.jones, devicetree, linux-arm-kernel,
	linux-kernel, linux-mtd



On 02/13/2019 12:39 PM, Alexandre Belloni wrote:
> Hi,
> 
> On 13/02/2019 09:00:05+0000, Tudor.Ambarus@microchip.com wrote:
>> -	nc->ebi_csa_offs = (uintptr_t)match->data;
>> +	nc->ebi_csa = (struct atmel_smc_nand_ebi_csa_cfg *)match->data;
>>  
> 
> This cast is probably not necessary anymore as this cast a pointer to a
> pointer.
> 

it's done to discard the const qualifier from pointer target type. data is of
type const void *. nc->ebi_csa was not declared as const because below in the
same function we are modifying one of its members:

nc->ebi_csa->offs += 4;

I'll add a comment, thanks!

Cheers,
ta

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

* Re: [PATCH 03/11] dt-bindings: memory: atmel-ebi: add sam9x60 compatible
  2019-02-13  8:59 ` [PATCH 03/11] dt-bindings: memory: atmel-ebi: add sam9x60 compatible Tudor.Ambarus
  2019-02-13 10:53   ` Alexandre Belloni
@ 2019-02-28 18:24   ` Rob Herring
  1 sibling, 0 replies; 22+ messages in thread
From: Rob Herring @ 2019-02-28 18:24 UTC (permalink / raw)
  To: Tudor.Ambarus
  Cc: robh+dt, mark.rutland, Nicolas.Ferre, alexandre.belloni,
	Ludovic.Desroches, dwmw2, computersforpeace, bbrezillon,
	marek.vasut, richard, miquel.raynal, lee.jones, devicetree,
	linux-arm-kernel, linux-kernel, linux-mtd, Tudor.Ambarus

On Wed, 13 Feb 2019 08:59:52 +0000, <Tudor.Ambarus@microchip.com> wrote:
> From: Tudor Ambarus <tudor.ambarus@microchip.com>
> 
> Add compatibility string for the sam9x60 EBI.
> 
> Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
> ---
>  Documentation/devicetree/bindings/memory-controllers/atmel,ebi.txt | 1 +
>  1 file changed, 1 insertion(+)
> 

Reviewed-by: Rob Herring <robh@kernel.org>

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

* Re: [PATCH 06/11] dt-bindings: mtd: atmel-nand: add sam9x60 compatible
  2019-02-13  9:00 ` [PATCH 06/11] dt-bindings: mtd: atmel-nand: add sam9x60 compatible Tudor.Ambarus
@ 2019-02-28 18:24   ` Rob Herring
  0 siblings, 0 replies; 22+ messages in thread
From: Rob Herring @ 2019-02-28 18:24 UTC (permalink / raw)
  To: Tudor.Ambarus
  Cc: robh+dt, mark.rutland, Nicolas.Ferre, alexandre.belloni,
	Ludovic.Desroches, dwmw2, computersforpeace, bbrezillon,
	marek.vasut, richard, miquel.raynal, lee.jones, devicetree,
	linux-arm-kernel, linux-kernel, linux-mtd, Tudor.Ambarus

On Wed, 13 Feb 2019 09:00:01 +0000, <Tudor.Ambarus@microchip.com> wrote:
> From: Tudor Ambarus <tudor.ambarus@microchip.com>
> 
> Add compatibility string for the sam9x60 nand controller.
> 
> Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
> ---
>  Documentation/devicetree/bindings/mtd/atmel-nand.txt | 1 +
>  1 file changed, 1 insertion(+)
> 

Reviewed-by: Rob Herring <robh@kernel.org>

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

* Re: [PATCH 00/11] add support for sam9x60 nand controller
  2019-02-13  8:59 [PATCH 00/11] add support for sam9x60 nand controller Tudor.Ambarus
                   ` (10 preceding siblings ...)
  2019-02-13  9:00 ` [PATCH 11/11] mtd: rawnand: atmel: " Tudor.Ambarus
@ 2019-04-01 15:24 ` Miquel Raynal
  11 siblings, 0 replies; 22+ messages in thread
From: Miquel Raynal @ 2019-04-01 15:24 UTC (permalink / raw)
  To: Tudor.Ambarus
  Cc: robh+dt, mark.rutland, Nicolas.Ferre, alexandre.belloni,
	Ludovic.Desroches, dwmw2, computersforpeace, bbrezillon,
	marek.vasut, richard, lee.jones, devicetree, linux-arm-kernel,
	linux-kernel, linux-mtd

Hi Tudor,

<Tudor.Ambarus@microchip.com> wrote on Wed, 13 Feb 2019 08:59:41 +0000:

> From: Tudor Ambarus <tudor.ambarus@microchip.com>
> 
> The sam9x60 board defines the CCFG_EBICSA register under SFR,
> and not as a MATRIX register, as previous boards do.
> NAND Flash I/Os are connected to D16–D23, thus
> SFR_CCFG_EBICSA.NFD0_ON_D16 is set to 1.
> 
> Tested using mtd-utils.
> 
> - patches [1, 7] add support for the sam9x60 nand controller. I would
>   suggest to get them through linux-mtd tree, if all agree.
> - patch 8 can be taken by Alexandre
> - patch 9 - SPDX change, can be taken by Lee
> - patch 10 - SPDX change, can be taken by Alexandre
> - patch 11 - SPDX change, should go through linux-mtd
> 
> dt compatible string for "microchip,sam9x60-sfr" has already been
> submited at https://patchwork.kernel.org/patch/10799831/
> 
> Tudor Ambarus (11):
>   ARM: at91: add sam9x60 SFR definitions
>   memory: atmel-ebi: add generic name for ebi regmap
>   dt-bindings: memory: atmel-ebi: add sam9x60 compatible
>   memory: atmel-ebi: add sam9x60 EBI support
>   mtd: rawnand: atmel: add generic name for EBICSA regmap
>   dt-bindings: mtd: atmel-nand: add sam9x60 compatible
>   mtd: rawnand: atmel: add sam9x60 nand controller support
>   memory: atmel-ebi: move NUM_CS definition inside atmel-ebi
>   mfd: syscon: atmel: switch to SPDX license identifiers
>   memory: atmel-ebi: switch to SPDX license identifiers
>   mtd: rawnand: atmel: switch to SPDX license identifiers
> 
>  .../bindings/memory-controllers/atmel,ebi.txt      |   1 +
>  .../devicetree/bindings/mtd/atmel-nand.txt         |   1 +
>  drivers/memory/atmel-ebi.c                         |  48 ++++++---
>  drivers/mtd/nand/raw/atmel/nand-controller.c       | 117 ++++++++++++++++-----
>  drivers/mtd/nand/raw/atmel/pmecc.c                 |   5 +-
>  drivers/mtd/nand/raw/atmel/pmecc.h                 |   6 +-
>  include/linux/mfd/syscon/atmel-matrix.h            |   7 +-
>  include/linux/mfd/syscon/atmel-mc.h                |   6 +-
>  include/linux/mfd/syscon/atmel-smc.h               |   5 +-
>  include/linux/mfd/syscon/atmel-st.h                |   6 +-
>  include/soc/at91/atmel-sfr.h                       |  34 ++++--
>  11 files changed, 161 insertions(+), 75 deletions(-)
> 


Patches 1-7 & 11 applied to
git://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git on nand/next.


Thanks,
Miquèl

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

* Re: [PATCH 09/11] mfd: syscon: atmel: switch to SPDX license identifiers
  2019-02-13  9:00 ` [PATCH 09/11] mfd: syscon: atmel: switch to SPDX license identifiers Tudor.Ambarus
@ 2019-04-03 10:08   ` Lee Jones
  0 siblings, 0 replies; 22+ messages in thread
From: Lee Jones @ 2019-04-03 10:08 UTC (permalink / raw)
  To: Tudor.Ambarus
  Cc: robh+dt, mark.rutland, Nicolas.Ferre, alexandre.belloni,
	Ludovic.Desroches, dwmw2, computersforpeace, bbrezillon,
	marek.vasut, richard, miquel.raynal, devicetree,
	linux-arm-kernel, linux-kernel, linux-mtd

On Wed, 13 Feb 2019, Tudor.Ambarus@microchip.com wrote:

> From: Tudor Ambarus <tudor.ambarus@microchip.com>
> 
> Adopt the SPDX license identifiers to ease license compliance
> management.
> 
> Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
> ---
>  include/linux/mfd/syscon/atmel-matrix.h | 6 +-----
>  include/linux/mfd/syscon/atmel-mc.h     | 6 +-----
>  include/linux/mfd/syscon/atmel-smc.h    | 5 +----
>  include/linux/mfd/syscon/atmel-st.h     | 6 +-----
>  4 files changed, 4 insertions(+), 19 deletions(-)

Applied, thanks.

-- 
Lee Jones [李琼斯]
Linaro Services Technical Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

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

end of thread, other threads:[~2019-04-03 10:09 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-13  8:59 [PATCH 00/11] add support for sam9x60 nand controller Tudor.Ambarus
2019-02-13  8:59 ` [PATCH 01/11] ARM: at91: add sam9x60 SFR definitions Tudor.Ambarus
2019-02-13 10:52   ` Alexandre Belloni
2019-02-13  8:59 ` [PATCH 02/11] memory: atmel-ebi: add generic name for ebi regmap Tudor.Ambarus
2019-02-13 10:53   ` Alexandre Belloni
2019-02-13  8:59 ` [PATCH 03/11] dt-bindings: memory: atmel-ebi: add sam9x60 compatible Tudor.Ambarus
2019-02-13 10:53   ` Alexandre Belloni
2019-02-28 18:24   ` Rob Herring
2019-02-13  8:59 ` [PATCH 04/11] memory: atmel-ebi: add sam9x60 EBI support Tudor.Ambarus
2019-02-13 10:54   ` Alexandre Belloni
2019-02-13  8:59 ` [PATCH 05/11] mtd: rawnand: atmel: add generic name for EBICSA regmap Tudor.Ambarus
2019-02-13  9:00 ` [PATCH 06/11] dt-bindings: mtd: atmel-nand: add sam9x60 compatible Tudor.Ambarus
2019-02-28 18:24   ` Rob Herring
2019-02-13  9:00 ` [PATCH 07/11] mtd: rawnand: atmel: add sam9x60 nand controller support Tudor.Ambarus
2019-02-13 10:39   ` Alexandre Belloni
2019-02-13 10:54     ` Tudor.Ambarus
2019-02-13  9:00 ` [PATCH 08/11] memory: atmel-ebi: move NUM_CS definition inside atmel-ebi Tudor.Ambarus
2019-02-13  9:00 ` [PATCH 09/11] mfd: syscon: atmel: switch to SPDX license identifiers Tudor.Ambarus
2019-04-03 10:08   ` Lee Jones
2019-02-13  9:00 ` [PATCH 10/11] memory: atmel-ebi: " Tudor.Ambarus
2019-02-13  9:00 ` [PATCH 11/11] mtd: rawnand: atmel: " Tudor.Ambarus
2019-04-01 15:24 ` [PATCH 00/11] add support for sam9x60 nand controller Miquel Raynal

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).