All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v4 00/18] ARM: davinci: step towards removing at24_platform_data
@ 2018-06-29  9:40 ` Bartosz Golaszewski
  0 siblings, 0 replies; 98+ messages in thread
From: Bartosz Golaszewski @ 2018-06-29  9:40 UTC (permalink / raw)
  To: Sekhar Nori, Kevin Hilman, Russell King, Grygorii Strashko,
	David S . Miller, Srinivas Kandagatla, Lukas Wunner, Rob Herring,
	Florian Fainelli, Dan Carpenter, Ivan Khoronzhuk, David Lechner,
	Greg Kroah-Hartman, Andrew Lunn, Jonathan Corbet
  Cc: linux-arm-kernel, linux-kernel, linux-omap, netdev, Bartosz Golaszewski

From: Bartosz Golaszewski <bgolaszewski@baylibre.com>

Since I took over maintainership of the at24 driver I've been working
towards removing at24_platform_data in favor for device properties.

DaVinci is the only platform that's still using it - all other users
have already been converted.

One of the obstacles in case of DaVinci is removing the setup() callback
from the pdata struct, the only user of which are some davinci boards.

Most boards use the EEPROM to store the MAC address. This series adds
support for cell lookups to the nvmem framework, registers relevant
cells for all users, converts the davinci_emac driver to using them
and replaces at24_platform_data with device properties.

The only board that's still using this callback is now mityomapl138.
Unfortunately it stores more info in EEPROM than just the MAC address
and will require some more work. Unfortunately I don't have access
to this board so I can't test any actual solutions on a live hardware.

Tested on a dm365-evm board.

v1 -> v2:
- for backward compatiblity: fall back to using of_get_mac_address() if
  we can't get an nvmem cell in patch 7
- add patch 15 which removes dead code

v2 -> v3:
- documented new nvmem cell lookup API
- renamed the nvmem cell lookup routines
- added a function for removing the lookup tables
- in order to completly remove the mac_addr from davinci's soc_info
  added a patch that moves reading the MAC address from SPI to the emac
  driver
- removed more dead code

v3 -> v4:
- only return -EPROBE_DEFER from nvmem_cell_from_lookup() if we have
  a matching lookup entry but no corresponding nvmem device yet, return
  -ENOENT if we can't match the lookup
- check for -EPROBE_DEFER in the emac driver
- put the mtd device after reading the MAC address

Bartosz Golaszewski (18):
  nvmem: add support for cell lookups
  Documentation: nvmem: document lookup entries
  ARM: davinci: dm365-evm: use nvmem lookup for mac address
  ARM: davinci: dm644-evm: use nvmem lookup for mac address
  ARM: davinci: dm646x-evm: use nvmem lookup for mac address
  ARM: davinci: da830-evm: use nvmem lookup for mac address
  ARM: davinci: mityomapl138: add nvmem cells lookup entries
  net: davinci_emac: potentially get the MAC address from MTD
  ARM: davinci: da850-evm: remove dead MTD code
  net: davinci_emac: use nvmem to retrieve the mac address
  ARM: davinci: mityomapl138: don't read the MAC address from machine
    code
  ARM: davinci: dm365-evm: use device properties for at24 eeprom
  ARM: davinci: da830-evm: use device properties for at24 eeprom
  ARM: davinci: dm644x-evm: use device properties for at24 eeprom
  ARM: davinci: dm646x-evm: use device properties for at24 eeprom
  ARM: davinci: sffsdr: fix the at24 eeprom device name
  ARM: davinci: sffsdr: use device properties for at24 eeprom
  ARM: davinci: remove dead code related to MAC address reading

 Documentation/nvmem/nvmem.txt              | 28 ++++++++
 arch/arm/mach-davinci/board-da830-evm.c    | 25 ++++---
 arch/arm/mach-davinci/board-da850-evm.c    | 28 --------
 arch/arm/mach-davinci/board-dm365-evm.c    | 25 ++++---
 arch/arm/mach-davinci/board-dm644x-evm.c   | 24 ++++---
 arch/arm/mach-davinci/board-dm646x-evm.c   | 25 ++++---
 arch/arm/mach-davinci/board-mityomapl138.c | 30 ++++++---
 arch/arm/mach-davinci/board-sffsdr.c       | 13 ++--
 arch/arm/mach-davinci/common.c             | 15 -----
 drivers/net/ethernet/ti/davinci_emac.c     | 53 ++++++++++++---
 drivers/nvmem/core.c                       | 77 +++++++++++++++++++++-
 include/linux/davinci_emac.h               |  2 -
 include/linux/nvmem-consumer.h             |  6 ++
 include/linux/nvmem-provider.h             | 10 +++
 14 files changed, 258 insertions(+), 103 deletions(-)

-- 
2.17.1


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

* [PATCH v4 00/18] ARM: davinci: step towards removing at24_platform_data
@ 2018-06-29  9:40 ` Bartosz Golaszewski
  0 siblings, 0 replies; 98+ messages in thread
From: Bartosz Golaszewski @ 2018-06-29  9:40 UTC (permalink / raw)
  To: linux-arm-kernel

From: Bartosz Golaszewski <bgolaszewski@baylibre.com>

Since I took over maintainership of the at24 driver I've been working
towards removing at24_platform_data in favor for device properties.

DaVinci is the only platform that's still using it - all other users
have already been converted.

One of the obstacles in case of DaVinci is removing the setup() callback
from the pdata struct, the only user of which are some davinci boards.

Most boards use the EEPROM to store the MAC address. This series adds
support for cell lookups to the nvmem framework, registers relevant
cells for all users, converts the davinci_emac driver to using them
and replaces at24_platform_data with device properties.

The only board that's still using this callback is now mityomapl138.
Unfortunately it stores more info in EEPROM than just the MAC address
and will require some more work. Unfortunately I don't have access
to this board so I can't test any actual solutions on a live hardware.

Tested on a dm365-evm board.

v1 -> v2:
- for backward compatiblity: fall back to using of_get_mac_address() if
  we can't get an nvmem cell in patch 7
- add patch 15 which removes dead code

v2 -> v3:
- documented new nvmem cell lookup API
- renamed the nvmem cell lookup routines
- added a function for removing the lookup tables
- in order to completly remove the mac_addr from davinci's soc_info
  added a patch that moves reading the MAC address from SPI to the emac
  driver
- removed more dead code

v3 -> v4:
- only return -EPROBE_DEFER from nvmem_cell_from_lookup() if we have
  a matching lookup entry but no corresponding nvmem device yet, return
  -ENOENT if we can't match the lookup
- check for -EPROBE_DEFER in the emac driver
- put the mtd device after reading the MAC address

Bartosz Golaszewski (18):
  nvmem: add support for cell lookups
  Documentation: nvmem: document lookup entries
  ARM: davinci: dm365-evm: use nvmem lookup for mac address
  ARM: davinci: dm644-evm: use nvmem lookup for mac address
  ARM: davinci: dm646x-evm: use nvmem lookup for mac address
  ARM: davinci: da830-evm: use nvmem lookup for mac address
  ARM: davinci: mityomapl138: add nvmem cells lookup entries
  net: davinci_emac: potentially get the MAC address from MTD
  ARM: davinci: da850-evm: remove dead MTD code
  net: davinci_emac: use nvmem to retrieve the mac address
  ARM: davinci: mityomapl138: don't read the MAC address from machine
    code
  ARM: davinci: dm365-evm: use device properties for at24 eeprom
  ARM: davinci: da830-evm: use device properties for at24 eeprom
  ARM: davinci: dm644x-evm: use device properties for at24 eeprom
  ARM: davinci: dm646x-evm: use device properties for at24 eeprom
  ARM: davinci: sffsdr: fix the at24 eeprom device name
  ARM: davinci: sffsdr: use device properties for at24 eeprom
  ARM: davinci: remove dead code related to MAC address reading

 Documentation/nvmem/nvmem.txt              | 28 ++++++++
 arch/arm/mach-davinci/board-da830-evm.c    | 25 ++++---
 arch/arm/mach-davinci/board-da850-evm.c    | 28 --------
 arch/arm/mach-davinci/board-dm365-evm.c    | 25 ++++---
 arch/arm/mach-davinci/board-dm644x-evm.c   | 24 ++++---
 arch/arm/mach-davinci/board-dm646x-evm.c   | 25 ++++---
 arch/arm/mach-davinci/board-mityomapl138.c | 30 ++++++---
 arch/arm/mach-davinci/board-sffsdr.c       | 13 ++--
 arch/arm/mach-davinci/common.c             | 15 -----
 drivers/net/ethernet/ti/davinci_emac.c     | 53 ++++++++++++---
 drivers/nvmem/core.c                       | 77 +++++++++++++++++++++-
 include/linux/davinci_emac.h               |  2 -
 include/linux/nvmem-consumer.h             |  6 ++
 include/linux/nvmem-provider.h             | 10 +++
 14 files changed, 258 insertions(+), 103 deletions(-)

-- 
2.17.1

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

* [PATCH v4 01/18] nvmem: add support for cell lookups
  2018-06-29  9:40 ` Bartosz Golaszewski
  (?)
@ 2018-06-29  9:40   ` Bartosz Golaszewski
  -1 siblings, 0 replies; 98+ messages in thread
From: Bartosz Golaszewski @ 2018-06-29  9:40 UTC (permalink / raw)
  To: Sekhar Nori, Kevin Hilman, Russell King, Grygorii Strashko,
	David S . Miller, Srinivas Kandagatla, Lukas Wunner, Rob Herring,
	Florian Fainelli, Dan Carpenter, Ivan Khoronzhuk, David Lechner,
	Greg Kroah-Hartman, Andrew Lunn, Jonathan Corbet
  Cc: linux-arm-kernel, linux-kernel, linux-omap, netdev, Bartosz Golaszewski

From: Bartosz Golaszewski <bgolaszewski@baylibre.com>

We can currently only register nvmem cells from device tree or by
manually calling nvmem_add_cells(). The latter options however forces
users to make sure that the nvmem provider with which the cells are
associated is registered before the call.

This patch proposes a new solution inspired by other frameworks that
offer resource lookups (GPIO, PWM etc.). It adds functions that allow
machine code to register nvmem lookup which are later lazily used to
add corresponding nvmem cells and remove them if no longer needed.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
---
 drivers/nvmem/core.c           | 77 +++++++++++++++++++++++++++++++++-
 include/linux/nvmem-consumer.h |  6 +++
 include/linux/nvmem-provider.h | 10 +++++
 3 files changed, 92 insertions(+), 1 deletion(-)

diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c
index b5b0cdc21d01..2495550cbbc4 100644
--- a/drivers/nvmem/core.c
+++ b/drivers/nvmem/core.c
@@ -62,6 +62,9 @@ static DEFINE_IDA(nvmem_ida);
 static LIST_HEAD(nvmem_cells);
 static DEFINE_MUTEX(nvmem_cells_mutex);
 
+static LIST_HEAD(nvmem_cell_lookups);
+static DEFINE_MUTEX(nvmem_lookup_mutex);
+
 #ifdef CONFIG_DEBUG_LOCK_ALLOC
 static struct lock_class_key eeprom_lock_key;
 #endif
@@ -247,6 +250,41 @@ static const struct attribute_group *nvmem_ro_root_dev_groups[] = {
 	NULL,
 };
 
+/**
+ * nvmem_add_lookup_table() - register a number of nvmem cell lookup entries
+ *
+ * @lookup: array of nvmem cell lookup entries
+ * @nentries: number of lookup entries in the array
+ */
+void nvmem_add_lookup_table(struct nvmem_cell_lookup *lookup, size_t nentries)
+{
+	int i;
+
+	mutex_lock(&nvmem_lookup_mutex);
+	for (i = 0; i < nentries; i++)
+		list_add_tail(&lookup[i].list, &nvmem_cell_lookups);
+	mutex_unlock(&nvmem_lookup_mutex);
+}
+EXPORT_SYMBOL_GPL(nvmem_add_lookup_table);
+
+/**
+ * nvmem_del_lookup_table() - unregister a set of previously added nvmem cell
+ *                            lookup entries
+ *
+ * @lookup: array of nvmem cell lookup entries
+ * @nentries: number of lookup entries in the array
+ */
+void nvmem_del_lookup_table(struct nvmem_cell_lookup *lookup, size_t nentries)
+{
+	int i;
+
+	mutex_lock(&nvmem_lookup_mutex);
+	for (i = 0; i < nentries; i++)
+		list_del(&lookup[i].list);
+	mutex_unlock(&nvmem_lookup_mutex);
+}
+EXPORT_SYMBOL_GPL(nvmem_del_lookup_table);
+
 static void nvmem_release(struct device *dev)
 {
 	struct nvmem_device *nvmem = to_nvmem_device(dev);
@@ -916,6 +954,39 @@ struct nvmem_cell *of_nvmem_cell_get(struct device_node *np,
 EXPORT_SYMBOL_GPL(of_nvmem_cell_get);
 #endif
 
+static struct nvmem_cell *nvmem_cell_from_lookup(const char *cell_id)
+{
+	struct nvmem_cell *cell = ERR_PTR(-ENOENT);
+	struct nvmem_cell_lookup *lookup;
+	struct nvmem_device *nvmem;
+	int rc;
+
+	mutex_lock(&nvmem_lookup_mutex);
+
+	list_for_each_entry(lookup, &nvmem_cell_lookups, list) {
+		if (strcmp(cell_id, lookup->info.name) == 0) {
+			nvmem = nvmem_find(lookup->nvmem_name);
+			if (!nvmem) {
+				cell = ERR_PTR(-EPROBE_DEFER);
+				goto out;
+			}
+
+			rc = nvmem_add_cells(nvmem, &lookup->info, 1);
+			if (rc) {
+				cell = ERR_PTR(rc);
+				goto out;
+			}
+
+			cell = nvmem_cell_get_from_list(cell_id);
+			break;
+		}
+	}
+
+out:
+	mutex_unlock(&nvmem_lookup_mutex);
+	return cell;
+}
+
 /**
  * nvmem_cell_get() - Get nvmem cell of device form a given cell name
  *
@@ -936,7 +1007,11 @@ struct nvmem_cell *nvmem_cell_get(struct device *dev, const char *cell_id)
 			return cell;
 	}
 
-	return nvmem_cell_get_from_list(cell_id);
+	cell = nvmem_cell_get_from_list(cell_id);
+	if (!IS_ERR(cell) || PTR_ERR(cell) == -EPROBE_DEFER)
+		return cell;
+
+	return nvmem_cell_from_lookup(cell_id);
 }
 EXPORT_SYMBOL_GPL(nvmem_cell_get);
 
diff --git a/include/linux/nvmem-consumer.h b/include/linux/nvmem-consumer.h
index 4e85447f7860..f4b5d3186e94 100644
--- a/include/linux/nvmem-consumer.h
+++ b/include/linux/nvmem-consumer.h
@@ -29,6 +29,12 @@ struct nvmem_cell_info {
 	unsigned int		nbits;
 };
 
+struct nvmem_cell_lookup {
+	struct nvmem_cell_info	info;
+	struct list_head	list;
+	const char		*nvmem_name;
+};
+
 #if IS_ENABLED(CONFIG_NVMEM)
 
 /* Cell based interface */
diff --git a/include/linux/nvmem-provider.h b/include/linux/nvmem-provider.h
index 24def6ad09bb..6a17d722062b 100644
--- a/include/linux/nvmem-provider.h
+++ b/include/linux/nvmem-provider.h
@@ -17,6 +17,7 @@
 
 struct nvmem_device;
 struct nvmem_cell_info;
+struct nvmem_cell_lookup;
 typedef int (*nvmem_reg_read_t)(void *priv, unsigned int offset,
 				void *val, size_t bytes);
 typedef int (*nvmem_reg_write_t)(void *priv, unsigned int offset,
@@ -72,6 +73,9 @@ struct nvmem_config {
 struct nvmem_device *nvmem_register(const struct nvmem_config *cfg);
 int nvmem_unregister(struct nvmem_device *nvmem);
 
+void nvmem_add_lookup_table(struct nvmem_cell_lookup *lookup, size_t nentries);
+void nvmem_del_lookup_table(struct nvmem_cell_lookup *lookup, size_t nentries);
+
 struct nvmem_device *devm_nvmem_register(struct device *dev,
 					 const struct nvmem_config *cfg);
 
@@ -92,6 +96,12 @@ static inline int nvmem_unregister(struct nvmem_device *nvmem)
 	return -ENOSYS;
 }
 
+static inline void
+nvmem_add_lookup_table(struct nvmem_cell_lookup *lookup, size_t nentries) {}
+
+static inline void
+nvmem_del_lookup_table(struct nvmem_cell_lookup *lookup, size_t nentries) {}
+
 static inline struct nvmem_device *
 devm_nvmem_register(struct device *dev, const struct nvmem_config *c)
 {
-- 
2.17.1


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

* [PATCH v4 01/18] nvmem: add support for cell lookups
@ 2018-06-29  9:40   ` Bartosz Golaszewski
  0 siblings, 0 replies; 98+ messages in thread
From: Bartosz Golaszewski @ 2018-06-29  9:40 UTC (permalink / raw)
  To: Sekhar Nori, Kevin Hilman, Russell King, Grygorii Strashko,
	David S . Miller, Srinivas Kandagatla, Lukas Wunner, Rob Herring,
	Florian Fainelli, Dan Carpenter, Ivan Khoronzhuk, David Lechner,
	Greg Kroah-Hartman, Andrew Lunn, Jonathan Corbet
  Cc: netdev, linux-omap, linux-kernel, linux-arm-kernel, Bartosz Golaszewski

From: Bartosz Golaszewski <bgolaszewski@baylibre.com>

We can currently only register nvmem cells from device tree or by
manually calling nvmem_add_cells(). The latter options however forces
users to make sure that the nvmem provider with which the cells are
associated is registered before the call.

This patch proposes a new solution inspired by other frameworks that
offer resource lookups (GPIO, PWM etc.). It adds functions that allow
machine code to register nvmem lookup which are later lazily used to
add corresponding nvmem cells and remove them if no longer needed.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
---
 drivers/nvmem/core.c           | 77 +++++++++++++++++++++++++++++++++-
 include/linux/nvmem-consumer.h |  6 +++
 include/linux/nvmem-provider.h | 10 +++++
 3 files changed, 92 insertions(+), 1 deletion(-)

diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c
index b5b0cdc21d01..2495550cbbc4 100644
--- a/drivers/nvmem/core.c
+++ b/drivers/nvmem/core.c
@@ -62,6 +62,9 @@ static DEFINE_IDA(nvmem_ida);
 static LIST_HEAD(nvmem_cells);
 static DEFINE_MUTEX(nvmem_cells_mutex);
 
+static LIST_HEAD(nvmem_cell_lookups);
+static DEFINE_MUTEX(nvmem_lookup_mutex);
+
 #ifdef CONFIG_DEBUG_LOCK_ALLOC
 static struct lock_class_key eeprom_lock_key;
 #endif
@@ -247,6 +250,41 @@ static const struct attribute_group *nvmem_ro_root_dev_groups[] = {
 	NULL,
 };
 
+/**
+ * nvmem_add_lookup_table() - register a number of nvmem cell lookup entries
+ *
+ * @lookup: array of nvmem cell lookup entries
+ * @nentries: number of lookup entries in the array
+ */
+void nvmem_add_lookup_table(struct nvmem_cell_lookup *lookup, size_t nentries)
+{
+	int i;
+
+	mutex_lock(&nvmem_lookup_mutex);
+	for (i = 0; i < nentries; i++)
+		list_add_tail(&lookup[i].list, &nvmem_cell_lookups);
+	mutex_unlock(&nvmem_lookup_mutex);
+}
+EXPORT_SYMBOL_GPL(nvmem_add_lookup_table);
+
+/**
+ * nvmem_del_lookup_table() - unregister a set of previously added nvmem cell
+ *                            lookup entries
+ *
+ * @lookup: array of nvmem cell lookup entries
+ * @nentries: number of lookup entries in the array
+ */
+void nvmem_del_lookup_table(struct nvmem_cell_lookup *lookup, size_t nentries)
+{
+	int i;
+
+	mutex_lock(&nvmem_lookup_mutex);
+	for (i = 0; i < nentries; i++)
+		list_del(&lookup[i].list);
+	mutex_unlock(&nvmem_lookup_mutex);
+}
+EXPORT_SYMBOL_GPL(nvmem_del_lookup_table);
+
 static void nvmem_release(struct device *dev)
 {
 	struct nvmem_device *nvmem = to_nvmem_device(dev);
@@ -916,6 +954,39 @@ struct nvmem_cell *of_nvmem_cell_get(struct device_node *np,
 EXPORT_SYMBOL_GPL(of_nvmem_cell_get);
 #endif
 
+static struct nvmem_cell *nvmem_cell_from_lookup(const char *cell_id)
+{
+	struct nvmem_cell *cell = ERR_PTR(-ENOENT);
+	struct nvmem_cell_lookup *lookup;
+	struct nvmem_device *nvmem;
+	int rc;
+
+	mutex_lock(&nvmem_lookup_mutex);
+
+	list_for_each_entry(lookup, &nvmem_cell_lookups, list) {
+		if (strcmp(cell_id, lookup->info.name) == 0) {
+			nvmem = nvmem_find(lookup->nvmem_name);
+			if (!nvmem) {
+				cell = ERR_PTR(-EPROBE_DEFER);
+				goto out;
+			}
+
+			rc = nvmem_add_cells(nvmem, &lookup->info, 1);
+			if (rc) {
+				cell = ERR_PTR(rc);
+				goto out;
+			}
+
+			cell = nvmem_cell_get_from_list(cell_id);
+			break;
+		}
+	}
+
+out:
+	mutex_unlock(&nvmem_lookup_mutex);
+	return cell;
+}
+
 /**
  * nvmem_cell_get() - Get nvmem cell of device form a given cell name
  *
@@ -936,7 +1007,11 @@ struct nvmem_cell *nvmem_cell_get(struct device *dev, const char *cell_id)
 			return cell;
 	}
 
-	return nvmem_cell_get_from_list(cell_id);
+	cell = nvmem_cell_get_from_list(cell_id);
+	if (!IS_ERR(cell) || PTR_ERR(cell) == -EPROBE_DEFER)
+		return cell;
+
+	return nvmem_cell_from_lookup(cell_id);
 }
 EXPORT_SYMBOL_GPL(nvmem_cell_get);
 
diff --git a/include/linux/nvmem-consumer.h b/include/linux/nvmem-consumer.h
index 4e85447f7860..f4b5d3186e94 100644
--- a/include/linux/nvmem-consumer.h
+++ b/include/linux/nvmem-consumer.h
@@ -29,6 +29,12 @@ struct nvmem_cell_info {
 	unsigned int		nbits;
 };
 
+struct nvmem_cell_lookup {
+	struct nvmem_cell_info	info;
+	struct list_head	list;
+	const char		*nvmem_name;
+};
+
 #if IS_ENABLED(CONFIG_NVMEM)
 
 /* Cell based interface */
diff --git a/include/linux/nvmem-provider.h b/include/linux/nvmem-provider.h
index 24def6ad09bb..6a17d722062b 100644
--- a/include/linux/nvmem-provider.h
+++ b/include/linux/nvmem-provider.h
@@ -17,6 +17,7 @@
 
 struct nvmem_device;
 struct nvmem_cell_info;
+struct nvmem_cell_lookup;
 typedef int (*nvmem_reg_read_t)(void *priv, unsigned int offset,
 				void *val, size_t bytes);
 typedef int (*nvmem_reg_write_t)(void *priv, unsigned int offset,
@@ -72,6 +73,9 @@ struct nvmem_config {
 struct nvmem_device *nvmem_register(const struct nvmem_config *cfg);
 int nvmem_unregister(struct nvmem_device *nvmem);
 
+void nvmem_add_lookup_table(struct nvmem_cell_lookup *lookup, size_t nentries);
+void nvmem_del_lookup_table(struct nvmem_cell_lookup *lookup, size_t nentries);
+
 struct nvmem_device *devm_nvmem_register(struct device *dev,
 					 const struct nvmem_config *cfg);
 
@@ -92,6 +96,12 @@ static inline int nvmem_unregister(struct nvmem_device *nvmem)
 	return -ENOSYS;
 }
 
+static inline void
+nvmem_add_lookup_table(struct nvmem_cell_lookup *lookup, size_t nentries) {}
+
+static inline void
+nvmem_del_lookup_table(struct nvmem_cell_lookup *lookup, size_t nentries) {}
+
 static inline struct nvmem_device *
 devm_nvmem_register(struct device *dev, const struct nvmem_config *c)
 {
-- 
2.17.1

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

* [PATCH v4 01/18] nvmem: add support for cell lookups
@ 2018-06-29  9:40   ` Bartosz Golaszewski
  0 siblings, 0 replies; 98+ messages in thread
From: Bartosz Golaszewski @ 2018-06-29  9:40 UTC (permalink / raw)
  To: linux-arm-kernel

From: Bartosz Golaszewski <bgolaszewski@baylibre.com>

We can currently only register nvmem cells from device tree or by
manually calling nvmem_add_cells(). The latter options however forces
users to make sure that the nvmem provider with which the cells are
associated is registered before the call.

This patch proposes a new solution inspired by other frameworks that
offer resource lookups (GPIO, PWM etc.). It adds functions that allow
machine code to register nvmem lookup which are later lazily used to
add corresponding nvmem cells and remove them if no longer needed.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
---
 drivers/nvmem/core.c           | 77 +++++++++++++++++++++++++++++++++-
 include/linux/nvmem-consumer.h |  6 +++
 include/linux/nvmem-provider.h | 10 +++++
 3 files changed, 92 insertions(+), 1 deletion(-)

diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c
index b5b0cdc21d01..2495550cbbc4 100644
--- a/drivers/nvmem/core.c
+++ b/drivers/nvmem/core.c
@@ -62,6 +62,9 @@ static DEFINE_IDA(nvmem_ida);
 static LIST_HEAD(nvmem_cells);
 static DEFINE_MUTEX(nvmem_cells_mutex);
 
+static LIST_HEAD(nvmem_cell_lookups);
+static DEFINE_MUTEX(nvmem_lookup_mutex);
+
 #ifdef CONFIG_DEBUG_LOCK_ALLOC
 static struct lock_class_key eeprom_lock_key;
 #endif
@@ -247,6 +250,41 @@ static const struct attribute_group *nvmem_ro_root_dev_groups[] = {
 	NULL,
 };
 
+/**
+ * nvmem_add_lookup_table() - register a number of nvmem cell lookup entries
+ *
+ * @lookup: array of nvmem cell lookup entries
+ * @nentries: number of lookup entries in the array
+ */
+void nvmem_add_lookup_table(struct nvmem_cell_lookup *lookup, size_t nentries)
+{
+	int i;
+
+	mutex_lock(&nvmem_lookup_mutex);
+	for (i = 0; i < nentries; i++)
+		list_add_tail(&lookup[i].list, &nvmem_cell_lookups);
+	mutex_unlock(&nvmem_lookup_mutex);
+}
+EXPORT_SYMBOL_GPL(nvmem_add_lookup_table);
+
+/**
+ * nvmem_del_lookup_table() - unregister a set of previously added nvmem cell
+ *                            lookup entries
+ *
+ * @lookup: array of nvmem cell lookup entries
+ * @nentries: number of lookup entries in the array
+ */
+void nvmem_del_lookup_table(struct nvmem_cell_lookup *lookup, size_t nentries)
+{
+	int i;
+
+	mutex_lock(&nvmem_lookup_mutex);
+	for (i = 0; i < nentries; i++)
+		list_del(&lookup[i].list);
+	mutex_unlock(&nvmem_lookup_mutex);
+}
+EXPORT_SYMBOL_GPL(nvmem_del_lookup_table);
+
 static void nvmem_release(struct device *dev)
 {
 	struct nvmem_device *nvmem = to_nvmem_device(dev);
@@ -916,6 +954,39 @@ struct nvmem_cell *of_nvmem_cell_get(struct device_node *np,
 EXPORT_SYMBOL_GPL(of_nvmem_cell_get);
 #endif
 
+static struct nvmem_cell *nvmem_cell_from_lookup(const char *cell_id)
+{
+	struct nvmem_cell *cell = ERR_PTR(-ENOENT);
+	struct nvmem_cell_lookup *lookup;
+	struct nvmem_device *nvmem;
+	int rc;
+
+	mutex_lock(&nvmem_lookup_mutex);
+
+	list_for_each_entry(lookup, &nvmem_cell_lookups, list) {
+		if (strcmp(cell_id, lookup->info.name) == 0) {
+			nvmem = nvmem_find(lookup->nvmem_name);
+			if (!nvmem) {
+				cell = ERR_PTR(-EPROBE_DEFER);
+				goto out;
+			}
+
+			rc = nvmem_add_cells(nvmem, &lookup->info, 1);
+			if (rc) {
+				cell = ERR_PTR(rc);
+				goto out;
+			}
+
+			cell = nvmem_cell_get_from_list(cell_id);
+			break;
+		}
+	}
+
+out:
+	mutex_unlock(&nvmem_lookup_mutex);
+	return cell;
+}
+
 /**
  * nvmem_cell_get() - Get nvmem cell of device form a given cell name
  *
@@ -936,7 +1007,11 @@ struct nvmem_cell *nvmem_cell_get(struct device *dev, const char *cell_id)
 			return cell;
 	}
 
-	return nvmem_cell_get_from_list(cell_id);
+	cell = nvmem_cell_get_from_list(cell_id);
+	if (!IS_ERR(cell) || PTR_ERR(cell) == -EPROBE_DEFER)
+		return cell;
+
+	return nvmem_cell_from_lookup(cell_id);
 }
 EXPORT_SYMBOL_GPL(nvmem_cell_get);
 
diff --git a/include/linux/nvmem-consumer.h b/include/linux/nvmem-consumer.h
index 4e85447f7860..f4b5d3186e94 100644
--- a/include/linux/nvmem-consumer.h
+++ b/include/linux/nvmem-consumer.h
@@ -29,6 +29,12 @@ struct nvmem_cell_info {
 	unsigned int		nbits;
 };
 
+struct nvmem_cell_lookup {
+	struct nvmem_cell_info	info;
+	struct list_head	list;
+	const char		*nvmem_name;
+};
+
 #if IS_ENABLED(CONFIG_NVMEM)
 
 /* Cell based interface */
diff --git a/include/linux/nvmem-provider.h b/include/linux/nvmem-provider.h
index 24def6ad09bb..6a17d722062b 100644
--- a/include/linux/nvmem-provider.h
+++ b/include/linux/nvmem-provider.h
@@ -17,6 +17,7 @@
 
 struct nvmem_device;
 struct nvmem_cell_info;
+struct nvmem_cell_lookup;
 typedef int (*nvmem_reg_read_t)(void *priv, unsigned int offset,
 				void *val, size_t bytes);
 typedef int (*nvmem_reg_write_t)(void *priv, unsigned int offset,
@@ -72,6 +73,9 @@ struct nvmem_config {
 struct nvmem_device *nvmem_register(const struct nvmem_config *cfg);
 int nvmem_unregister(struct nvmem_device *nvmem);
 
+void nvmem_add_lookup_table(struct nvmem_cell_lookup *lookup, size_t nentries);
+void nvmem_del_lookup_table(struct nvmem_cell_lookup *lookup, size_t nentries);
+
 struct nvmem_device *devm_nvmem_register(struct device *dev,
 					 const struct nvmem_config *cfg);
 
@@ -92,6 +96,12 @@ static inline int nvmem_unregister(struct nvmem_device *nvmem)
 	return -ENOSYS;
 }
 
+static inline void
+nvmem_add_lookup_table(struct nvmem_cell_lookup *lookup, size_t nentries) {}
+
+static inline void
+nvmem_del_lookup_table(struct nvmem_cell_lookup *lookup, size_t nentries) {}
+
 static inline struct nvmem_device *
 devm_nvmem_register(struct device *dev, const struct nvmem_config *c)
 {
-- 
2.17.1

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

* [PATCH v4 02/18] Documentation: nvmem: document lookup entries
  2018-06-29  9:40 ` Bartosz Golaszewski
@ 2018-06-29  9:40   ` Bartosz Golaszewski
  -1 siblings, 0 replies; 98+ messages in thread
From: Bartosz Golaszewski @ 2018-06-29  9:40 UTC (permalink / raw)
  To: Sekhar Nori, Kevin Hilman, Russell King, Grygorii Strashko,
	David S . Miller, Srinivas Kandagatla, Lukas Wunner, Rob Herring,
	Florian Fainelli, Dan Carpenter, Ivan Khoronzhuk, David Lechner,
	Greg Kroah-Hartman, Andrew Lunn, Jonathan Corbet
  Cc: linux-arm-kernel, linux-kernel, linux-omap, netdev, Bartosz Golaszewski

From: Bartosz Golaszewski <bgolaszewski@baylibre.com>

Describe the usage of nvmem cell lookup tables.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
---
 Documentation/nvmem/nvmem.txt | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)

diff --git a/Documentation/nvmem/nvmem.txt b/Documentation/nvmem/nvmem.txt
index 8d8d8f58f96f..9d5e3ca2b4f3 100644
--- a/Documentation/nvmem/nvmem.txt
+++ b/Documentation/nvmem/nvmem.txt
@@ -58,6 +58,34 @@ static int qfprom_probe(struct platform_device *pdev)
 It is mandatory that the NVMEM provider has a regmap associated with its
 struct device. Failure to do would return error code from nvmem_register().
 
+Additionally it is possible to create nvmem cell lookup entries and register
+them with the nvmem framework from machine code as shown in the example below:
+
+static struct nvmem_cell_lookup foobar_lookup = {
+	.info = {
+		.name = "mac-address",
+		.offset = 0xd000,
+		.bytes = ERH_ALEN,
+	},
+	.nvmem_name = "foobar",
+};
+
+static void foobar_register(void)
+{
+	...
+	nvmem_add_lookup_table(&foobar_lookup, 1);
+	...
+}
+
+A lookup entry table can be later removed if needed:
+
+static void foobar_fini(void)
+{
+	...
+	nvmem_del_lookup_table(&foobar_lookup, 1);
+	...
+}
+
 NVMEM Consumers
 +++++++++++++++
 
-- 
2.17.1


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

* [PATCH v4 02/18] Documentation: nvmem: document lookup entries
@ 2018-06-29  9:40   ` Bartosz Golaszewski
  0 siblings, 0 replies; 98+ messages in thread
From: Bartosz Golaszewski @ 2018-06-29  9:40 UTC (permalink / raw)
  To: linux-arm-kernel

From: Bartosz Golaszewski <bgolaszewski@baylibre.com>

Describe the usage of nvmem cell lookup tables.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
---
 Documentation/nvmem/nvmem.txt | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)

diff --git a/Documentation/nvmem/nvmem.txt b/Documentation/nvmem/nvmem.txt
index 8d8d8f58f96f..9d5e3ca2b4f3 100644
--- a/Documentation/nvmem/nvmem.txt
+++ b/Documentation/nvmem/nvmem.txt
@@ -58,6 +58,34 @@ static int qfprom_probe(struct platform_device *pdev)
 It is mandatory that the NVMEM provider has a regmap associated with its
 struct device. Failure to do would return error code from nvmem_register().
 
+Additionally it is possible to create nvmem cell lookup entries and register
+them with the nvmem framework from machine code as shown in the example below:
+
+static struct nvmem_cell_lookup foobar_lookup = {
+	.info = {
+		.name = "mac-address",
+		.offset = 0xd000,
+		.bytes = ERH_ALEN,
+	},
+	.nvmem_name = "foobar",
+};
+
+static void foobar_register(void)
+{
+	...
+	nvmem_add_lookup_table(&foobar_lookup, 1);
+	...
+}
+
+A lookup entry table can be later removed if needed:
+
+static void foobar_fini(void)
+{
+	...
+	nvmem_del_lookup_table(&foobar_lookup, 1);
+	...
+}
+
 NVMEM Consumers
 +++++++++++++++
 
-- 
2.17.1

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

* [PATCH v4 03/18] ARM: davinci: dm365-evm: use nvmem lookup for mac address
  2018-06-29  9:40 ` Bartosz Golaszewski
  (?)
@ 2018-06-29  9:40   ` Bartosz Golaszewski
  -1 siblings, 0 replies; 98+ messages in thread
From: Bartosz Golaszewski @ 2018-06-29  9:40 UTC (permalink / raw)
  To: Sekhar Nori, Kevin Hilman, Russell King, Grygorii Strashko,
	David S . Miller, Srinivas Kandagatla, Lukas Wunner, Rob Herring,
	Florian Fainelli, Dan Carpenter, Ivan Khoronzhuk, David Lechner,
	Greg Kroah-Hartman, Andrew Lunn, Jonathan Corbet
  Cc: linux-arm-kernel, linux-kernel, linux-omap, netdev, Bartosz Golaszewski

From: Bartosz Golaszewski <bgolaszewski@baylibre.com>

We now support nvmem lookups for machine code. Add a lookup for
mac-address.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
---
 arch/arm/mach-davinci/board-dm365-evm.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/arch/arm/mach-davinci/board-dm365-evm.c b/arch/arm/mach-davinci/board-dm365-evm.c
index 435f7ec7d9af..cb0ac92a278e 100644
--- a/arch/arm/mach-davinci/board-dm365-evm.c
+++ b/arch/arm/mach-davinci/board-dm365-evm.c
@@ -28,6 +28,7 @@
 #include <linux/spi/spi.h>
 #include <linux/spi/eeprom.h>
 #include <linux/v4l2-dv-timings.h>
+#include <linux/nvmem-provider.h>
 
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
@@ -169,6 +170,15 @@ static struct platform_device davinci_nand_device = {
 	},
 };
 
+static struct nvmem_cell_lookup dm365evm_mac_address_cell = {
+	.info = {
+		.name = "mac-address",
+		.offset = 0x7f00,
+		.bytes = ETH_ALEN,
+	},
+	.nvmem_name = "1-00500",
+};
+
 static struct at24_platform_data eeprom_info = {
 	.byte_len       = (256*1024) / 8,
 	.page_size      = 64,
@@ -769,6 +779,8 @@ static __init void dm365_evm_init(void)
 
 	dm365_init_spi0(BIT(0), dm365_evm_spi_info,
 			ARRAY_SIZE(dm365_evm_spi_info));
+
+	nvmem_add_lookup_table(&dm365evm_mac_address_cell, 1);
 }
 
 MACHINE_START(DAVINCI_DM365_EVM, "DaVinci DM365 EVM")
-- 
2.17.1


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

* [PATCH v4 03/18] ARM: davinci: dm365-evm: use nvmem lookup for mac address
@ 2018-06-29  9:40   ` Bartosz Golaszewski
  0 siblings, 0 replies; 98+ messages in thread
From: Bartosz Golaszewski @ 2018-06-29  9:40 UTC (permalink / raw)
  To: Sekhar Nori, Kevin Hilman, Russell King, Grygorii Strashko,
	David S . Miller, Srinivas Kandagatla, Lukas Wunner, Rob Herring,
	Florian Fainelli, Dan Carpenter, Ivan Khoronzhuk, David Lechner,
	Greg Kroah-Hartman, Andrew Lunn, Jonathan Corbet
  Cc: netdev, linux-omap, linux-kernel, linux-arm-kernel, Bartosz Golaszewski

From: Bartosz Golaszewski <bgolaszewski@baylibre.com>

We now support nvmem lookups for machine code. Add a lookup for
mac-address.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
---
 arch/arm/mach-davinci/board-dm365-evm.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/arch/arm/mach-davinci/board-dm365-evm.c b/arch/arm/mach-davinci/board-dm365-evm.c
index 435f7ec7d9af..cb0ac92a278e 100644
--- a/arch/arm/mach-davinci/board-dm365-evm.c
+++ b/arch/arm/mach-davinci/board-dm365-evm.c
@@ -28,6 +28,7 @@
 #include <linux/spi/spi.h>
 #include <linux/spi/eeprom.h>
 #include <linux/v4l2-dv-timings.h>
+#include <linux/nvmem-provider.h>
 
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
@@ -169,6 +170,15 @@ static struct platform_device davinci_nand_device = {
 	},
 };
 
+static struct nvmem_cell_lookup dm365evm_mac_address_cell = {
+	.info = {
+		.name = "mac-address",
+		.offset = 0x7f00,
+		.bytes = ETH_ALEN,
+	},
+	.nvmem_name = "1-00500",
+};
+
 static struct at24_platform_data eeprom_info = {
 	.byte_len       = (256*1024) / 8,
 	.page_size      = 64,
@@ -769,6 +779,8 @@ static __init void dm365_evm_init(void)
 
 	dm365_init_spi0(BIT(0), dm365_evm_spi_info,
 			ARRAY_SIZE(dm365_evm_spi_info));
+
+	nvmem_add_lookup_table(&dm365evm_mac_address_cell, 1);
 }
 
 MACHINE_START(DAVINCI_DM365_EVM, "DaVinci DM365 EVM")
-- 
2.17.1

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

* [PATCH v4 03/18] ARM: davinci: dm365-evm: use nvmem lookup for mac address
@ 2018-06-29  9:40   ` Bartosz Golaszewski
  0 siblings, 0 replies; 98+ messages in thread
From: Bartosz Golaszewski @ 2018-06-29  9:40 UTC (permalink / raw)
  To: linux-arm-kernel

From: Bartosz Golaszewski <bgolaszewski@baylibre.com>

We now support nvmem lookups for machine code. Add a lookup for
mac-address.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
---
 arch/arm/mach-davinci/board-dm365-evm.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/arch/arm/mach-davinci/board-dm365-evm.c b/arch/arm/mach-davinci/board-dm365-evm.c
index 435f7ec7d9af..cb0ac92a278e 100644
--- a/arch/arm/mach-davinci/board-dm365-evm.c
+++ b/arch/arm/mach-davinci/board-dm365-evm.c
@@ -28,6 +28,7 @@
 #include <linux/spi/spi.h>
 #include <linux/spi/eeprom.h>
 #include <linux/v4l2-dv-timings.h>
+#include <linux/nvmem-provider.h>
 
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
@@ -169,6 +170,15 @@ static struct platform_device davinci_nand_device = {
 	},
 };
 
+static struct nvmem_cell_lookup dm365evm_mac_address_cell = {
+	.info = {
+		.name = "mac-address",
+		.offset = 0x7f00,
+		.bytes = ETH_ALEN,
+	},
+	.nvmem_name = "1-00500",
+};
+
 static struct at24_platform_data eeprom_info = {
 	.byte_len       = (256*1024) / 8,
 	.page_size      = 64,
@@ -769,6 +779,8 @@ static __init void dm365_evm_init(void)
 
 	dm365_init_spi0(BIT(0), dm365_evm_spi_info,
 			ARRAY_SIZE(dm365_evm_spi_info));
+
+	nvmem_add_lookup_table(&dm365evm_mac_address_cell, 1);
 }
 
 MACHINE_START(DAVINCI_DM365_EVM, "DaVinci DM365 EVM")
-- 
2.17.1

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

* [PATCH v4 04/18] ARM: davinci: dm644-evm: use nvmem lookup for mac address
  2018-06-29  9:40 ` Bartosz Golaszewski
@ 2018-06-29  9:40   ` Bartosz Golaszewski
  -1 siblings, 0 replies; 98+ messages in thread
From: Bartosz Golaszewski @ 2018-06-29  9:40 UTC (permalink / raw)
  To: Sekhar Nori, Kevin Hilman, Russell King, Grygorii Strashko,
	David S . Miller, Srinivas Kandagatla, Lukas Wunner, Rob Herring,
	Florian Fainelli, Dan Carpenter, Ivan Khoronzhuk, David Lechner,
	Greg Kroah-Hartman, Andrew Lunn, Jonathan Corbet
  Cc: linux-arm-kernel, linux-kernel, linux-omap, netdev, Bartosz Golaszewski

From: Bartosz Golaszewski <bgolaszewski@baylibre.com>

We now support nvmem lookups for machine code. Add a lookup for
mac-address.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
---
 arch/arm/mach-davinci/board-dm644x-evm.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/arch/arm/mach-davinci/board-dm644x-evm.c b/arch/arm/mach-davinci/board-dm644x-evm.c
index 48436f74fd71..6d35c6e1b0bd 100644
--- a/arch/arm/mach-davinci/board-dm644x-evm.c
+++ b/arch/arm/mach-davinci/board-dm644x-evm.c
@@ -28,6 +28,7 @@
 #include <linux/v4l2-dv-timings.h>
 #include <linux/export.h>
 #include <linux/leds.h>
+#include <linux/nvmem-provider.h>
 
 #include <media/i2c/tvp514x.h>
 
@@ -476,6 +477,15 @@ static struct pcf857x_platform_data pcf_data_u35 = {
  *  - ... newer boards may have more
  */
 
+static struct nvmem_cell_lookup dm6446evm_mac_address_cell = {
+	.info = {
+		.name = "mac-address",
+		.offset = 0x7f00,
+		.bytes = ETH_ALEN,
+	},
+	.nvmem_name = "1-00500",
+};
+
 static struct at24_platform_data eeprom_info = {
 	.byte_len	= (256*1024) / 8,
 	.page_size	= 64,
@@ -828,6 +838,8 @@ static __init void davinci_evm_init(void)
 		phy_register_fixup_for_uid(LXT971_PHY_ID, LXT971_PHY_MASK,
 						davinci_phy_fixup);
 	}
+
+	nvmem_add_lookup_table(&dm6446evm_mac_address_cell, 1);
 }
 
 MACHINE_START(DAVINCI_EVM, "DaVinci DM644x EVM")
-- 
2.17.1


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

* [PATCH v4 04/18] ARM: davinci: dm644-evm: use nvmem lookup for mac address
@ 2018-06-29  9:40   ` Bartosz Golaszewski
  0 siblings, 0 replies; 98+ messages in thread
From: Bartosz Golaszewski @ 2018-06-29  9:40 UTC (permalink / raw)
  To: linux-arm-kernel

From: Bartosz Golaszewski <bgolaszewski@baylibre.com>

We now support nvmem lookups for machine code. Add a lookup for
mac-address.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
---
 arch/arm/mach-davinci/board-dm644x-evm.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/arch/arm/mach-davinci/board-dm644x-evm.c b/arch/arm/mach-davinci/board-dm644x-evm.c
index 48436f74fd71..6d35c6e1b0bd 100644
--- a/arch/arm/mach-davinci/board-dm644x-evm.c
+++ b/arch/arm/mach-davinci/board-dm644x-evm.c
@@ -28,6 +28,7 @@
 #include <linux/v4l2-dv-timings.h>
 #include <linux/export.h>
 #include <linux/leds.h>
+#include <linux/nvmem-provider.h>
 
 #include <media/i2c/tvp514x.h>
 
@@ -476,6 +477,15 @@ static struct pcf857x_platform_data pcf_data_u35 = {
  *  - ... newer boards may have more
  */
 
+static struct nvmem_cell_lookup dm6446evm_mac_address_cell = {
+	.info = {
+		.name = "mac-address",
+		.offset = 0x7f00,
+		.bytes = ETH_ALEN,
+	},
+	.nvmem_name = "1-00500",
+};
+
 static struct at24_platform_data eeprom_info = {
 	.byte_len	= (256*1024) / 8,
 	.page_size	= 64,
@@ -828,6 +838,8 @@ static __init void davinci_evm_init(void)
 		phy_register_fixup_for_uid(LXT971_PHY_ID, LXT971_PHY_MASK,
 						davinci_phy_fixup);
 	}
+
+	nvmem_add_lookup_table(&dm6446evm_mac_address_cell, 1);
 }
 
 MACHINE_START(DAVINCI_EVM, "DaVinci DM644x EVM")
-- 
2.17.1

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

* [PATCH v4 05/18] ARM: davinci: dm646x-evm: use nvmem lookup for mac address
  2018-06-29  9:40 ` Bartosz Golaszewski
@ 2018-06-29  9:40   ` Bartosz Golaszewski
  -1 siblings, 0 replies; 98+ messages in thread
From: Bartosz Golaszewski @ 2018-06-29  9:40 UTC (permalink / raw)
  To: Sekhar Nori, Kevin Hilman, Russell King, Grygorii Strashko,
	David S . Miller, Srinivas Kandagatla, Lukas Wunner, Rob Herring,
	Florian Fainelli, Dan Carpenter, Ivan Khoronzhuk, David Lechner,
	Greg Kroah-Hartman, Andrew Lunn, Jonathan Corbet
  Cc: linux-arm-kernel, linux-kernel, linux-omap, netdev, Bartosz Golaszewski

From: Bartosz Golaszewski <bgolaszewski@baylibre.com>

We now support nvmem lookups for machine code. Add a lookup for
mac-address.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
---
 arch/arm/mach-davinci/board-dm646x-evm.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/arch/arm/mach-davinci/board-dm646x-evm.c b/arch/arm/mach-davinci/board-dm646x-evm.c
index 584064fdabf5..5a9de47bc8a2 100644
--- a/arch/arm/mach-davinci/board-dm646x-evm.c
+++ b/arch/arm/mach-davinci/board-dm646x-evm.c
@@ -37,6 +37,7 @@
 #include <linux/platform_data/i2c-davinci.h>
 #include <linux/platform_data/mtd-davinci.h>
 #include <linux/platform_data/mtd-davinci-aemif.h>
+#include <linux/nvmem-provider.h>
 
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
@@ -310,6 +311,15 @@ static struct pcf857x_platform_data pcf_data = {
  *  - ... newer boards may have more
  */
 
+static struct nvmem_cell_lookup dm646x_evm_mac_address_cell = {
+	.info = {
+		.name = "mac-address",
+		.offset = 0x7f00,
+		.bytes = ETH_ALEN,
+	},
+	.nvmem_name = "1-00500",
+};
+
 static struct at24_platform_data eeprom_info = {
 	.byte_len       = (256*1024) / 8,
 	.page_size      = 64,
@@ -802,6 +812,8 @@ static __init void evm_init(void)
 		davinci_init_ide();
 
 	soc_info->emac_pdata->phy_id = DM646X_EVM_PHY_ID;
+
+	nvmem_add_lookup_table(&dm646x_evm_mac_address_cell, 1);
 }
 
 MACHINE_START(DAVINCI_DM6467_EVM, "DaVinci DM646x EVM")
-- 
2.17.1


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

* [PATCH v4 05/18] ARM: davinci: dm646x-evm: use nvmem lookup for mac address
@ 2018-06-29  9:40   ` Bartosz Golaszewski
  0 siblings, 0 replies; 98+ messages in thread
From: Bartosz Golaszewski @ 2018-06-29  9:40 UTC (permalink / raw)
  To: linux-arm-kernel

From: Bartosz Golaszewski <bgolaszewski@baylibre.com>

We now support nvmem lookups for machine code. Add a lookup for
mac-address.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
---
 arch/arm/mach-davinci/board-dm646x-evm.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/arch/arm/mach-davinci/board-dm646x-evm.c b/arch/arm/mach-davinci/board-dm646x-evm.c
index 584064fdabf5..5a9de47bc8a2 100644
--- a/arch/arm/mach-davinci/board-dm646x-evm.c
+++ b/arch/arm/mach-davinci/board-dm646x-evm.c
@@ -37,6 +37,7 @@
 #include <linux/platform_data/i2c-davinci.h>
 #include <linux/platform_data/mtd-davinci.h>
 #include <linux/platform_data/mtd-davinci-aemif.h>
+#include <linux/nvmem-provider.h>
 
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
@@ -310,6 +311,15 @@ static struct pcf857x_platform_data pcf_data = {
  *  - ... newer boards may have more
  */
 
+static struct nvmem_cell_lookup dm646x_evm_mac_address_cell = {
+	.info = {
+		.name = "mac-address",
+		.offset = 0x7f00,
+		.bytes = ETH_ALEN,
+	},
+	.nvmem_name = "1-00500",
+};
+
 static struct at24_platform_data eeprom_info = {
 	.byte_len       = (256*1024) / 8,
 	.page_size      = 64,
@@ -802,6 +812,8 @@ static __init void evm_init(void)
 		davinci_init_ide();
 
 	soc_info->emac_pdata->phy_id = DM646X_EVM_PHY_ID;
+
+	nvmem_add_lookup_table(&dm646x_evm_mac_address_cell, 1);
 }
 
 MACHINE_START(DAVINCI_DM6467_EVM, "DaVinci DM646x EVM")
-- 
2.17.1

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

* [PATCH v4 06/18] ARM: davinci: da830-evm: use nvmem lookup for mac address
  2018-06-29  9:40 ` Bartosz Golaszewski
@ 2018-06-29  9:40   ` Bartosz Golaszewski
  -1 siblings, 0 replies; 98+ messages in thread
From: Bartosz Golaszewski @ 2018-06-29  9:40 UTC (permalink / raw)
  To: Sekhar Nori, Kevin Hilman, Russell King, Grygorii Strashko,
	David S . Miller, Srinivas Kandagatla, Lukas Wunner, Rob Herring,
	Florian Fainelli, Dan Carpenter, Ivan Khoronzhuk, David Lechner,
	Greg Kroah-Hartman, Andrew Lunn, Jonathan Corbet
  Cc: linux-arm-kernel, linux-kernel, linux-omap, netdev, Bartosz Golaszewski

From: Bartosz Golaszewski <bgolaszewski@baylibre.com>

We now support nvmem lookups for machine code. Add a lookup for
mac-address.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
---
 arch/arm/mach-davinci/board-da830-evm.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/arch/arm/mach-davinci/board-da830-evm.c b/arch/arm/mach-davinci/board-da830-evm.c
index 14a6fc061744..4a2fe8142a2f 100644
--- a/arch/arm/mach-davinci/board-da830-evm.c
+++ b/arch/arm/mach-davinci/board-da830-evm.c
@@ -29,6 +29,7 @@
 #include <linux/platform_data/spi-davinci.h>
 #include <linux/platform_data/usb-davinci.h>
 #include <linux/regulator/machine.h>
+#include <linux/nvmem-provider.h>
 
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
@@ -409,6 +410,15 @@ static inline void da830_evm_init_lcdc(int mux_mode)
 static inline void da830_evm_init_lcdc(int mux_mode) { }
 #endif
 
+static struct nvmem_cell_lookup da830_evm_mac_address_cell = {
+	.info = {
+		.name = "mac-address",
+		.offset = 0x7f00,
+		.bytes = ETH_ALEN,
+	},
+	.nvmem_name = "1-00500",
+};
+
 static struct at24_platform_data da830_evm_i2c_eeprom_info = {
 	.byte_len	= SZ_256K / 8,
 	.page_size	= 64,
@@ -618,6 +628,8 @@ static __init void da830_evm_init(void)
 		pr_warn("%s: spi 0 registration failed: %d\n", __func__, ret);
 
 	regulator_has_full_constraints();
+
+	nvmem_add_lookup_table(&da830_evm_mac_address_cell, 1);
 }
 
 #ifdef CONFIG_SERIAL_8250_CONSOLE
-- 
2.17.1


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

* [PATCH v4 06/18] ARM: davinci: da830-evm: use nvmem lookup for mac address
@ 2018-06-29  9:40   ` Bartosz Golaszewski
  0 siblings, 0 replies; 98+ messages in thread
From: Bartosz Golaszewski @ 2018-06-29  9:40 UTC (permalink / raw)
  To: linux-arm-kernel

From: Bartosz Golaszewski <bgolaszewski@baylibre.com>

We now support nvmem lookups for machine code. Add a lookup for
mac-address.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
---
 arch/arm/mach-davinci/board-da830-evm.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/arch/arm/mach-davinci/board-da830-evm.c b/arch/arm/mach-davinci/board-da830-evm.c
index 14a6fc061744..4a2fe8142a2f 100644
--- a/arch/arm/mach-davinci/board-da830-evm.c
+++ b/arch/arm/mach-davinci/board-da830-evm.c
@@ -29,6 +29,7 @@
 #include <linux/platform_data/spi-davinci.h>
 #include <linux/platform_data/usb-davinci.h>
 #include <linux/regulator/machine.h>
+#include <linux/nvmem-provider.h>
 
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
@@ -409,6 +410,15 @@ static inline void da830_evm_init_lcdc(int mux_mode)
 static inline void da830_evm_init_lcdc(int mux_mode) { }
 #endif
 
+static struct nvmem_cell_lookup da830_evm_mac_address_cell = {
+	.info = {
+		.name = "mac-address",
+		.offset = 0x7f00,
+		.bytes = ETH_ALEN,
+	},
+	.nvmem_name = "1-00500",
+};
+
 static struct at24_platform_data da830_evm_i2c_eeprom_info = {
 	.byte_len	= SZ_256K / 8,
 	.page_size	= 64,
@@ -618,6 +628,8 @@ static __init void da830_evm_init(void)
 		pr_warn("%s: spi 0 registration failed: %d\n", __func__, ret);
 
 	regulator_has_full_constraints();
+
+	nvmem_add_lookup_table(&da830_evm_mac_address_cell, 1);
 }
 
 #ifdef CONFIG_SERIAL_8250_CONSOLE
-- 
2.17.1

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

* [PATCH v4 07/18] ARM: davinci: mityomapl138: add nvmem cells lookup entries
  2018-06-29  9:40 ` Bartosz Golaszewski
@ 2018-06-29  9:40   ` Bartosz Golaszewski
  -1 siblings, 0 replies; 98+ messages in thread
From: Bartosz Golaszewski @ 2018-06-29  9:40 UTC (permalink / raw)
  To: Sekhar Nori, Kevin Hilman, Russell King, Grygorii Strashko,
	David S . Miller, Srinivas Kandagatla, Lukas Wunner, Rob Herring,
	Florian Fainelli, Dan Carpenter, Ivan Khoronzhuk, David Lechner,
	Greg Kroah-Hartman, Andrew Lunn, Jonathan Corbet
  Cc: linux-arm-kernel, linux-kernel, linux-omap, netdev, Bartosz Golaszewski

From: Bartosz Golaszewski <bgolaszewski@baylibre.com>

We now support nvmem lookups for machine code. Add a lookup for
mac-address.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
---
 arch/arm/mach-davinci/board-mityomapl138.c | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/arch/arm/mach-davinci/board-mityomapl138.c b/arch/arm/mach-davinci/board-mityomapl138.c
index 37b3e48a21d1..b5be51c0451e 100644
--- a/arch/arm/mach-davinci/board-mityomapl138.c
+++ b/arch/arm/mach-davinci/board-mityomapl138.c
@@ -21,6 +21,7 @@
 #include <linux/etherdevice.h>
 #include <linux/spi/spi.h>
 #include <linux/spi/flash.h>
+#include <linux/nvmem-provider.h>
 
 #include <asm/io.h>
 #include <asm/mach-types.h>
@@ -160,6 +161,25 @@ static void read_factory_config(struct nvmem_device *nvmem, void *context)
 	mityomapl138_cpufreq_init(partnum);
 }
 
+static struct nvmem_cell_lookup mityomapl138_nvmem_cells[] = {
+	{
+		.info = {
+			.name = "factory-config",
+			.offset = 0x0,
+			.bytes = sizeof(struct factory_config),
+		},
+		.nvmem_name = "1-00500",
+	},
+	{
+		.info = {
+			.name = "mac-address",
+			.offset = 0x64,
+			.bytes = ETH_ALEN,
+		},
+		.nvmem_name = "1-00500",
+	}
+};
+
 static struct at24_platform_data mityomapl138_fd_chip = {
 	.byte_len	= 256,
 	.page_size	= 8,
@@ -534,6 +554,8 @@ static void __init mityomapl138_init(void)
 	if (ret)
 		pr_warn("spi 1 registration failed: %d\n", ret);
 
+	nvmem_add_lookup_table(mityomapl138_nvmem_cells,
+			       ARRAY_SIZE(mityomapl138_nvmem_cells));
 	mityomapl138_config_emac();
 
 	ret = da8xx_register_rtc();
-- 
2.17.1


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

* [PATCH v4 07/18] ARM: davinci: mityomapl138: add nvmem cells lookup entries
@ 2018-06-29  9:40   ` Bartosz Golaszewski
  0 siblings, 0 replies; 98+ messages in thread
From: Bartosz Golaszewski @ 2018-06-29  9:40 UTC (permalink / raw)
  To: linux-arm-kernel

From: Bartosz Golaszewski <bgolaszewski@baylibre.com>

We now support nvmem lookups for machine code. Add a lookup for
mac-address.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
---
 arch/arm/mach-davinci/board-mityomapl138.c | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/arch/arm/mach-davinci/board-mityomapl138.c b/arch/arm/mach-davinci/board-mityomapl138.c
index 37b3e48a21d1..b5be51c0451e 100644
--- a/arch/arm/mach-davinci/board-mityomapl138.c
+++ b/arch/arm/mach-davinci/board-mityomapl138.c
@@ -21,6 +21,7 @@
 #include <linux/etherdevice.h>
 #include <linux/spi/spi.h>
 #include <linux/spi/flash.h>
+#include <linux/nvmem-provider.h>
 
 #include <asm/io.h>
 #include <asm/mach-types.h>
@@ -160,6 +161,25 @@ static void read_factory_config(struct nvmem_device *nvmem, void *context)
 	mityomapl138_cpufreq_init(partnum);
 }
 
+static struct nvmem_cell_lookup mityomapl138_nvmem_cells[] = {
+	{
+		.info = {
+			.name = "factory-config",
+			.offset = 0x0,
+			.bytes = sizeof(struct factory_config),
+		},
+		.nvmem_name = "1-00500",
+	},
+	{
+		.info = {
+			.name = "mac-address",
+			.offset = 0x64,
+			.bytes = ETH_ALEN,
+		},
+		.nvmem_name = "1-00500",
+	}
+};
+
 static struct at24_platform_data mityomapl138_fd_chip = {
 	.byte_len	= 256,
 	.page_size	= 8,
@@ -534,6 +554,8 @@ static void __init mityomapl138_init(void)
 	if (ret)
 		pr_warn("spi 1 registration failed: %d\n", ret);
 
+	nvmem_add_lookup_table(mityomapl138_nvmem_cells,
+			       ARRAY_SIZE(mityomapl138_nvmem_cells));
 	mityomapl138_config_emac();
 
 	ret = da8xx_register_rtc();
-- 
2.17.1

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

* [PATCH v4 08/18] net: davinci_emac: potentially get the MAC address from MTD
  2018-06-29  9:40 ` Bartosz Golaszewski
@ 2018-06-29  9:40   ` Bartosz Golaszewski
  -1 siblings, 0 replies; 98+ messages in thread
From: Bartosz Golaszewski @ 2018-06-29  9:40 UTC (permalink / raw)
  To: Sekhar Nori, Kevin Hilman, Russell King, Grygorii Strashko,
	David S . Miller, Srinivas Kandagatla, Lukas Wunner, Rob Herring,
	Florian Fainelli, Dan Carpenter, Ivan Khoronzhuk, David Lechner,
	Greg Kroah-Hartman, Andrew Lunn, Jonathan Corbet
  Cc: linux-arm-kernel, linux-kernel, linux-omap, netdev, Bartosz Golaszewski

From: Bartosz Golaszewski <bgolaszewski@baylibre.com>

On da850-evm board we can read the MAC address from MTD. It's currently
done in the relevant board file, but we want to get rid of all the MAC
reading callbacks from the board file (SPI and NAND). Move the reading
of the MAC address from SPI to the emac driver's probe function.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
---
 drivers/net/ethernet/ti/davinci_emac.c | 20 ++++++++++++++++++--
 1 file changed, 18 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/ti/davinci_emac.c b/drivers/net/ethernet/ti/davinci_emac.c
index a1a6445b5a7e..48e6a7755811 100644
--- a/drivers/net/ethernet/ti/davinci_emac.c
+++ b/drivers/net/ethernet/ti/davinci_emac.c
@@ -67,7 +67,7 @@
 #include <linux/of_irq.h>
 #include <linux/of_net.h>
 #include <linux/mfd/syscon.h>
-
+#include <linux/mtd/mtd.h>
 #include <asm/irq.h>
 #include <asm/page.h>
 
@@ -1783,7 +1783,10 @@ static int davinci_emac_probe(struct platform_device *pdev)
 	struct cpdma_params dma_params;
 	struct clk *emac_clk;
 	unsigned long emac_bus_frequency;
-
+#ifdef CONFIG_MTD
+	size_t mac_addr_len;
+	struct mtd_info *mtd;
+#endif /* CONFIG_MTD */
 
 	/* obtain emac clock from kernel */
 	emac_clk = devm_clk_get(&pdev->dev, NULL);
@@ -1815,6 +1818,19 @@ static int davinci_emac_probe(struct platform_device *pdev)
 		goto err_free_netdev;
 	}
 
+#ifdef CONFIG_MTD
+	mtd = get_mtd_device_nm("MAC-Address");
+	if (!IS_ERR(mtd)) {
+		rc = mtd_read(mtd, 0, ETH_ALEN,
+			      &mac_addr_len, priv->mac_addr);
+		if (rc == 0)
+			dev_info(&pdev->dev,
+				 "Read MAC addr from SPI Flash: %pM\n",
+				 priv->mac_addr);
+		put_mtd_device(mtd);
+	}
+#endif /* CONFIG_MTD */
+
 	/* MAC addr and PHY mask , RMII enable info from platform_data */
 	memcpy(priv->mac_addr, pdata->mac_addr, ETH_ALEN);
 	priv->phy_id = pdata->phy_id;
-- 
2.17.1


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

* [PATCH v4 08/18] net: davinci_emac: potentially get the MAC address from MTD
@ 2018-06-29  9:40   ` Bartosz Golaszewski
  0 siblings, 0 replies; 98+ messages in thread
From: Bartosz Golaszewski @ 2018-06-29  9:40 UTC (permalink / raw)
  To: linux-arm-kernel

From: Bartosz Golaszewski <bgolaszewski@baylibre.com>

On da850-evm board we can read the MAC address from MTD. It's currently
done in the relevant board file, but we want to get rid of all the MAC
reading callbacks from the board file (SPI and NAND). Move the reading
of the MAC address from SPI to the emac driver's probe function.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
---
 drivers/net/ethernet/ti/davinci_emac.c | 20 ++++++++++++++++++--
 1 file changed, 18 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/ti/davinci_emac.c b/drivers/net/ethernet/ti/davinci_emac.c
index a1a6445b5a7e..48e6a7755811 100644
--- a/drivers/net/ethernet/ti/davinci_emac.c
+++ b/drivers/net/ethernet/ti/davinci_emac.c
@@ -67,7 +67,7 @@
 #include <linux/of_irq.h>
 #include <linux/of_net.h>
 #include <linux/mfd/syscon.h>
-
+#include <linux/mtd/mtd.h>
 #include <asm/irq.h>
 #include <asm/page.h>
 
@@ -1783,7 +1783,10 @@ static int davinci_emac_probe(struct platform_device *pdev)
 	struct cpdma_params dma_params;
 	struct clk *emac_clk;
 	unsigned long emac_bus_frequency;
-
+#ifdef CONFIG_MTD
+	size_t mac_addr_len;
+	struct mtd_info *mtd;
+#endif /* CONFIG_MTD */
 
 	/* obtain emac clock from kernel */
 	emac_clk = devm_clk_get(&pdev->dev, NULL);
@@ -1815,6 +1818,19 @@ static int davinci_emac_probe(struct platform_device *pdev)
 		goto err_free_netdev;
 	}
 
+#ifdef CONFIG_MTD
+	mtd = get_mtd_device_nm("MAC-Address");
+	if (!IS_ERR(mtd)) {
+		rc = mtd_read(mtd, 0, ETH_ALEN,
+			      &mac_addr_len, priv->mac_addr);
+		if (rc == 0)
+			dev_info(&pdev->dev,
+				 "Read MAC addr from SPI Flash: %pM\n",
+				 priv->mac_addr);
+		put_mtd_device(mtd);
+	}
+#endif /* CONFIG_MTD */
+
 	/* MAC addr and PHY mask , RMII enable info from platform_data */
 	memcpy(priv->mac_addr, pdata->mac_addr, ETH_ALEN);
 	priv->phy_id = pdata->phy_id;
-- 
2.17.1

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

* [PATCH v4 09/18] ARM: davinci: da850-evm: remove dead MTD code
  2018-06-29  9:40 ` Bartosz Golaszewski
@ 2018-06-29  9:40   ` Bartosz Golaszewski
  -1 siblings, 0 replies; 98+ messages in thread
From: Bartosz Golaszewski @ 2018-06-29  9:40 UTC (permalink / raw)
  To: Sekhar Nori, Kevin Hilman, Russell King, Grygorii Strashko,
	David S . Miller, Srinivas Kandagatla, Lukas Wunner, Rob Herring,
	Florian Fainelli, Dan Carpenter, Ivan Khoronzhuk, David Lechner,
	Greg Kroah-Hartman, Andrew Lunn, Jonathan Corbet
  Cc: linux-arm-kernel, linux-kernel, linux-omap, netdev, Bartosz Golaszewski

From: Bartosz Golaszewski <bgolaszewski@baylibre.com>

We no longer need to register the MTD notifier to read the MAC address
as it's now being done in the emac address.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
---
 arch/arm/mach-davinci/board-da850-evm.c | 28 -------------------------
 1 file changed, 28 deletions(-)

diff --git a/arch/arm/mach-davinci/board-da850-evm.c b/arch/arm/mach-davinci/board-da850-evm.c
index e22fb40e34bc..4de075458d83 100644
--- a/arch/arm/mach-davinci/board-da850-evm.c
+++ b/arch/arm/mach-davinci/board-da850-evm.c
@@ -124,32 +124,6 @@ static struct spi_board_info da850evm_spi_info[] = {
 	},
 };
 
-#ifdef CONFIG_MTD
-static void da850_evm_m25p80_notify_add(struct mtd_info *mtd)
-{
-	char *mac_addr = davinci_soc_info.emac_pdata->mac_addr;
-	size_t retlen;
-
-	if (!strcmp(mtd->name, "MAC-Address")) {
-		mtd_read(mtd, 0, ETH_ALEN, &retlen, mac_addr);
-		if (retlen == ETH_ALEN)
-			pr_info("Read MAC addr from SPI Flash: %pM\n",
-				mac_addr);
-	}
-}
-
-static struct mtd_notifier da850evm_spi_notifier = {
-	.add	= da850_evm_m25p80_notify_add,
-};
-
-static void da850_evm_setup_mac_addr(void)
-{
-	register_mtd_user(&da850evm_spi_notifier);
-}
-#else
-static void da850_evm_setup_mac_addr(void) { }
-#endif
-
 static struct mtd_partition da850_evm_norflash_partition[] = {
 	{
 		.name           = "bootloaders + env",
@@ -1455,8 +1429,6 @@ static __init void da850_evm_init(void)
 	if (ret)
 		pr_warn("%s: SATA registration failed: %d\n", __func__, ret);
 
-	da850_evm_setup_mac_addr();
-
 	ret = da8xx_register_rproc();
 	if (ret)
 		pr_warn("%s: dsp/rproc registration failed: %d\n",
-- 
2.17.1


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

* [PATCH v4 09/18] ARM: davinci: da850-evm: remove dead MTD code
@ 2018-06-29  9:40   ` Bartosz Golaszewski
  0 siblings, 0 replies; 98+ messages in thread
From: Bartosz Golaszewski @ 2018-06-29  9:40 UTC (permalink / raw)
  To: linux-arm-kernel

From: Bartosz Golaszewski <bgolaszewski@baylibre.com>

We no longer need to register the MTD notifier to read the MAC address
as it's now being done in the emac address.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
---
 arch/arm/mach-davinci/board-da850-evm.c | 28 -------------------------
 1 file changed, 28 deletions(-)

diff --git a/arch/arm/mach-davinci/board-da850-evm.c b/arch/arm/mach-davinci/board-da850-evm.c
index e22fb40e34bc..4de075458d83 100644
--- a/arch/arm/mach-davinci/board-da850-evm.c
+++ b/arch/arm/mach-davinci/board-da850-evm.c
@@ -124,32 +124,6 @@ static struct spi_board_info da850evm_spi_info[] = {
 	},
 };
 
-#ifdef CONFIG_MTD
-static void da850_evm_m25p80_notify_add(struct mtd_info *mtd)
-{
-	char *mac_addr = davinci_soc_info.emac_pdata->mac_addr;
-	size_t retlen;
-
-	if (!strcmp(mtd->name, "MAC-Address")) {
-		mtd_read(mtd, 0, ETH_ALEN, &retlen, mac_addr);
-		if (retlen == ETH_ALEN)
-			pr_info("Read MAC addr from SPI Flash: %pM\n",
-				mac_addr);
-	}
-}
-
-static struct mtd_notifier da850evm_spi_notifier = {
-	.add	= da850_evm_m25p80_notify_add,
-};
-
-static void da850_evm_setup_mac_addr(void)
-{
-	register_mtd_user(&da850evm_spi_notifier);
-}
-#else
-static void da850_evm_setup_mac_addr(void) { }
-#endif
-
 static struct mtd_partition da850_evm_norflash_partition[] = {
 	{
 		.name           = "bootloaders + env",
@@ -1455,8 +1429,6 @@ static __init void da850_evm_init(void)
 	if (ret)
 		pr_warn("%s: SATA registration failed: %d\n", __func__, ret);
 
-	da850_evm_setup_mac_addr();
-
 	ret = da8xx_register_rproc();
 	if (ret)
 		pr_warn("%s: dsp/rproc registration failed: %d\n",
-- 
2.17.1

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

* [PATCH v4 10/18] net: davinci_emac: use nvmem to retrieve the mac address
  2018-06-29  9:40 ` Bartosz Golaszewski
@ 2018-06-29  9:40   ` Bartosz Golaszewski
  -1 siblings, 0 replies; 98+ messages in thread
From: Bartosz Golaszewski @ 2018-06-29  9:40 UTC (permalink / raw)
  To: Sekhar Nori, Kevin Hilman, Russell King, Grygorii Strashko,
	David S . Miller, Srinivas Kandagatla, Lukas Wunner, Rob Herring,
	Florian Fainelli, Dan Carpenter, Ivan Khoronzhuk, David Lechner,
	Greg Kroah-Hartman, Andrew Lunn, Jonathan Corbet
  Cc: linux-arm-kernel, linux-kernel, linux-omap, netdev, Bartosz Golaszewski

From: Bartosz Golaszewski <bgolaszewski@baylibre.com>

All users which store the MAC address in EEPROM now register relevant
nvmem cells. Switch to retrieving the MAC address over the nvmem
framework. If we can't get the nvmem cell then fall back to using
the device tree.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
---
 drivers/net/ethernet/ti/davinci_emac.c | 35 +++++++++++++++++++-------
 1 file changed, 26 insertions(+), 9 deletions(-)

diff --git a/drivers/net/ethernet/ti/davinci_emac.c b/drivers/net/ethernet/ti/davinci_emac.c
index 48e6a7755811..ea303e1f7916 100644
--- a/drivers/net/ethernet/ti/davinci_emac.c
+++ b/drivers/net/ethernet/ti/davinci_emac.c
@@ -68,6 +68,8 @@
 #include <linux/of_net.h>
 #include <linux/mfd/syscon.h>
 #include <linux/mtd/mtd.h>
+#include <linux/nvmem-consumer.h>
+#include <linux/nvmem-consumer.h>
 #include <asm/irq.h>
 #include <asm/page.h>
 
@@ -1696,7 +1698,6 @@ davinci_emac_of_get_pdata(struct platform_device *pdev, struct emac_priv *priv)
 	const struct of_device_id *match;
 	const struct emac_platform_data *auxdata;
 	struct emac_platform_data *pdata = NULL;
-	const u8 *mac_addr;
 
 	if (!IS_ENABLED(CONFIG_OF) || !pdev->dev.of_node)
 		return dev_get_platdata(&pdev->dev);
@@ -1708,12 +1709,6 @@ davinci_emac_of_get_pdata(struct platform_device *pdev, struct emac_priv *priv)
 	np = pdev->dev.of_node;
 	pdata->version = EMAC_VERSION_2;
 
-	if (!is_valid_ether_addr(pdata->mac_addr)) {
-		mac_addr = of_get_mac_address(np);
-		if (mac_addr)
-			ether_addr_copy(pdata->mac_addr, mac_addr);
-	}
-
 	of_property_read_u32(np, "ti,davinci-ctrl-reg-offset",
 			     &pdata->ctrl_reg_offset);
 
@@ -1783,10 +1778,12 @@ static int davinci_emac_probe(struct platform_device *pdev)
 	struct cpdma_params dma_params;
 	struct clk *emac_clk;
 	unsigned long emac_bus_frequency;
-#ifdef CONFIG_MTD
+	const void *mac_addr;
 	size_t mac_addr_len;
+#ifdef CONFIG_MTD
 	struct mtd_info *mtd;
 #endif /* CONFIG_MTD */
+	struct nvmem_cell *cell;
 
 	/* obtain emac clock from kernel */
 	emac_clk = devm_clk_get(&pdev->dev, NULL);
@@ -1831,8 +1828,28 @@ static int davinci_emac_probe(struct platform_device *pdev)
 	}
 #endif /* CONFIG_MTD */
 
+	cell = nvmem_cell_get(&pdev->dev, "mac-address");
+	if (IS_ERR(cell) && PTR_ERR(cell) == -EPROBE_DEFER) {
+		return -EPROBE_DEFER;
+	} else if (!IS_ERR(cell)) {
+		mac_addr = nvmem_cell_read(cell, &mac_addr_len);
+		if (!IS_ERR(mac_addr)) {
+			if (is_valid_ether_addr(mac_addr)) {
+				dev_info(&pdev->dev,
+					 "Read MAC addr from EEPROM: %pM\n",
+					 mac_addr);
+				ether_addr_copy(priv->mac_addr, mac_addr);
+			}
+			kfree(mac_addr);
+		}
+		nvmem_cell_put(cell);
+	} else {
+		mac_addr = of_get_mac_address(np);
+		if (mac_addr)
+			ether_addr_copy(priv->mac_addr, mac_addr);
+	}
+
 	/* MAC addr and PHY mask , RMII enable info from platform_data */
-	memcpy(priv->mac_addr, pdata->mac_addr, ETH_ALEN);
 	priv->phy_id = pdata->phy_id;
 	priv->rmii_en = pdata->rmii_en;
 	priv->version = pdata->version;
-- 
2.17.1


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

* [PATCH v4 10/18] net: davinci_emac: use nvmem to retrieve the mac address
@ 2018-06-29  9:40   ` Bartosz Golaszewski
  0 siblings, 0 replies; 98+ messages in thread
From: Bartosz Golaszewski @ 2018-06-29  9:40 UTC (permalink / raw)
  To: linux-arm-kernel

From: Bartosz Golaszewski <bgolaszewski@baylibre.com>

All users which store the MAC address in EEPROM now register relevant
nvmem cells. Switch to retrieving the MAC address over the nvmem
framework. If we can't get the nvmem cell then fall back to using
the device tree.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
---
 drivers/net/ethernet/ti/davinci_emac.c | 35 +++++++++++++++++++-------
 1 file changed, 26 insertions(+), 9 deletions(-)

diff --git a/drivers/net/ethernet/ti/davinci_emac.c b/drivers/net/ethernet/ti/davinci_emac.c
index 48e6a7755811..ea303e1f7916 100644
--- a/drivers/net/ethernet/ti/davinci_emac.c
+++ b/drivers/net/ethernet/ti/davinci_emac.c
@@ -68,6 +68,8 @@
 #include <linux/of_net.h>
 #include <linux/mfd/syscon.h>
 #include <linux/mtd/mtd.h>
+#include <linux/nvmem-consumer.h>
+#include <linux/nvmem-consumer.h>
 #include <asm/irq.h>
 #include <asm/page.h>
 
@@ -1696,7 +1698,6 @@ davinci_emac_of_get_pdata(struct platform_device *pdev, struct emac_priv *priv)
 	const struct of_device_id *match;
 	const struct emac_platform_data *auxdata;
 	struct emac_platform_data *pdata = NULL;
-	const u8 *mac_addr;
 
 	if (!IS_ENABLED(CONFIG_OF) || !pdev->dev.of_node)
 		return dev_get_platdata(&pdev->dev);
@@ -1708,12 +1709,6 @@ davinci_emac_of_get_pdata(struct platform_device *pdev, struct emac_priv *priv)
 	np = pdev->dev.of_node;
 	pdata->version = EMAC_VERSION_2;
 
-	if (!is_valid_ether_addr(pdata->mac_addr)) {
-		mac_addr = of_get_mac_address(np);
-		if (mac_addr)
-			ether_addr_copy(pdata->mac_addr, mac_addr);
-	}
-
 	of_property_read_u32(np, "ti,davinci-ctrl-reg-offset",
 			     &pdata->ctrl_reg_offset);
 
@@ -1783,10 +1778,12 @@ static int davinci_emac_probe(struct platform_device *pdev)
 	struct cpdma_params dma_params;
 	struct clk *emac_clk;
 	unsigned long emac_bus_frequency;
-#ifdef CONFIG_MTD
+	const void *mac_addr;
 	size_t mac_addr_len;
+#ifdef CONFIG_MTD
 	struct mtd_info *mtd;
 #endif /* CONFIG_MTD */
+	struct nvmem_cell *cell;
 
 	/* obtain emac clock from kernel */
 	emac_clk = devm_clk_get(&pdev->dev, NULL);
@@ -1831,8 +1828,28 @@ static int davinci_emac_probe(struct platform_device *pdev)
 	}
 #endif /* CONFIG_MTD */
 
+	cell = nvmem_cell_get(&pdev->dev, "mac-address");
+	if (IS_ERR(cell) && PTR_ERR(cell) == -EPROBE_DEFER) {
+		return -EPROBE_DEFER;
+	} else if (!IS_ERR(cell)) {
+		mac_addr = nvmem_cell_read(cell, &mac_addr_len);
+		if (!IS_ERR(mac_addr)) {
+			if (is_valid_ether_addr(mac_addr)) {
+				dev_info(&pdev->dev,
+					 "Read MAC addr from EEPROM: %pM\n",
+					 mac_addr);
+				ether_addr_copy(priv->mac_addr, mac_addr);
+			}
+			kfree(mac_addr);
+		}
+		nvmem_cell_put(cell);
+	} else {
+		mac_addr = of_get_mac_address(np);
+		if (mac_addr)
+			ether_addr_copy(priv->mac_addr, mac_addr);
+	}
+
 	/* MAC addr and PHY mask , RMII enable info from platform_data */
-	memcpy(priv->mac_addr, pdata->mac_addr, ETH_ALEN);
 	priv->phy_id = pdata->phy_id;
 	priv->rmii_en = pdata->rmii_en;
 	priv->version = pdata->version;
-- 
2.17.1

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

* [PATCH v4 11/18] ARM: davinci: mityomapl138: don't read the MAC address from machine code
  2018-06-29  9:40 ` Bartosz Golaszewski
@ 2018-06-29  9:40   ` Bartosz Golaszewski
  -1 siblings, 0 replies; 98+ messages in thread
From: Bartosz Golaszewski @ 2018-06-29  9:40 UTC (permalink / raw)
  To: Sekhar Nori, Kevin Hilman, Russell King, Grygorii Strashko,
	David S . Miller, Srinivas Kandagatla, Lukas Wunner, Rob Herring,
	Florian Fainelli, Dan Carpenter, Ivan Khoronzhuk, David Lechner,
	Greg Kroah-Hartman, Andrew Lunn, Jonathan Corbet
  Cc: linux-arm-kernel, linux-kernel, linux-omap, netdev, Bartosz Golaszewski

From: Bartosz Golaszewski <bgolaszewski@baylibre.com>

This is now done by the emac driver using a registered nvmem cell.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
---
 arch/arm/mach-davinci/board-mityomapl138.c | 8 --------
 1 file changed, 8 deletions(-)

diff --git a/arch/arm/mach-davinci/board-mityomapl138.c b/arch/arm/mach-davinci/board-mityomapl138.c
index b5be51c0451e..5c0a0557a361 100644
--- a/arch/arm/mach-davinci/board-mityomapl138.c
+++ b/arch/arm/mach-davinci/board-mityomapl138.c
@@ -120,7 +120,6 @@ static void read_factory_config(struct nvmem_device *nvmem, void *context)
 {
 	int ret;
 	const char *partnum = NULL;
-	struct davinci_soc_info *soc_info = &davinci_soc_info;
 
 	if (!IS_BUILTIN(CONFIG_NVMEM)) {
 		pr_warn("Factory Config not available without CONFIG_NVMEM\n");
@@ -146,13 +145,6 @@ static void read_factory_config(struct nvmem_device *nvmem, void *context)
 		goto bad_config;
 	}
 
-	pr_info("Found MAC = %pM\n", factory_config.mac);
-	if (is_valid_ether_addr(factory_config.mac))
-		memcpy(soc_info->emac_pdata->mac_addr,
-			factory_config.mac, ETH_ALEN);
-	else
-		pr_warn("Invalid MAC found in factory config block\n");
-
 	partnum = factory_config.partnum;
 	pr_info("Part Number = %s\n", partnum);
 
-- 
2.17.1


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

* [PATCH v4 11/18] ARM: davinci: mityomapl138: don't read the MAC address from machine code
@ 2018-06-29  9:40   ` Bartosz Golaszewski
  0 siblings, 0 replies; 98+ messages in thread
From: Bartosz Golaszewski @ 2018-06-29  9:40 UTC (permalink / raw)
  To: linux-arm-kernel

From: Bartosz Golaszewski <bgolaszewski@baylibre.com>

This is now done by the emac driver using a registered nvmem cell.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
---
 arch/arm/mach-davinci/board-mityomapl138.c | 8 --------
 1 file changed, 8 deletions(-)

diff --git a/arch/arm/mach-davinci/board-mityomapl138.c b/arch/arm/mach-davinci/board-mityomapl138.c
index b5be51c0451e..5c0a0557a361 100644
--- a/arch/arm/mach-davinci/board-mityomapl138.c
+++ b/arch/arm/mach-davinci/board-mityomapl138.c
@@ -120,7 +120,6 @@ static void read_factory_config(struct nvmem_device *nvmem, void *context)
 {
 	int ret;
 	const char *partnum = NULL;
-	struct davinci_soc_info *soc_info = &davinci_soc_info;
 
 	if (!IS_BUILTIN(CONFIG_NVMEM)) {
 		pr_warn("Factory Config not available without CONFIG_NVMEM\n");
@@ -146,13 +145,6 @@ static void read_factory_config(struct nvmem_device *nvmem, void *context)
 		goto bad_config;
 	}
 
-	pr_info("Found MAC = %pM\n", factory_config.mac);
-	if (is_valid_ether_addr(factory_config.mac))
-		memcpy(soc_info->emac_pdata->mac_addr,
-			factory_config.mac, ETH_ALEN);
-	else
-		pr_warn("Invalid MAC found in factory config block\n");
-
 	partnum = factory_config.partnum;
 	pr_info("Part Number = %s\n", partnum);
 
-- 
2.17.1

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

* [PATCH v4 12/18] ARM: davinci: dm365-evm: use device properties for at24 eeprom
  2018-06-29  9:40 ` Bartosz Golaszewski
@ 2018-06-29  9:40   ` Bartosz Golaszewski
  -1 siblings, 0 replies; 98+ messages in thread
From: Bartosz Golaszewski @ 2018-06-29  9:40 UTC (permalink / raw)
  To: Sekhar Nori, Kevin Hilman, Russell King, Grygorii Strashko,
	David S . Miller, Srinivas Kandagatla, Lukas Wunner, Rob Herring,
	Florian Fainelli, Dan Carpenter, Ivan Khoronzhuk, David Lechner,
	Greg Kroah-Hartman, Andrew Lunn, Jonathan Corbet
  Cc: linux-arm-kernel, linux-kernel, linux-omap, netdev, Bartosz Golaszewski

From: Bartosz Golaszewski <bgolaszewski@baylibre.com>

We want to work towards phasing out the at24_platform_data structure.
There are few users and its contents can be represented using generic
device properties. Using device properties only will allow us to
significantly simplify the at24 configuration code.

Remove the at24_platform_data structure and replace it with an array
of property entries. Drop the byte_len/size property, as the model name
already implies the EEPROM's size.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
---
 arch/arm/mach-davinci/board-dm365-evm.c | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

diff --git a/arch/arm/mach-davinci/board-dm365-evm.c b/arch/arm/mach-davinci/board-dm365-evm.c
index cb0ac92a278e..b360d26e6caa 100644
--- a/arch/arm/mach-davinci/board-dm365-evm.c
+++ b/arch/arm/mach-davinci/board-dm365-evm.c
@@ -18,7 +18,7 @@
 #include <linux/i2c.h>
 #include <linux/io.h>
 #include <linux/clk.h>
-#include <linux/platform_data/at24.h>
+#include <linux/property.h>
 #include <linux/leds.h>
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/partitions.h>
@@ -179,18 +179,15 @@ static struct nvmem_cell_lookup dm365evm_mac_address_cell = {
 	.nvmem_name = "1-00500",
 };
 
-static struct at24_platform_data eeprom_info = {
-	.byte_len       = (256*1024) / 8,
-	.page_size      = 64,
-	.flags          = AT24_FLAG_ADDR16,
-	.setup          = davinci_get_mac_addr,
-	.context	= (void *)0x7f00,
+static const struct property_entry eeprom_properties[] = {
+	PROPERTY_ENTRY_U32("pagesize", 64),
+	{ }
 };
 
 static struct i2c_board_info i2c_info[] = {
 	{
 		I2C_BOARD_INFO("24c256", 0x50),
-		.platform_data	= &eeprom_info,
+		.properties = eeprom_properties,
 	},
 	{
 		I2C_BOARD_INFO("tlv320aic3x", 0x18),
-- 
2.17.1


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

* [PATCH v4 12/18] ARM: davinci: dm365-evm: use device properties for at24 eeprom
@ 2018-06-29  9:40   ` Bartosz Golaszewski
  0 siblings, 0 replies; 98+ messages in thread
From: Bartosz Golaszewski @ 2018-06-29  9:40 UTC (permalink / raw)
  To: linux-arm-kernel

From: Bartosz Golaszewski <bgolaszewski@baylibre.com>

We want to work towards phasing out the at24_platform_data structure.
There are few users and its contents can be represented using generic
device properties. Using device properties only will allow us to
significantly simplify the at24 configuration code.

Remove the at24_platform_data structure and replace it with an array
of property entries. Drop the byte_len/size property, as the model name
already implies the EEPROM's size.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
---
 arch/arm/mach-davinci/board-dm365-evm.c | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

diff --git a/arch/arm/mach-davinci/board-dm365-evm.c b/arch/arm/mach-davinci/board-dm365-evm.c
index cb0ac92a278e..b360d26e6caa 100644
--- a/arch/arm/mach-davinci/board-dm365-evm.c
+++ b/arch/arm/mach-davinci/board-dm365-evm.c
@@ -18,7 +18,7 @@
 #include <linux/i2c.h>
 #include <linux/io.h>
 #include <linux/clk.h>
-#include <linux/platform_data/at24.h>
+#include <linux/property.h>
 #include <linux/leds.h>
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/partitions.h>
@@ -179,18 +179,15 @@ static struct nvmem_cell_lookup dm365evm_mac_address_cell = {
 	.nvmem_name = "1-00500",
 };
 
-static struct at24_platform_data eeprom_info = {
-	.byte_len       = (256*1024) / 8,
-	.page_size      = 64,
-	.flags          = AT24_FLAG_ADDR16,
-	.setup          = davinci_get_mac_addr,
-	.context	= (void *)0x7f00,
+static const struct property_entry eeprom_properties[] = {
+	PROPERTY_ENTRY_U32("pagesize", 64),
+	{ }
 };
 
 static struct i2c_board_info i2c_info[] = {
 	{
 		I2C_BOARD_INFO("24c256", 0x50),
-		.platform_data	= &eeprom_info,
+		.properties = eeprom_properties,
 	},
 	{
 		I2C_BOARD_INFO("tlv320aic3x", 0x18),
-- 
2.17.1

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

* [PATCH v4 13/18] ARM: davinci: da830-evm: use device properties for at24 eeprom
  2018-06-29  9:40 ` Bartosz Golaszewski
@ 2018-06-29  9:40   ` Bartosz Golaszewski
  -1 siblings, 0 replies; 98+ messages in thread
From: Bartosz Golaszewski @ 2018-06-29  9:40 UTC (permalink / raw)
  To: Sekhar Nori, Kevin Hilman, Russell King, Grygorii Strashko,
	David S . Miller, Srinivas Kandagatla, Lukas Wunner, Rob Herring,
	Florian Fainelli, Dan Carpenter, Ivan Khoronzhuk, David Lechner,
	Greg Kroah-Hartman, Andrew Lunn, Jonathan Corbet
  Cc: linux-arm-kernel, linux-kernel, linux-omap, netdev, Bartosz Golaszewski

From: Bartosz Golaszewski <bgolaszewski@baylibre.com>

We want to work towards phasing out the at24_platform_data structure.
There are few users and its contents can be represented using generic
device properties. Using device properties only will allow us to
significantly simplify the at24 configuration code.

Remove the at24_platform_data structure and replace it with an array
of property entries. Drop the byte_len/size property, as the model name
already implies the EEPROM's size.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
---
 arch/arm/mach-davinci/board-da830-evm.c | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

diff --git a/arch/arm/mach-davinci/board-da830-evm.c b/arch/arm/mach-davinci/board-da830-evm.c
index 4a2fe8142a2f..08a23e777eca 100644
--- a/arch/arm/mach-davinci/board-da830-evm.c
+++ b/arch/arm/mach-davinci/board-da830-evm.c
@@ -18,7 +18,7 @@
 #include <linux/platform_device.h>
 #include <linux/i2c.h>
 #include <linux/platform_data/pcf857x.h>
-#include <linux/platform_data/at24.h>
+#include <linux/property.h>
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/partitions.h>
 #include <linux/spi/spi.h>
@@ -419,12 +419,9 @@ static struct nvmem_cell_lookup da830_evm_mac_address_cell = {
 	.nvmem_name = "1-00500",
 };
 
-static struct at24_platform_data da830_evm_i2c_eeprom_info = {
-	.byte_len	= SZ_256K / 8,
-	.page_size	= 64,
-	.flags		= AT24_FLAG_ADDR16,
-	.setup		= davinci_get_mac_addr,
-	.context	= (void *)0x7f00,
+static const struct property_entry da830_evm_i2c_eeprom_properties[] = {
+	PROPERTY_ENTRY_U32("pagesize", 64),
+	{ }
 };
 
 static int __init da830_evm_ui_expander_setup(struct i2c_client *client,
@@ -458,7 +455,7 @@ static struct pcf857x_platform_data __initdata da830_evm_ui_expander_info = {
 static struct i2c_board_info __initdata da830_evm_i2c_devices[] = {
 	{
 		I2C_BOARD_INFO("24c256", 0x50),
-		.platform_data	= &da830_evm_i2c_eeprom_info,
+		.properties = da830_evm_i2c_eeprom_properties,
 	},
 	{
 		I2C_BOARD_INFO("tlv320aic3x", 0x18),
-- 
2.17.1


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

* [PATCH v4 13/18] ARM: davinci: da830-evm: use device properties for at24 eeprom
@ 2018-06-29  9:40   ` Bartosz Golaszewski
  0 siblings, 0 replies; 98+ messages in thread
From: Bartosz Golaszewski @ 2018-06-29  9:40 UTC (permalink / raw)
  To: linux-arm-kernel

From: Bartosz Golaszewski <bgolaszewski@baylibre.com>

We want to work towards phasing out the at24_platform_data structure.
There are few users and its contents can be represented using generic
device properties. Using device properties only will allow us to
significantly simplify the at24 configuration code.

Remove the at24_platform_data structure and replace it with an array
of property entries. Drop the byte_len/size property, as the model name
already implies the EEPROM's size.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
---
 arch/arm/mach-davinci/board-da830-evm.c | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

diff --git a/arch/arm/mach-davinci/board-da830-evm.c b/arch/arm/mach-davinci/board-da830-evm.c
index 4a2fe8142a2f..08a23e777eca 100644
--- a/arch/arm/mach-davinci/board-da830-evm.c
+++ b/arch/arm/mach-davinci/board-da830-evm.c
@@ -18,7 +18,7 @@
 #include <linux/platform_device.h>
 #include <linux/i2c.h>
 #include <linux/platform_data/pcf857x.h>
-#include <linux/platform_data/at24.h>
+#include <linux/property.h>
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/partitions.h>
 #include <linux/spi/spi.h>
@@ -419,12 +419,9 @@ static struct nvmem_cell_lookup da830_evm_mac_address_cell = {
 	.nvmem_name = "1-00500",
 };
 
-static struct at24_platform_data da830_evm_i2c_eeprom_info = {
-	.byte_len	= SZ_256K / 8,
-	.page_size	= 64,
-	.flags		= AT24_FLAG_ADDR16,
-	.setup		= davinci_get_mac_addr,
-	.context	= (void *)0x7f00,
+static const struct property_entry da830_evm_i2c_eeprom_properties[] = {
+	PROPERTY_ENTRY_U32("pagesize", 64),
+	{ }
 };
 
 static int __init da830_evm_ui_expander_setup(struct i2c_client *client,
@@ -458,7 +455,7 @@ static struct pcf857x_platform_data __initdata da830_evm_ui_expander_info = {
 static struct i2c_board_info __initdata da830_evm_i2c_devices[] = {
 	{
 		I2C_BOARD_INFO("24c256", 0x50),
-		.platform_data	= &da830_evm_i2c_eeprom_info,
+		.properties = da830_evm_i2c_eeprom_properties,
 	},
 	{
 		I2C_BOARD_INFO("tlv320aic3x", 0x18),
-- 
2.17.1

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

* [PATCH v4 14/18] ARM: davinci: dm644x-evm: use device properties for at24 eeprom
  2018-06-29  9:40 ` Bartosz Golaszewski
@ 2018-06-29  9:40   ` Bartosz Golaszewski
  -1 siblings, 0 replies; 98+ messages in thread
From: Bartosz Golaszewski @ 2018-06-29  9:40 UTC (permalink / raw)
  To: Sekhar Nori, Kevin Hilman, Russell King, Grygorii Strashko,
	David S . Miller, Srinivas Kandagatla, Lukas Wunner, Rob Herring,
	Florian Fainelli, Dan Carpenter, Ivan Khoronzhuk, David Lechner,
	Greg Kroah-Hartman, Andrew Lunn, Jonathan Corbet
  Cc: linux-arm-kernel, linux-kernel, linux-omap, netdev, Bartosz Golaszewski

From: Bartosz Golaszewski <bgolaszewski@baylibre.com>

We want to work towards phasing out the at24_platform_data structure.
There are few users and its contents can be represented using generic
device properties. Using device properties only will allow us to
significantly simplify the at24 configuration code.

Remove the at24_platform_data structure and replace it with an array
of property entries. Drop the byte_len/size property, as the model name
already implies the EEPROM's size.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
---
 arch/arm/mach-davinci/board-dm644x-evm.c | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/arch/arm/mach-davinci/board-dm644x-evm.c b/arch/arm/mach-davinci/board-dm644x-evm.c
index 6d35c6e1b0bd..abfcf42da6fb 100644
--- a/arch/arm/mach-davinci/board-dm644x-evm.c
+++ b/arch/arm/mach-davinci/board-dm644x-evm.c
@@ -16,8 +16,8 @@
 #include <linux/gpio/machine.h>
 #include <linux/i2c.h>
 #include <linux/platform_data/pcf857x.h>
-#include <linux/platform_data/at24.h>
 #include <linux/platform_data/gpio-davinci.h>
+#include <linux/property.h>
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/rawnand.h>
 #include <linux/mtd/partitions.h>
@@ -486,12 +486,8 @@ static struct nvmem_cell_lookup dm6446evm_mac_address_cell = {
 	.nvmem_name = "1-00500",
 };
 
-static struct at24_platform_data eeprom_info = {
-	.byte_len	= (256*1024) / 8,
-	.page_size	= 64,
-	.flags		= AT24_FLAG_ADDR16,
-	.setup          = davinci_get_mac_addr,
-	.context	= (void *)0x7f00,
+static const struct property_entry eeprom_properties[] = {
+	PROPERTY_ENTRY_U32("pagesize", 64),
 };
 
 /*
@@ -601,7 +597,7 @@ static struct i2c_board_info __initdata i2c_info[] =  {
 	},
 	{
 		I2C_BOARD_INFO("24c256", 0x50),
-		.platform_data	= &eeprom_info,
+		.properties = eeprom_properties,
 	},
 	{
 		I2C_BOARD_INFO("tlv320aic33", 0x1b),
-- 
2.17.1


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

* [PATCH v4 14/18] ARM: davinci: dm644x-evm: use device properties for at24 eeprom
@ 2018-06-29  9:40   ` Bartosz Golaszewski
  0 siblings, 0 replies; 98+ messages in thread
From: Bartosz Golaszewski @ 2018-06-29  9:40 UTC (permalink / raw)
  To: linux-arm-kernel

From: Bartosz Golaszewski <bgolaszewski@baylibre.com>

We want to work towards phasing out the at24_platform_data structure.
There are few users and its contents can be represented using generic
device properties. Using device properties only will allow us to
significantly simplify the at24 configuration code.

Remove the at24_platform_data structure and replace it with an array
of property entries. Drop the byte_len/size property, as the model name
already implies the EEPROM's size.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
---
 arch/arm/mach-davinci/board-dm644x-evm.c | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/arch/arm/mach-davinci/board-dm644x-evm.c b/arch/arm/mach-davinci/board-dm644x-evm.c
index 6d35c6e1b0bd..abfcf42da6fb 100644
--- a/arch/arm/mach-davinci/board-dm644x-evm.c
+++ b/arch/arm/mach-davinci/board-dm644x-evm.c
@@ -16,8 +16,8 @@
 #include <linux/gpio/machine.h>
 #include <linux/i2c.h>
 #include <linux/platform_data/pcf857x.h>
-#include <linux/platform_data/at24.h>
 #include <linux/platform_data/gpio-davinci.h>
+#include <linux/property.h>
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/rawnand.h>
 #include <linux/mtd/partitions.h>
@@ -486,12 +486,8 @@ static struct nvmem_cell_lookup dm6446evm_mac_address_cell = {
 	.nvmem_name = "1-00500",
 };
 
-static struct at24_platform_data eeprom_info = {
-	.byte_len	= (256*1024) / 8,
-	.page_size	= 64,
-	.flags		= AT24_FLAG_ADDR16,
-	.setup          = davinci_get_mac_addr,
-	.context	= (void *)0x7f00,
+static const struct property_entry eeprom_properties[] = {
+	PROPERTY_ENTRY_U32("pagesize", 64),
 };
 
 /*
@@ -601,7 +597,7 @@ static struct i2c_board_info __initdata i2c_info[] =  {
 	},
 	{
 		I2C_BOARD_INFO("24c256", 0x50),
-		.platform_data	= &eeprom_info,
+		.properties = eeprom_properties,
 	},
 	{
 		I2C_BOARD_INFO("tlv320aic33", 0x1b),
-- 
2.17.1

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

* [PATCH v4 15/18] ARM: davinci: dm646x-evm: use device properties for at24 eeprom
  2018-06-29  9:40 ` Bartosz Golaszewski
@ 2018-06-29  9:40   ` Bartosz Golaszewski
  -1 siblings, 0 replies; 98+ messages in thread
From: Bartosz Golaszewski @ 2018-06-29  9:40 UTC (permalink / raw)
  To: Sekhar Nori, Kevin Hilman, Russell King, Grygorii Strashko,
	David S . Miller, Srinivas Kandagatla, Lukas Wunner, Rob Herring,
	Florian Fainelli, Dan Carpenter, Ivan Khoronzhuk, David Lechner,
	Greg Kroah-Hartman, Andrew Lunn, Jonathan Corbet
  Cc: linux-arm-kernel, linux-kernel, linux-omap, netdev, Bartosz Golaszewski

From: Bartosz Golaszewski <bgolaszewski@baylibre.com>

We want to work towards phasing out the at24_platform_data structure.
There are few users and its contents can be represented using generic
device properties. Using device properties only will allow us to
significantly simplify the at24 configuration code.

Remove the at24_platform_data structure and replace it with an array
of property entries. Drop the byte_len/size property, as the model name
already implies the EEPROM's size.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
---
 arch/arm/mach-davinci/board-dm646x-evm.c | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

diff --git a/arch/arm/mach-davinci/board-dm646x-evm.c b/arch/arm/mach-davinci/board-dm646x-evm.c
index 5a9de47bc8a2..5049f0c6cd1a 100644
--- a/arch/arm/mach-davinci/board-dm646x-evm.c
+++ b/arch/arm/mach-davinci/board-dm646x-evm.c
@@ -22,7 +22,7 @@
 #include <linux/gpio.h>
 #include <linux/platform_device.h>
 #include <linux/i2c.h>
-#include <linux/platform_data/at24.h>
+#include <linux/property.h>
 #include <linux/platform_data/pcf857x.h>
 
 #include <media/i2c/tvp514x.h>
@@ -320,12 +320,9 @@ static struct nvmem_cell_lookup dm646x_evm_mac_address_cell = {
 	.nvmem_name = "1-00500",
 };
 
-static struct at24_platform_data eeprom_info = {
-	.byte_len       = (256*1024) / 8,
-	.page_size      = 64,
-	.flags          = AT24_FLAG_ADDR16,
-	.setup          = davinci_get_mac_addr,
-	.context	= (void *)0x7f00,
+static const struct property_entry eeprom_properties[] = {
+	PROPERTY_ENTRY_U32("pagesize", 64),
+	{ }
 };
 #endif
 
@@ -396,7 +393,7 @@ static void evm_init_cpld(void)
 static struct i2c_board_info __initdata i2c_info[] =  {
 	{
 		I2C_BOARD_INFO("24c256", 0x50),
-		.platform_data  = &eeprom_info,
+		.properties  = eeprom_properties,
 	},
 	{
 		I2C_BOARD_INFO("pcf8574a", 0x38),
-- 
2.17.1


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

* [PATCH v4 15/18] ARM: davinci: dm646x-evm: use device properties for at24 eeprom
@ 2018-06-29  9:40   ` Bartosz Golaszewski
  0 siblings, 0 replies; 98+ messages in thread
From: Bartosz Golaszewski @ 2018-06-29  9:40 UTC (permalink / raw)
  To: linux-arm-kernel

From: Bartosz Golaszewski <bgolaszewski@baylibre.com>

We want to work towards phasing out the at24_platform_data structure.
There are few users and its contents can be represented using generic
device properties. Using device properties only will allow us to
significantly simplify the at24 configuration code.

Remove the at24_platform_data structure and replace it with an array
of property entries. Drop the byte_len/size property, as the model name
already implies the EEPROM's size.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
---
 arch/arm/mach-davinci/board-dm646x-evm.c | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

diff --git a/arch/arm/mach-davinci/board-dm646x-evm.c b/arch/arm/mach-davinci/board-dm646x-evm.c
index 5a9de47bc8a2..5049f0c6cd1a 100644
--- a/arch/arm/mach-davinci/board-dm646x-evm.c
+++ b/arch/arm/mach-davinci/board-dm646x-evm.c
@@ -22,7 +22,7 @@
 #include <linux/gpio.h>
 #include <linux/platform_device.h>
 #include <linux/i2c.h>
-#include <linux/platform_data/at24.h>
+#include <linux/property.h>
 #include <linux/platform_data/pcf857x.h>
 
 #include <media/i2c/tvp514x.h>
@@ -320,12 +320,9 @@ static struct nvmem_cell_lookup dm646x_evm_mac_address_cell = {
 	.nvmem_name = "1-00500",
 };
 
-static struct at24_platform_data eeprom_info = {
-	.byte_len       = (256*1024) / 8,
-	.page_size      = 64,
-	.flags          = AT24_FLAG_ADDR16,
-	.setup          = davinci_get_mac_addr,
-	.context	= (void *)0x7f00,
+static const struct property_entry eeprom_properties[] = {
+	PROPERTY_ENTRY_U32("pagesize", 64),
+	{ }
 };
 #endif
 
@@ -396,7 +393,7 @@ static void evm_init_cpld(void)
 static struct i2c_board_info __initdata i2c_info[] =  {
 	{
 		I2C_BOARD_INFO("24c256", 0x50),
-		.platform_data  = &eeprom_info,
+		.properties  = eeprom_properties,
 	},
 	{
 		I2C_BOARD_INFO("pcf8574a", 0x38),
-- 
2.17.1

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

* [PATCH v4 16/18] ARM: davinci: sffsdr: fix the at24 eeprom device name
  2018-06-29  9:40 ` Bartosz Golaszewski
@ 2018-06-29  9:40   ` Bartosz Golaszewski
  -1 siblings, 0 replies; 98+ messages in thread
From: Bartosz Golaszewski @ 2018-06-29  9:40 UTC (permalink / raw)
  To: Sekhar Nori, Kevin Hilman, Russell King, Grygorii Strashko,
	David S . Miller, Srinivas Kandagatla, Lukas Wunner, Rob Herring,
	Florian Fainelli, Dan Carpenter, Ivan Khoronzhuk, David Lechner,
	Greg Kroah-Hartman, Andrew Lunn, Jonathan Corbet
  Cc: linux-arm-kernel, linux-kernel, linux-omap, netdev, Bartosz Golaszewski

From: Bartosz Golaszewski <bgolaszewski@baylibre.com>

The currently used 24lc64 i2c device name doesn't match against any
of the devices supported by the at24 driver. Change it to the closest
compatible chip.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
---
 arch/arm/mach-davinci/board-sffsdr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/mach-davinci/board-sffsdr.c b/arch/arm/mach-davinci/board-sffsdr.c
index e7c1728b0833..f6a4d094cbc3 100644
--- a/arch/arm/mach-davinci/board-sffsdr.c
+++ b/arch/arm/mach-davinci/board-sffsdr.c
@@ -100,7 +100,7 @@ static struct at24_platform_data eeprom_info = {
 
 static struct i2c_board_info __initdata i2c_info[] =  {
 	{
-		I2C_BOARD_INFO("24lc64", 0x50),
+		I2C_BOARD_INFO("24c64", 0x50),
 		.platform_data	= &eeprom_info,
 	},
 	/* Other I2C devices:
-- 
2.17.1


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

* [PATCH v4 16/18] ARM: davinci: sffsdr: fix the at24 eeprom device name
@ 2018-06-29  9:40   ` Bartosz Golaszewski
  0 siblings, 0 replies; 98+ messages in thread
From: Bartosz Golaszewski @ 2018-06-29  9:40 UTC (permalink / raw)
  To: linux-arm-kernel

From: Bartosz Golaszewski <bgolaszewski@baylibre.com>

The currently used 24lc64 i2c device name doesn't match against any
of the devices supported by the at24 driver. Change it to the closest
compatible chip.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
---
 arch/arm/mach-davinci/board-sffsdr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/mach-davinci/board-sffsdr.c b/arch/arm/mach-davinci/board-sffsdr.c
index e7c1728b0833..f6a4d094cbc3 100644
--- a/arch/arm/mach-davinci/board-sffsdr.c
+++ b/arch/arm/mach-davinci/board-sffsdr.c
@@ -100,7 +100,7 @@ static struct at24_platform_data eeprom_info = {
 
 static struct i2c_board_info __initdata i2c_info[] =  {
 	{
-		I2C_BOARD_INFO("24lc64", 0x50),
+		I2C_BOARD_INFO("24c64", 0x50),
 		.platform_data	= &eeprom_info,
 	},
 	/* Other I2C devices:
-- 
2.17.1

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

* [PATCH v4 17/18] ARM: davinci: sffsdr: use device properties for at24 eeprom
  2018-06-29  9:40 ` Bartosz Golaszewski
@ 2018-06-29  9:40   ` Bartosz Golaszewski
  -1 siblings, 0 replies; 98+ messages in thread
From: Bartosz Golaszewski @ 2018-06-29  9:40 UTC (permalink / raw)
  To: Sekhar Nori, Kevin Hilman, Russell King, Grygorii Strashko,
	David S . Miller, Srinivas Kandagatla, Lukas Wunner, Rob Herring,
	Florian Fainelli, Dan Carpenter, Ivan Khoronzhuk, David Lechner,
	Greg Kroah-Hartman, Andrew Lunn, Jonathan Corbet
  Cc: linux-arm-kernel, linux-kernel, linux-omap, netdev, Bartosz Golaszewski

From: Bartosz Golaszewski <bgolaszewski@baylibre.com>

We want to work towards phasing out the at24_platform_data structure.
There are few users and its contents can be represented using generic
device properties. Using device properties only will allow us to
significantly simplify the at24 configuration code.

Remove the at24_platform_data structure and replace it with an array
of property entries. Drop the byte_len/size property, as the model name
already implies the EEPROM's size.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
---
 arch/arm/mach-davinci/board-sffsdr.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/arch/arm/mach-davinci/board-sffsdr.c b/arch/arm/mach-davinci/board-sffsdr.c
index f6a4d094cbc3..680e5d7628a8 100644
--- a/arch/arm/mach-davinci/board-sffsdr.c
+++ b/arch/arm/mach-davinci/board-sffsdr.c
@@ -26,7 +26,7 @@
 #include <linux/init.h>
 #include <linux/platform_device.h>
 #include <linux/i2c.h>
-#include <linux/platform_data/at24.h>
+#include <linux/property.h>
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/rawnand.h>
 #include <linux/mtd/partitions.h>
@@ -92,16 +92,15 @@ static struct platform_device davinci_sffsdr_nandflash_device = {
 	.resource	= davinci_sffsdr_nandflash_resource,
 };
 
-static struct at24_platform_data eeprom_info = {
-	.byte_len	= (64*1024) / 8,
-	.page_size	= 32,
-	.flags		= AT24_FLAG_ADDR16,
+static const struct property_entry eeprom_properties[] = {
+	PROPERTY_ENTRY_U32("pagesize", 32),
+	{ },
 };
 
 static struct i2c_board_info __initdata i2c_info[] =  {
 	{
 		I2C_BOARD_INFO("24c64", 0x50),
-		.platform_data	= &eeprom_info,
+		.properties = eeprom_properties,
 	},
 	/* Other I2C devices:
 	 * MSP430,  addr 0x23 (not used)
-- 
2.17.1


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

* [PATCH v4 17/18] ARM: davinci: sffsdr: use device properties for at24 eeprom
@ 2018-06-29  9:40   ` Bartosz Golaszewski
  0 siblings, 0 replies; 98+ messages in thread
From: Bartosz Golaszewski @ 2018-06-29  9:40 UTC (permalink / raw)
  To: linux-arm-kernel

From: Bartosz Golaszewski <bgolaszewski@baylibre.com>

We want to work towards phasing out the at24_platform_data structure.
There are few users and its contents can be represented using generic
device properties. Using device properties only will allow us to
significantly simplify the at24 configuration code.

Remove the at24_platform_data structure and replace it with an array
of property entries. Drop the byte_len/size property, as the model name
already implies the EEPROM's size.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
---
 arch/arm/mach-davinci/board-sffsdr.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/arch/arm/mach-davinci/board-sffsdr.c b/arch/arm/mach-davinci/board-sffsdr.c
index f6a4d094cbc3..680e5d7628a8 100644
--- a/arch/arm/mach-davinci/board-sffsdr.c
+++ b/arch/arm/mach-davinci/board-sffsdr.c
@@ -26,7 +26,7 @@
 #include <linux/init.h>
 #include <linux/platform_device.h>
 #include <linux/i2c.h>
-#include <linux/platform_data/at24.h>
+#include <linux/property.h>
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/rawnand.h>
 #include <linux/mtd/partitions.h>
@@ -92,16 +92,15 @@ static struct platform_device davinci_sffsdr_nandflash_device = {
 	.resource	= davinci_sffsdr_nandflash_resource,
 };
 
-static struct at24_platform_data eeprom_info = {
-	.byte_len	= (64*1024) / 8,
-	.page_size	= 32,
-	.flags		= AT24_FLAG_ADDR16,
+static const struct property_entry eeprom_properties[] = {
+	PROPERTY_ENTRY_U32("pagesize", 32),
+	{ },
 };
 
 static struct i2c_board_info __initdata i2c_info[] =  {
 	{
 		I2C_BOARD_INFO("24c64", 0x50),
-		.platform_data	= &eeprom_info,
+		.properties = eeprom_properties,
 	},
 	/* Other I2C devices:
 	 * MSP430,  addr 0x23 (not used)
-- 
2.17.1

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

* [PATCH v4 18/18] ARM: davinci: remove dead code related to MAC address reading
  2018-06-29  9:40 ` Bartosz Golaszewski
@ 2018-06-29  9:40   ` Bartosz Golaszewski
  -1 siblings, 0 replies; 98+ messages in thread
From: Bartosz Golaszewski @ 2018-06-29  9:40 UTC (permalink / raw)
  To: Sekhar Nori, Kevin Hilman, Russell King, Grygorii Strashko,
	David S . Miller, Srinivas Kandagatla, Lukas Wunner, Rob Herring,
	Florian Fainelli, Dan Carpenter, Ivan Khoronzhuk, David Lechner,
	Greg Kroah-Hartman, Andrew Lunn, Jonathan Corbet
  Cc: linux-arm-kernel, linux-kernel, linux-omap, netdev, Bartosz Golaszewski

From: Bartosz Golaszewski <bgolaszewski@baylibre.com>

There are no more users of davinci_get_mac_addr(). Remove it. Also
remove the mac_addr field from the emac platform data struct.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
---
 arch/arm/mach-davinci/common.c | 15 ---------------
 include/linux/davinci_emac.h   |  2 --
 2 files changed, 17 deletions(-)

diff --git a/arch/arm/mach-davinci/common.c b/arch/arm/mach-davinci/common.c
index bcb6a7ba84e9..0c6cc354a4aa 100644
--- a/arch/arm/mach-davinci/common.c
+++ b/arch/arm/mach-davinci/common.c
@@ -28,21 +28,6 @@ EXPORT_SYMBOL(davinci_soc_info);
 void __iomem *davinci_intc_base;
 int davinci_intc_type;
 
-void davinci_get_mac_addr(struct nvmem_device *nvmem, void *context)
-{
-	char *mac_addr = davinci_soc_info.emac_pdata->mac_addr;
-	off_t offset = (off_t)context;
-
-	if (!IS_BUILTIN(CONFIG_NVMEM)) {
-		pr_warn("Cannot read MAC addr from EEPROM without CONFIG_NVMEM\n");
-		return;
-	}
-
-	/* Read MAC addr from EEPROM */
-	if (nvmem_device_read(nvmem, offset, ETH_ALEN, mac_addr) == ETH_ALEN)
-		pr_info("Read MAC addr from EEPROM: %pM\n", mac_addr);
-}
-
 static int __init davinci_init_id(struct davinci_soc_info *soc_info)
 {
 	int			i;
diff --git a/include/linux/davinci_emac.h b/include/linux/davinci_emac.h
index 05b97144d342..19888b27706d 100644
--- a/include/linux/davinci_emac.h
+++ b/include/linux/davinci_emac.h
@@ -19,7 +19,6 @@ struct mdio_platform_data {
 };
 
 struct emac_platform_data {
-	char mac_addr[ETH_ALEN];
 	u32 ctrl_reg_offset;
 	u32 ctrl_mod_reg_offset;
 	u32 ctrl_ram_offset;
@@ -46,5 +45,4 @@ enum {
 	EMAC_VERSION_2,	/* DM646x */
 };
 
-void davinci_get_mac_addr(struct nvmem_device *nvmem, void *context);
 #endif
-- 
2.17.1


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

* [PATCH v4 18/18] ARM: davinci: remove dead code related to MAC address reading
@ 2018-06-29  9:40   ` Bartosz Golaszewski
  0 siblings, 0 replies; 98+ messages in thread
From: Bartosz Golaszewski @ 2018-06-29  9:40 UTC (permalink / raw)
  To: linux-arm-kernel

From: Bartosz Golaszewski <bgolaszewski@baylibre.com>

There are no more users of davinci_get_mac_addr(). Remove it. Also
remove the mac_addr field from the emac platform data struct.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
---
 arch/arm/mach-davinci/common.c | 15 ---------------
 include/linux/davinci_emac.h   |  2 --
 2 files changed, 17 deletions(-)

diff --git a/arch/arm/mach-davinci/common.c b/arch/arm/mach-davinci/common.c
index bcb6a7ba84e9..0c6cc354a4aa 100644
--- a/arch/arm/mach-davinci/common.c
+++ b/arch/arm/mach-davinci/common.c
@@ -28,21 +28,6 @@ EXPORT_SYMBOL(davinci_soc_info);
 void __iomem *davinci_intc_base;
 int davinci_intc_type;
 
-void davinci_get_mac_addr(struct nvmem_device *nvmem, void *context)
-{
-	char *mac_addr = davinci_soc_info.emac_pdata->mac_addr;
-	off_t offset = (off_t)context;
-
-	if (!IS_BUILTIN(CONFIG_NVMEM)) {
-		pr_warn("Cannot read MAC addr from EEPROM without CONFIG_NVMEM\n");
-		return;
-	}
-
-	/* Read MAC addr from EEPROM */
-	if (nvmem_device_read(nvmem, offset, ETH_ALEN, mac_addr) == ETH_ALEN)
-		pr_info("Read MAC addr from EEPROM: %pM\n", mac_addr);
-}
-
 static int __init davinci_init_id(struct davinci_soc_info *soc_info)
 {
 	int			i;
diff --git a/include/linux/davinci_emac.h b/include/linux/davinci_emac.h
index 05b97144d342..19888b27706d 100644
--- a/include/linux/davinci_emac.h
+++ b/include/linux/davinci_emac.h
@@ -19,7 +19,6 @@ struct mdio_platform_data {
 };
 
 struct emac_platform_data {
-	char mac_addr[ETH_ALEN];
 	u32 ctrl_reg_offset;
 	u32 ctrl_mod_reg_offset;
 	u32 ctrl_ram_offset;
@@ -46,5 +45,4 @@ enum {
 	EMAC_VERSION_2,	/* DM646x */
 };
 
-void davinci_get_mac_addr(struct nvmem_device *nvmem, void *context);
 #endif
-- 
2.17.1

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

* Re: [PATCH v4 09/18] ARM: davinci: da850-evm: remove dead MTD code
  2018-06-29  9:40   ` Bartosz Golaszewski
@ 2018-06-29 17:09     ` David Lechner
  -1 siblings, 0 replies; 98+ messages in thread
From: David Lechner @ 2018-06-29 17:09 UTC (permalink / raw)
  To: Bartosz Golaszewski, Sekhar Nori, Kevin Hilman, Russell King,
	Grygorii Strashko, David S . Miller, Srinivas Kandagatla,
	Lukas Wunner, Rob Herring, Florian Fainelli, Dan Carpenter,
	Ivan Khoronzhuk, Greg Kroah-Hartman, Andrew Lunn,
	Jonathan Corbet
  Cc: linux-arm-kernel, linux-kernel, linux-omap, netdev, Bartosz Golaszewski

On 06/29/2018 04:40 AM, Bartosz Golaszewski wrote:
> From: Bartosz Golaszewski <bgolaszewski@baylibre.com>
> 
> We no longer need to register the MTD notifier to read the MAC address
> as it's now being done in the emac address.

I think you mean "it's now being done in the emac _driver_"

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

* [PATCH v4 09/18] ARM: davinci: da850-evm: remove dead MTD code
@ 2018-06-29 17:09     ` David Lechner
  0 siblings, 0 replies; 98+ messages in thread
From: David Lechner @ 2018-06-29 17:09 UTC (permalink / raw)
  To: linux-arm-kernel

On 06/29/2018 04:40 AM, Bartosz Golaszewski wrote:
> From: Bartosz Golaszewski <bgolaszewski@baylibre.com>
> 
> We no longer need to register the MTD notifier to read the MAC address
> as it's now being done in the emac address.

I think you mean "it's now being done in the emac _driver_"

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

* Re: [PATCH v4 08/18] net: davinci_emac: potentially get the MAC address from MTD
  2018-06-29  9:40   ` Bartosz Golaszewski
@ 2018-06-29 20:09     ` David Lechner
  -1 siblings, 0 replies; 98+ messages in thread
From: David Lechner @ 2018-06-29 20:09 UTC (permalink / raw)
  To: Bartosz Golaszewski, Sekhar Nori, Kevin Hilman, Russell King,
	Grygorii Strashko, David S . Miller, Srinivas Kandagatla,
	Lukas Wunner, Rob Herring, Florian Fainelli, Dan Carpenter,
	Ivan Khoronzhuk, Greg Kroah-Hartman, Andrew Lunn,
	Jonathan Corbet
  Cc: linux-arm-kernel, linux-kernel, linux-omap, netdev, Bartosz Golaszewski

On 06/29/2018 04:40 AM, Bartosz Golaszewski wrote:
> From: Bartosz Golaszewski <bgolaszewski@baylibre.com>
> 
> On da850-evm board we can read the MAC address from MTD. It's currently
> done in the relevant board file, but we want to get rid of all the MAC
> reading callbacks from the board file (SPI and NAND). Move the reading
> of the MAC address from SPI to the emac driver's probe function.
> 
> Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
> ---
>   drivers/net/ethernet/ti/davinci_emac.c | 20 ++++++++++++++++++--
>   1 file changed, 18 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/ethernet/ti/davinci_emac.c b/drivers/net/ethernet/ti/davinci_emac.c
> index a1a6445b5a7e..48e6a7755811 100644
> --- a/drivers/net/ethernet/ti/davinci_emac.c
> +++ b/drivers/net/ethernet/ti/davinci_emac.c
> @@ -67,7 +67,7 @@
>   #include <linux/of_irq.h>
>   #include <linux/of_net.h>
>   #include <linux/mfd/syscon.h>
> -
> +#include <linux/mtd/mtd.h>
>   #include <asm/irq.h>
>   #include <asm/page.h>
>   
> @@ -1783,7 +1783,10 @@ static int davinci_emac_probe(struct platform_device *pdev)
>   	struct cpdma_params dma_params;
>   	struct clk *emac_clk;
>   	unsigned long emac_bus_frequency;
> -
> +#ifdef CONFIG_MTD
> +	size_t mac_addr_len;
> +	struct mtd_info *mtd;
> +#endif /* CONFIG_MTD */
>   
>   	/* obtain emac clock from kernel */
>   	emac_clk = devm_clk_get(&pdev->dev, NULL);
> @@ -1815,6 +1818,19 @@ static int davinci_emac_probe(struct platform_device *pdev)
>   		goto err_free_netdev;
>   	}
>   
> +#ifdef CONFIG_MTD

What about the case when MTD is compiled as a module?

> +	mtd = get_mtd_device_nm("MAC-Address");

What about the case when PTR_ERR(mtd) == -EPROBE_DEFER?

> +	if (!IS_ERR(mtd)) {
> +		rc = mtd_read(mtd, 0, ETH_ALEN,
> +			      &mac_addr_len, priv->mac_addr);
> +		if (rc == 0)
> +			dev_info(&pdev->dev,
> +				 "Read MAC addr from SPI Flash: %pM\n",
> +				 priv->mac_addr);
> +		put_mtd_device(mtd);
> +	}
> +#endif /* CONFIG_MTD */
> +
>   	/* MAC addr and PHY mask , RMII enable info from platform_data */
>   	memcpy(priv->mac_addr, pdata->mac_addr, ETH_ALEN);
>   	priv->phy_id = pdata->phy_id;
> 


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

* [PATCH v4 08/18] net: davinci_emac: potentially get the MAC address from MTD
@ 2018-06-29 20:09     ` David Lechner
  0 siblings, 0 replies; 98+ messages in thread
From: David Lechner @ 2018-06-29 20:09 UTC (permalink / raw)
  To: linux-arm-kernel

On 06/29/2018 04:40 AM, Bartosz Golaszewski wrote:
> From: Bartosz Golaszewski <bgolaszewski@baylibre.com>
> 
> On da850-evm board we can read the MAC address from MTD. It's currently
> done in the relevant board file, but we want to get rid of all the MAC
> reading callbacks from the board file (SPI and NAND). Move the reading
> of the MAC address from SPI to the emac driver's probe function.
> 
> Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
> ---
>   drivers/net/ethernet/ti/davinci_emac.c | 20 ++++++++++++++++++--
>   1 file changed, 18 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/ethernet/ti/davinci_emac.c b/drivers/net/ethernet/ti/davinci_emac.c
> index a1a6445b5a7e..48e6a7755811 100644
> --- a/drivers/net/ethernet/ti/davinci_emac.c
> +++ b/drivers/net/ethernet/ti/davinci_emac.c
> @@ -67,7 +67,7 @@
>   #include <linux/of_irq.h>
>   #include <linux/of_net.h>
>   #include <linux/mfd/syscon.h>
> -
> +#include <linux/mtd/mtd.h>
>   #include <asm/irq.h>
>   #include <asm/page.h>
>   
> @@ -1783,7 +1783,10 @@ static int davinci_emac_probe(struct platform_device *pdev)
>   	struct cpdma_params dma_params;
>   	struct clk *emac_clk;
>   	unsigned long emac_bus_frequency;
> -
> +#ifdef CONFIG_MTD
> +	size_t mac_addr_len;
> +	struct mtd_info *mtd;
> +#endif /* CONFIG_MTD */
>   
>   	/* obtain emac clock from kernel */
>   	emac_clk = devm_clk_get(&pdev->dev, NULL);
> @@ -1815,6 +1818,19 @@ static int davinci_emac_probe(struct platform_device *pdev)
>   		goto err_free_netdev;
>   	}
>   
> +#ifdef CONFIG_MTD

What about the case when MTD is compiled as a module?

> +	mtd = get_mtd_device_nm("MAC-Address");

What about the case when PTR_ERR(mtd) == -EPROBE_DEFER?

> +	if (!IS_ERR(mtd)) {
> +		rc = mtd_read(mtd, 0, ETH_ALEN,
> +			      &mac_addr_len, priv->mac_addr);
> +		if (rc == 0)
> +			dev_info(&pdev->dev,
> +				 "Read MAC addr from SPI Flash: %pM\n",
> +				 priv->mac_addr);
> +		put_mtd_device(mtd);
> +	}
> +#endif /* CONFIG_MTD */
> +
>   	/* MAC addr and PHY mask , RMII enable info from platform_data */
>   	memcpy(priv->mac_addr, pdata->mac_addr, ETH_ALEN);
>   	priv->phy_id = pdata->phy_id;
> 

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

* Re: [PATCH v4 08/18] net: davinci_emac: potentially get the MAC address from MTD
  2018-06-29 20:09     ` David Lechner
@ 2018-06-29 20:35       ` David Lechner
  -1 siblings, 0 replies; 98+ messages in thread
From: David Lechner @ 2018-06-29 20:35 UTC (permalink / raw)
  To: Bartosz Golaszewski, Sekhar Nori, Kevin Hilman, Russell King,
	Grygorii Strashko, David S . Miller, Srinivas Kandagatla,
	Lukas Wunner, Rob Herring, Florian Fainelli, Dan Carpenter,
	Ivan Khoronzhuk, Greg Kroah-Hartman, Andrew Lunn,
	Jonathan Corbet
  Cc: linux-arm-kernel, linux-kernel, linux-omap, netdev, Bartosz Golaszewski

On 06/29/2018 03:09 PM, David Lechner wrote:
> On 06/29/2018 04:40 AM, Bartosz Golaszewski wrote:
>> From: Bartosz Golaszewski <bgolaszewski@baylibre.com>
>>
>> On da850-evm board we can read the MAC address from MTD. It's currently
>> done in the relevant board file, but we want to get rid of all the MAC
>> reading callbacks from the board file (SPI and NAND). Move the reading
>> of the MAC address from SPI to the emac driver's probe function.
>>
>> Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
>> ---
>>   drivers/net/ethernet/ti/davinci_emac.c | 20 ++++++++++++++++++--
>>   1 file changed, 18 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/net/ethernet/ti/davinci_emac.c b/drivers/net/ethernet/ti/davinci_emac.c
>> index a1a6445b5a7e..48e6a7755811 100644
>> --- a/drivers/net/ethernet/ti/davinci_emac.c
>> +++ b/drivers/net/ethernet/ti/davinci_emac.c
>> @@ -67,7 +67,7 @@
>>   #include <linux/of_irq.h>
>>   #include <linux/of_net.h>
>>   #include <linux/mfd/syscon.h>
>> -
>> +#include <linux/mtd/mtd.h>
>>   #include <asm/irq.h>
>>   #include <asm/page.h>
>> @@ -1783,7 +1783,10 @@ static int davinci_emac_probe(struct platform_device *pdev)
>>       struct cpdma_params dma_params;
>>       struct clk *emac_clk;
>>       unsigned long emac_bus_frequency;
>> -
>> +#ifdef CONFIG_MTD
>> +    size_t mac_addr_len;
>> +    struct mtd_info *mtd;
>> +#endif /* CONFIG_MTD */
>>       /* obtain emac clock from kernel */
>>       emac_clk = devm_clk_get(&pdev->dev, NULL);
>> @@ -1815,6 +1818,19 @@ static int davinci_emac_probe(struct platform_device *pdev)
>>           goto err_free_netdev;
>>       }
>> +#ifdef CONFIG_MTD
> 
> What about the case when MTD is compiled as a module?
> 
>> +    mtd = get_mtd_device_nm("MAC-Address");
> 
> What about the case when PTR_ERR(mtd) == -EPROBE_DEFER?

To answer my own question: because get_mtd_device_nm() doesn't
ever return -EPROBE_DEFER.

I'm trying to make this work on LCDK, but the emac driver probes
before any mtd device is registered, so, I just get -ENODEV even
though I've added a partition to the device tree labeled
"MAC-Address". You can see in the kernel messages that MTD is
not probed until later.

> 
>> +    if (!IS_ERR(mtd)) {
>> +        rc = mtd_read(mtd, 0, ETH_ALEN,
>> +                  &mac_addr_len, priv->mac_addr);
>> +        if (rc == 0)
>> +            dev_info(&pdev->dev,
>> +                 "Read MAC addr from SPI Flash: %pM\n",
>> +                 priv->mac_addr);
>> +        put_mtd_device(mtd);
>> +    }
>> +#endif /* CONFIG_MTD */
>> +
>>       /* MAC addr and PHY mask , RMII enable info from platform_data */
>>       memcpy(priv->mac_addr, pdata->mac_addr, ETH_ALEN);
>>       priv->phy_id = pdata->phy_id;
>>
> 


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

* [PATCH v4 08/18] net: davinci_emac: potentially get the MAC address from MTD
@ 2018-06-29 20:35       ` David Lechner
  0 siblings, 0 replies; 98+ messages in thread
From: David Lechner @ 2018-06-29 20:35 UTC (permalink / raw)
  To: linux-arm-kernel

On 06/29/2018 03:09 PM, David Lechner wrote:
> On 06/29/2018 04:40 AM, Bartosz Golaszewski wrote:
>> From: Bartosz Golaszewski <bgolaszewski@baylibre.com>
>>
>> On da850-evm board we can read the MAC address from MTD. It's currently
>> done in the relevant board file, but we want to get rid of all the MAC
>> reading callbacks from the board file (SPI and NAND). Move the reading
>> of the MAC address from SPI to the emac driver's probe function.
>>
>> Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
>> ---
>> ? drivers/net/ethernet/ti/davinci_emac.c | 20 ++++++++++++++++++--
>> ? 1 file changed, 18 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/net/ethernet/ti/davinci_emac.c b/drivers/net/ethernet/ti/davinci_emac.c
>> index a1a6445b5a7e..48e6a7755811 100644
>> --- a/drivers/net/ethernet/ti/davinci_emac.c
>> +++ b/drivers/net/ethernet/ti/davinci_emac.c
>> @@ -67,7 +67,7 @@
>> ? #include <linux/of_irq.h>
>> ? #include <linux/of_net.h>
>> ? #include <linux/mfd/syscon.h>
>> -
>> +#include <linux/mtd/mtd.h>
>> ? #include <asm/irq.h>
>> ? #include <asm/page.h>
>> @@ -1783,7 +1783,10 @@ static int davinci_emac_probe(struct platform_device *pdev)
>> ????? struct cpdma_params dma_params;
>> ????? struct clk *emac_clk;
>> ????? unsigned long emac_bus_frequency;
>> -
>> +#ifdef CONFIG_MTD
>> +??? size_t mac_addr_len;
>> +??? struct mtd_info *mtd;
>> +#endif /* CONFIG_MTD */
>> ????? /* obtain emac clock from kernel */
>> ????? emac_clk = devm_clk_get(&pdev->dev, NULL);
>> @@ -1815,6 +1818,19 @@ static int davinci_emac_probe(struct platform_device *pdev)
>> ????????? goto err_free_netdev;
>> ????? }
>> +#ifdef CONFIG_MTD
> 
> What about the case when MTD is compiled as a module?
> 
>> +??? mtd = get_mtd_device_nm("MAC-Address");
> 
> What about the case when PTR_ERR(mtd) == -EPROBE_DEFER?

To answer my own question: because get_mtd_device_nm() doesn't
ever return -EPROBE_DEFER.

I'm trying to make this work on LCDK, but the emac driver probes
before any mtd device is registered, so, I just get -ENODEV even
though I've added a partition to the device tree labeled
"MAC-Address". You can see in the kernel messages that MTD is
not probed until later.

> 
>> +??? if (!IS_ERR(mtd)) {
>> +??????? rc = mtd_read(mtd, 0, ETH_ALEN,
>> +????????????????? &mac_addr_len, priv->mac_addr);
>> +??????? if (rc == 0)
>> +??????????? dev_info(&pdev->dev,
>> +???????????????? "Read MAC addr from SPI Flash: %pM\n",
>> +???????????????? priv->mac_addr);
>> +??????? put_mtd_device(mtd);
>> +??? }
>> +#endif /* CONFIG_MTD */
>> +
>> ????? /* MAC addr and PHY mask , RMII enable info from platform_data */
>> ????? memcpy(priv->mac_addr, pdata->mac_addr, ETH_ALEN);
>> ????? priv->phy_id = pdata->phy_id;
>>
> 

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

* Re: [PATCH v4 09/18] ARM: davinci: da850-evm: remove dead MTD code
  2018-06-29 17:09     ` David Lechner
@ 2018-07-02  7:28       ` Bartosz Golaszewski
  -1 siblings, 0 replies; 98+ messages in thread
From: Bartosz Golaszewski @ 2018-07-02  7:28 UTC (permalink / raw)
  To: David Lechner
  Cc: Bartosz Golaszewski, Sekhar Nori, Kevin Hilman, Russell King,
	Grygorii Strashko, David S . Miller, Srinivas Kandagatla,
	Lukas Wunner, Rob Herring, Florian Fainelli, Dan Carpenter,
	Ivan Khoronzhuk, Greg Kroah-Hartman, Andrew Lunn,
	Jonathan Corbet, arm-soc, LKML, Linux-OMAP, netdev

2018-06-29 19:09 GMT+02:00 David Lechner <david@lechnology.com>:
> On 06/29/2018 04:40 AM, Bartosz Golaszewski wrote:
>>
>> From: Bartosz Golaszewski <bgolaszewski@baylibre.com>
>>
>> We no longer need to register the MTD notifier to read the MAC address
>> as it's now being done in the emac address.
>
>
> I think you mean "it's now being done in the emac _driver_"

Haha yes I do. :)

Thanks,
Bart

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

* [PATCH v4 09/18] ARM: davinci: da850-evm: remove dead MTD code
@ 2018-07-02  7:28       ` Bartosz Golaszewski
  0 siblings, 0 replies; 98+ messages in thread
From: Bartosz Golaszewski @ 2018-07-02  7:28 UTC (permalink / raw)
  To: linux-arm-kernel

2018-06-29 19:09 GMT+02:00 David Lechner <david@lechnology.com>:
> On 06/29/2018 04:40 AM, Bartosz Golaszewski wrote:
>>
>> From: Bartosz Golaszewski <bgolaszewski@baylibre.com>
>>
>> We no longer need to register the MTD notifier to read the MAC address
>> as it's now being done in the emac address.
>
>
> I think you mean "it's now being done in the emac _driver_"

Haha yes I do. :)

Thanks,
Bart

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

* Re: [PATCH v4 08/18] net: davinci_emac: potentially get the MAC address from MTD
  2018-06-29 20:35       ` David Lechner
@ 2018-07-02  7:41         ` Bartosz Golaszewski
  -1 siblings, 0 replies; 98+ messages in thread
From: Bartosz Golaszewski @ 2018-07-02  7:41 UTC (permalink / raw)
  To: David Lechner
  Cc: Bartosz Golaszewski, Sekhar Nori, Kevin Hilman, Russell King,
	Grygorii Strashko, David S . Miller, Srinivas Kandagatla,
	Lukas Wunner, Rob Herring, Florian Fainelli, Dan Carpenter,
	Ivan Khoronzhuk, Greg Kroah-Hartman, Andrew Lunn,
	Jonathan Corbet, arm-soc, LKML, Linux-OMAP, netdev

2018-06-29 22:35 GMT+02:00 David Lechner <david@lechnology.com>:
> On 06/29/2018 03:09 PM, David Lechner wrote:
>>
>> On 06/29/2018 04:40 AM, Bartosz Golaszewski wrote:
>>>
>>> From: Bartosz Golaszewski <bgolaszewski@baylibre.com>
>>>
>>> On da850-evm board we can read the MAC address from MTD. It's currently
>>> done in the relevant board file, but we want to get rid of all the MAC
>>> reading callbacks from the board file (SPI and NAND). Move the reading
>>> of the MAC address from SPI to the emac driver's probe function.
>>>
>>> Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
>>> ---
>>>   drivers/net/ethernet/ti/davinci_emac.c | 20 ++++++++++++++++++--
>>>   1 file changed, 18 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/drivers/net/ethernet/ti/davinci_emac.c
>>> b/drivers/net/ethernet/ti/davinci_emac.c
>>> index a1a6445b5a7e..48e6a7755811 100644
>>> --- a/drivers/net/ethernet/ti/davinci_emac.c
>>> +++ b/drivers/net/ethernet/ti/davinci_emac.c
>>> @@ -67,7 +67,7 @@
>>>   #include <linux/of_irq.h>
>>>   #include <linux/of_net.h>
>>>   #include <linux/mfd/syscon.h>
>>> -
>>> +#include <linux/mtd/mtd.h>
>>>   #include <asm/irq.h>
>>>   #include <asm/page.h>
>>> @@ -1783,7 +1783,10 @@ static int davinci_emac_probe(struct
>>> platform_device *pdev)
>>>       struct cpdma_params dma_params;
>>>       struct clk *emac_clk;
>>>       unsigned long emac_bus_frequency;
>>> -
>>> +#ifdef CONFIG_MTD
>>> +    size_t mac_addr_len;
>>> +    struct mtd_info *mtd;
>>> +#endif /* CONFIG_MTD */
>>>       /* obtain emac clock from kernel */
>>>       emac_clk = devm_clk_get(&pdev->dev, NULL);
>>> @@ -1815,6 +1818,19 @@ static int davinci_emac_probe(struct
>>> platform_device *pdev)
>>>           goto err_free_netdev;
>>>       }
>>> +#ifdef CONFIG_MTD
>>
>>
>> What about the case when MTD is compiled as a module?
>>
>>> +    mtd = get_mtd_device_nm("MAC-Address");
>>
>>
>> What about the case when PTR_ERR(mtd) == -EPROBE_DEFER?
>
>
> To answer my own question: because get_mtd_device_nm() doesn't
> ever return -EPROBE_DEFER.
>
> I'm trying to make this work on LCDK, but the emac driver probes
> before any mtd device is registered, so, I just get -ENODEV even
> though I've added a partition to the device tree labeled
> "MAC-Address". You can see in the kernel messages that MTD is
> not probed until later.
>

I tested it on da850-evm - all MTD & SPI related modules need to be
built-in for it to work, so:

CONFIG_MTD=y
CONFIG_MTD_M25P80=y
CONFIG_SPI_DAVINCI=y

Best regards,
Bartosz Golaszewski

>
>>
>>> +    if (!IS_ERR(mtd)) {
>>> +        rc = mtd_read(mtd, 0, ETH_ALEN,
>>> +                  &mac_addr_len, priv->mac_addr);
>>> +        if (rc == 0)
>>> +            dev_info(&pdev->dev,
>>> +                 "Read MAC addr from SPI Flash: %pM\n",
>>> +                 priv->mac_addr);
>>> +        put_mtd_device(mtd);
>>> +    }
>>> +#endif /* CONFIG_MTD */
>>> +
>>>       /* MAC addr and PHY mask , RMII enable info from platform_data */
>>>       memcpy(priv->mac_addr, pdata->mac_addr, ETH_ALEN);
>>>       priv->phy_id = pdata->phy_id;
>>>
>>
>

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

* [PATCH v4 08/18] net: davinci_emac: potentially get the MAC address from MTD
@ 2018-07-02  7:41         ` Bartosz Golaszewski
  0 siblings, 0 replies; 98+ messages in thread
From: Bartosz Golaszewski @ 2018-07-02  7:41 UTC (permalink / raw)
  To: linux-arm-kernel

2018-06-29 22:35 GMT+02:00 David Lechner <david@lechnology.com>:
> On 06/29/2018 03:09 PM, David Lechner wrote:
>>
>> On 06/29/2018 04:40 AM, Bartosz Golaszewski wrote:
>>>
>>> From: Bartosz Golaszewski <bgolaszewski@baylibre.com>
>>>
>>> On da850-evm board we can read the MAC address from MTD. It's currently
>>> done in the relevant board file, but we want to get rid of all the MAC
>>> reading callbacks from the board file (SPI and NAND). Move the reading
>>> of the MAC address from SPI to the emac driver's probe function.
>>>
>>> Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
>>> ---
>>>   drivers/net/ethernet/ti/davinci_emac.c | 20 ++++++++++++++++++--
>>>   1 file changed, 18 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/drivers/net/ethernet/ti/davinci_emac.c
>>> b/drivers/net/ethernet/ti/davinci_emac.c
>>> index a1a6445b5a7e..48e6a7755811 100644
>>> --- a/drivers/net/ethernet/ti/davinci_emac.c
>>> +++ b/drivers/net/ethernet/ti/davinci_emac.c
>>> @@ -67,7 +67,7 @@
>>>   #include <linux/of_irq.h>
>>>   #include <linux/of_net.h>
>>>   #include <linux/mfd/syscon.h>
>>> -
>>> +#include <linux/mtd/mtd.h>
>>>   #include <asm/irq.h>
>>>   #include <asm/page.h>
>>> @@ -1783,7 +1783,10 @@ static int davinci_emac_probe(struct
>>> platform_device *pdev)
>>>       struct cpdma_params dma_params;
>>>       struct clk *emac_clk;
>>>       unsigned long emac_bus_frequency;
>>> -
>>> +#ifdef CONFIG_MTD
>>> +    size_t mac_addr_len;
>>> +    struct mtd_info *mtd;
>>> +#endif /* CONFIG_MTD */
>>>       /* obtain emac clock from kernel */
>>>       emac_clk = devm_clk_get(&pdev->dev, NULL);
>>> @@ -1815,6 +1818,19 @@ static int davinci_emac_probe(struct
>>> platform_device *pdev)
>>>           goto err_free_netdev;
>>>       }
>>> +#ifdef CONFIG_MTD
>>
>>
>> What about the case when MTD is compiled as a module?
>>
>>> +    mtd = get_mtd_device_nm("MAC-Address");
>>
>>
>> What about the case when PTR_ERR(mtd) == -EPROBE_DEFER?
>
>
> To answer my own question: because get_mtd_device_nm() doesn't
> ever return -EPROBE_DEFER.
>
> I'm trying to make this work on LCDK, but the emac driver probes
> before any mtd device is registered, so, I just get -ENODEV even
> though I've added a partition to the device tree labeled
> "MAC-Address". You can see in the kernel messages that MTD is
> not probed until later.
>

I tested it on da850-evm - all MTD & SPI related modules need to be
built-in for it to work, so:

CONFIG_MTD=y
CONFIG_MTD_M25P80=y
CONFIG_SPI_DAVINCI=y

Best regards,
Bartosz Golaszewski

>
>>
>>> +    if (!IS_ERR(mtd)) {
>>> +        rc = mtd_read(mtd, 0, ETH_ALEN,
>>> +                  &mac_addr_len, priv->mac_addr);
>>> +        if (rc == 0)
>>> +            dev_info(&pdev->dev,
>>> +                 "Read MAC addr from SPI Flash: %pM\n",
>>> +                 priv->mac_addr);
>>> +        put_mtd_device(mtd);
>>> +    }
>>> +#endif /* CONFIG_MTD */
>>> +
>>>       /* MAC addr and PHY mask , RMII enable info from platform_data */
>>>       memcpy(priv->mac_addr, pdata->mac_addr, ETH_ALEN);
>>>       priv->phy_id = pdata->phy_id;
>>>
>>
>

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

* Re: [PATCH v4 08/18] net: davinci_emac: potentially get the MAC address from MTD
  2018-06-29  9:40   ` Bartosz Golaszewski
@ 2018-07-03 16:39     ` Florian Fainelli
  -1 siblings, 0 replies; 98+ messages in thread
From: Florian Fainelli @ 2018-07-03 16:39 UTC (permalink / raw)
  To: Bartosz Golaszewski, Sekhar Nori, Kevin Hilman, Russell King,
	Grygorii Strashko, David S . Miller, Srinivas Kandagatla,
	Lukas Wunner, Rob Herring, Dan Carpenter, Ivan Khoronzhuk,
	David Lechner, Greg Kroah-Hartman, Andrew Lunn, Jonathan Corbet
  Cc: linux-arm-kernel, linux-kernel, linux-omap, netdev, Bartosz Golaszewski



On 06/29/2018 02:40 AM, Bartosz Golaszewski wrote:
> From: Bartosz Golaszewski <bgolaszewski@baylibre.com>
> 
> On da850-evm board we can read the MAC address from MTD. It's currently
> done in the relevant board file, but we want to get rid of all the MAC
> reading callbacks from the board file (SPI and NAND). Move the reading
> of the MAC address from SPI to the emac driver's probe function.

This should be made something generic to all drivers, not just something
the davinci_emac driver does, something like this actually:

https://lkml.org/lkml/2018/3/24/312

> 
> Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
> ---
>  drivers/net/ethernet/ti/davinci_emac.c | 20 ++++++++++++++++++--
>  1 file changed, 18 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/ethernet/ti/davinci_emac.c b/drivers/net/ethernet/ti/davinci_emac.c
> index a1a6445b5a7e..48e6a7755811 100644
> --- a/drivers/net/ethernet/ti/davinci_emac.c
> +++ b/drivers/net/ethernet/ti/davinci_emac.c
> @@ -67,7 +67,7 @@
>  #include <linux/of_irq.h>
>  #include <linux/of_net.h>
>  #include <linux/mfd/syscon.h>
> -
> +#include <linux/mtd/mtd.h>
>  #include <asm/irq.h>
>  #include <asm/page.h>
>  
> @@ -1783,7 +1783,10 @@ static int davinci_emac_probe(struct platform_device *pdev)
>  	struct cpdma_params dma_params;
>  	struct clk *emac_clk;
>  	unsigned long emac_bus_frequency;
> -
> +#ifdef CONFIG_MTD
> +	size_t mac_addr_len;
> +	struct mtd_info *mtd;
> +#endif /* CONFIG_MTD */
>  
>  	/* obtain emac clock from kernel */
>  	emac_clk = devm_clk_get(&pdev->dev, NULL);
> @@ -1815,6 +1818,19 @@ static int davinci_emac_probe(struct platform_device *pdev)
>  		goto err_free_netdev;
>  	}
>  
> +#ifdef CONFIG_MTD
> +	mtd = get_mtd_device_nm("MAC-Address");
> +	if (!IS_ERR(mtd)) {
> +		rc = mtd_read(mtd, 0, ETH_ALEN,
> +			      &mac_addr_len, priv->mac_addr);
> +		if (rc == 0)
> +			dev_info(&pdev->dev,
> +				 "Read MAC addr from SPI Flash: %pM\n",
> +				 priv->mac_addr);
> +		put_mtd_device(mtd);
> +	}
> +#endif /* CONFIG_MTD */
> +
>  	/* MAC addr and PHY mask , RMII enable info from platform_data */
>  	memcpy(priv->mac_addr, pdata->mac_addr, ETH_ALEN);
>  	priv->phy_id = pdata->phy_id;
> 

-- 
Florian

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

* [PATCH v4 08/18] net: davinci_emac: potentially get the MAC address from MTD
@ 2018-07-03 16:39     ` Florian Fainelli
  0 siblings, 0 replies; 98+ messages in thread
From: Florian Fainelli @ 2018-07-03 16:39 UTC (permalink / raw)
  To: linux-arm-kernel



On 06/29/2018 02:40 AM, Bartosz Golaszewski wrote:
> From: Bartosz Golaszewski <bgolaszewski@baylibre.com>
> 
> On da850-evm board we can read the MAC address from MTD. It's currently
> done in the relevant board file, but we want to get rid of all the MAC
> reading callbacks from the board file (SPI and NAND). Move the reading
> of the MAC address from SPI to the emac driver's probe function.

This should be made something generic to all drivers, not just something
the davinci_emac driver does, something like this actually:

https://lkml.org/lkml/2018/3/24/312

> 
> Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
> ---
>  drivers/net/ethernet/ti/davinci_emac.c | 20 ++++++++++++++++++--
>  1 file changed, 18 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/ethernet/ti/davinci_emac.c b/drivers/net/ethernet/ti/davinci_emac.c
> index a1a6445b5a7e..48e6a7755811 100644
> --- a/drivers/net/ethernet/ti/davinci_emac.c
> +++ b/drivers/net/ethernet/ti/davinci_emac.c
> @@ -67,7 +67,7 @@
>  #include <linux/of_irq.h>
>  #include <linux/of_net.h>
>  #include <linux/mfd/syscon.h>
> -
> +#include <linux/mtd/mtd.h>
>  #include <asm/irq.h>
>  #include <asm/page.h>
>  
> @@ -1783,7 +1783,10 @@ static int davinci_emac_probe(struct platform_device *pdev)
>  	struct cpdma_params dma_params;
>  	struct clk *emac_clk;
>  	unsigned long emac_bus_frequency;
> -
> +#ifdef CONFIG_MTD
> +	size_t mac_addr_len;
> +	struct mtd_info *mtd;
> +#endif /* CONFIG_MTD */
>  
>  	/* obtain emac clock from kernel */
>  	emac_clk = devm_clk_get(&pdev->dev, NULL);
> @@ -1815,6 +1818,19 @@ static int davinci_emac_probe(struct platform_device *pdev)
>  		goto err_free_netdev;
>  	}
>  
> +#ifdef CONFIG_MTD
> +	mtd = get_mtd_device_nm("MAC-Address");
> +	if (!IS_ERR(mtd)) {
> +		rc = mtd_read(mtd, 0, ETH_ALEN,
> +			      &mac_addr_len, priv->mac_addr);
> +		if (rc == 0)
> +			dev_info(&pdev->dev,
> +				 "Read MAC addr from SPI Flash: %pM\n",
> +				 priv->mac_addr);
> +		put_mtd_device(mtd);
> +	}
> +#endif /* CONFIG_MTD */
> +
>  	/* MAC addr and PHY mask , RMII enable info from platform_data */
>  	memcpy(priv->mac_addr, pdata->mac_addr, ETH_ALEN);
>  	priv->phy_id = pdata->phy_id;
> 

-- 
Florian

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

* Re: [PATCH v4 08/18] net: davinci_emac: potentially get the MAC address from MTD
  2018-07-03 16:39     ` Florian Fainelli
@ 2018-07-03 16:47       ` David Lechner
  -1 siblings, 0 replies; 98+ messages in thread
From: David Lechner @ 2018-07-03 16:47 UTC (permalink / raw)
  To: Florian Fainelli, Bartosz Golaszewski, Sekhar Nori, Kevin Hilman,
	Russell King, Grygorii Strashko, David S . Miller,
	Srinivas Kandagatla, Lukas Wunner, Rob Herring, Dan Carpenter,
	Ivan Khoronzhuk, Greg Kroah-Hartman, Andrew Lunn,
	Jonathan Corbet
  Cc: linux-arm-kernel, linux-kernel, linux-omap, netdev, Bartosz Golaszewski

On 07/03/2018 11:39 AM, Florian Fainelli wrote:
> 
> 
> On 06/29/2018 02:40 AM, Bartosz Golaszewski wrote:
>> From: Bartosz Golaszewski <bgolaszewski@baylibre.com>
>>
>> On da850-evm board we can read the MAC address from MTD. It's currently
>> done in the relevant board file, but we want to get rid of all the MAC
>> reading callbacks from the board file (SPI and NAND). Move the reading
>> of the MAC address from SPI to the emac driver's probe function.
> 
> This should be made something generic to all drivers, not just something
> the davinci_emac driver does, something like this actually:
> 
> https://lkml.org/lkml/2018/3/24/312
> 

I was thinking about suggesting adding a nvmem provider for MTD devices
as well. It would fix the kernel config dependency problems I was running
into since nvmem lookups can do -EPROBE_DEFER.


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

* [PATCH v4 08/18] net: davinci_emac: potentially get the MAC address from MTD
@ 2018-07-03 16:47       ` David Lechner
  0 siblings, 0 replies; 98+ messages in thread
From: David Lechner @ 2018-07-03 16:47 UTC (permalink / raw)
  To: linux-arm-kernel

On 07/03/2018 11:39 AM, Florian Fainelli wrote:
> 
> 
> On 06/29/2018 02:40 AM, Bartosz Golaszewski wrote:
>> From: Bartosz Golaszewski <bgolaszewski@baylibre.com>
>>
>> On da850-evm board we can read the MAC address from MTD. It's currently
>> done in the relevant board file, but we want to get rid of all the MAC
>> reading callbacks from the board file (SPI and NAND). Move the reading
>> of the MAC address from SPI to the emac driver's probe function.
> 
> This should be made something generic to all drivers, not just something
> the davinci_emac driver does, something like this actually:
> 
> https://lkml.org/lkml/2018/3/24/312
> 

I was thinking about suggesting adding a nvmem provider for MTD devices
as well. It would fix the kernel config dependency problems I was running
into since nvmem lookups can do -EPROBE_DEFER.

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

* Re: [PATCH v4 08/18] net: davinci_emac: potentially get the MAC address from MTD
  2018-07-03 16:39     ` Florian Fainelli
  (?)
@ 2018-07-04  7:09       ` Ladislav Michl
  -1 siblings, 0 replies; 98+ messages in thread
From: Ladislav Michl @ 2018-07-04  7:09 UTC (permalink / raw)
  To: Florian Fainelli
  Cc: Bartosz Golaszewski, Sekhar Nori, Kevin Hilman, Russell King,
	Grygorii Strashko, David S . Miller, Srinivas Kandagatla,
	Lukas Wunner, Rob Herring, Dan Carpenter, Ivan Khoronzhuk,
	David Lechner, Greg Kroah-Hartman, Andrew Lunn, Jonathan Corbet,
	linux-arm-kernel, linux-kernel, linux-omap, netdev,
	Bartosz Golaszewski

On Tue, Jul 03, 2018 at 09:39:51AM -0700, Florian Fainelli wrote:
> 
> 
> On 06/29/2018 02:40 AM, Bartosz Golaszewski wrote:
> > From: Bartosz Golaszewski <bgolaszewski@baylibre.com>
> > 
> > On da850-evm board we can read the MAC address from MTD. It's currently
> > done in the relevant board file, but we want to get rid of all the MAC
> > reading callbacks from the board file (SPI and NAND). Move the reading
> > of the MAC address from SPI to the emac driver's probe function.
> 
> This should be made something generic to all drivers, not just something
> the davinci_emac driver does, something like this actually:
> 
> https://lkml.org/lkml/2018/3/24/312

...and that's would also make it work when MAC address is stored
in 24c08 EEPROM, which is quite common.

> > Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
> > ---
> >  drivers/net/ethernet/ti/davinci_emac.c | 20 ++++++++++++++++++--
> >  1 file changed, 18 insertions(+), 2 deletions(-)
> > 
> > diff --git a/drivers/net/ethernet/ti/davinci_emac.c b/drivers/net/ethernet/ti/davinci_emac.c
> > index a1a6445b5a7e..48e6a7755811 100644
> > --- a/drivers/net/ethernet/ti/davinci_emac.c
> > +++ b/drivers/net/ethernet/ti/davinci_emac.c
> > @@ -67,7 +67,7 @@
> >  #include <linux/of_irq.h>
> >  #include <linux/of_net.h>
> >  #include <linux/mfd/syscon.h>
> > -
> > +#include <linux/mtd/mtd.h>
> >  #include <asm/irq.h>
> >  #include <asm/page.h>
> >  
> > @@ -1783,7 +1783,10 @@ static int davinci_emac_probe(struct platform_device *pdev)
> >  	struct cpdma_params dma_params;
> >  	struct clk *emac_clk;
> >  	unsigned long emac_bus_frequency;
> > -
> > +#ifdef CONFIG_MTD
> > +	size_t mac_addr_len;
> > +	struct mtd_info *mtd;
> > +#endif /* CONFIG_MTD */
> >  
> >  	/* obtain emac clock from kernel */
> >  	emac_clk = devm_clk_get(&pdev->dev, NULL);
> > @@ -1815,6 +1818,19 @@ static int davinci_emac_probe(struct platform_device *pdev)
> >  		goto err_free_netdev;
> >  	}
> >  
> > +#ifdef CONFIG_MTD
> > +	mtd = get_mtd_device_nm("MAC-Address");
> > +	if (!IS_ERR(mtd)) {
> > +		rc = mtd_read(mtd, 0, ETH_ALEN,
> > +			      &mac_addr_len, priv->mac_addr);
> > +		if (rc == 0)
> > +			dev_info(&pdev->dev,
> > +				 "Read MAC addr from SPI Flash: %pM\n",
> > +				 priv->mac_addr);
> > +		put_mtd_device(mtd);
> > +	}
> > +#endif /* CONFIG_MTD */
> > +
> >  	/* MAC addr and PHY mask , RMII enable info from platform_data */
> >  	memcpy(priv->mac_addr, pdata->mac_addr, ETH_ALEN);
> >  	priv->phy_id = pdata->phy_id;
> > 
> 
> -- 
> Florian
> --
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH v4 08/18] net: davinci_emac: potentially get the MAC address from MTD
@ 2018-07-04  7:09       ` Ladislav Michl
  0 siblings, 0 replies; 98+ messages in thread
From: Ladislav Michl @ 2018-07-04  7:09 UTC (permalink / raw)
  To: Florian Fainelli
  Cc: Rob Herring, Grygorii Strashko, David Lechner, Ivan Khoronzhuk,
	Kevin Hilman, Greg Kroah-Hartman, Bartosz Golaszewski,
	Jonathan Corbet, Sekhar Nori, Russell King, linux-kernel,
	Andrew Lunn, Bartosz Golaszewski, Lukas Wunner,
	Srinivas Kandagatla, linux-arm-kernel, netdev, linux-omap,
	David S . Miller, Dan Carpenter

On Tue, Jul 03, 2018 at 09:39:51AM -0700, Florian Fainelli wrote:
> 
> 
> On 06/29/2018 02:40 AM, Bartosz Golaszewski wrote:
> > From: Bartosz Golaszewski <bgolaszewski@baylibre.com>
> > 
> > On da850-evm board we can read the MAC address from MTD. It's currently
> > done in the relevant board file, but we want to get rid of all the MAC
> > reading callbacks from the board file (SPI and NAND). Move the reading
> > of the MAC address from SPI to the emac driver's probe function.
> 
> This should be made something generic to all drivers, not just something
> the davinci_emac driver does, something like this actually:
> 
> https://lkml.org/lkml/2018/3/24/312

...and that's would also make it work when MAC address is stored
in 24c08 EEPROM, which is quite common.

> > Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
> > ---
> >  drivers/net/ethernet/ti/davinci_emac.c | 20 ++++++++++++++++++--
> >  1 file changed, 18 insertions(+), 2 deletions(-)
> > 
> > diff --git a/drivers/net/ethernet/ti/davinci_emac.c b/drivers/net/ethernet/ti/davinci_emac.c
> > index a1a6445b5a7e..48e6a7755811 100644
> > --- a/drivers/net/ethernet/ti/davinci_emac.c
> > +++ b/drivers/net/ethernet/ti/davinci_emac.c
> > @@ -67,7 +67,7 @@
> >  #include <linux/of_irq.h>
> >  #include <linux/of_net.h>
> >  #include <linux/mfd/syscon.h>
> > -
> > +#include <linux/mtd/mtd.h>
> >  #include <asm/irq.h>
> >  #include <asm/page.h>
> >  
> > @@ -1783,7 +1783,10 @@ static int davinci_emac_probe(struct platform_device *pdev)
> >  	struct cpdma_params dma_params;
> >  	struct clk *emac_clk;
> >  	unsigned long emac_bus_frequency;
> > -
> > +#ifdef CONFIG_MTD
> > +	size_t mac_addr_len;
> > +	struct mtd_info *mtd;
> > +#endif /* CONFIG_MTD */
> >  
> >  	/* obtain emac clock from kernel */
> >  	emac_clk = devm_clk_get(&pdev->dev, NULL);
> > @@ -1815,6 +1818,19 @@ static int davinci_emac_probe(struct platform_device *pdev)
> >  		goto err_free_netdev;
> >  	}
> >  
> > +#ifdef CONFIG_MTD
> > +	mtd = get_mtd_device_nm("MAC-Address");
> > +	if (!IS_ERR(mtd)) {
> > +		rc = mtd_read(mtd, 0, ETH_ALEN,
> > +			      &mac_addr_len, priv->mac_addr);
> > +		if (rc == 0)
> > +			dev_info(&pdev->dev,
> > +				 "Read MAC addr from SPI Flash: %pM\n",
> > +				 priv->mac_addr);
> > +		put_mtd_device(mtd);
> > +	}
> > +#endif /* CONFIG_MTD */
> > +
> >  	/* MAC addr and PHY mask , RMII enable info from platform_data */
> >  	memcpy(priv->mac_addr, pdata->mac_addr, ETH_ALEN);
> >  	priv->phy_id = pdata->phy_id;
> > 
> 
> -- 
> Florian
> --
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* [PATCH v4 08/18] net: davinci_emac: potentially get the MAC address from MTD
@ 2018-07-04  7:09       ` Ladislav Michl
  0 siblings, 0 replies; 98+ messages in thread
From: Ladislav Michl @ 2018-07-04  7:09 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Jul 03, 2018 at 09:39:51AM -0700, Florian Fainelli wrote:
> 
> 
> On 06/29/2018 02:40 AM, Bartosz Golaszewski wrote:
> > From: Bartosz Golaszewski <bgolaszewski@baylibre.com>
> > 
> > On da850-evm board we can read the MAC address from MTD. It's currently
> > done in the relevant board file, but we want to get rid of all the MAC
> > reading callbacks from the board file (SPI and NAND). Move the reading
> > of the MAC address from SPI to the emac driver's probe function.
> 
> This should be made something generic to all drivers, not just something
> the davinci_emac driver does, something like this actually:
> 
> https://lkml.org/lkml/2018/3/24/312

...and that's would also make it work when MAC address is stored
in 24c08 EEPROM, which is quite common.

> > Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
> > ---
> >  drivers/net/ethernet/ti/davinci_emac.c | 20 ++++++++++++++++++--
> >  1 file changed, 18 insertions(+), 2 deletions(-)
> > 
> > diff --git a/drivers/net/ethernet/ti/davinci_emac.c b/drivers/net/ethernet/ti/davinci_emac.c
> > index a1a6445b5a7e..48e6a7755811 100644
> > --- a/drivers/net/ethernet/ti/davinci_emac.c
> > +++ b/drivers/net/ethernet/ti/davinci_emac.c
> > @@ -67,7 +67,7 @@
> >  #include <linux/of_irq.h>
> >  #include <linux/of_net.h>
> >  #include <linux/mfd/syscon.h>
> > -
> > +#include <linux/mtd/mtd.h>
> >  #include <asm/irq.h>
> >  #include <asm/page.h>
> >  
> > @@ -1783,7 +1783,10 @@ static int davinci_emac_probe(struct platform_device *pdev)
> >  	struct cpdma_params dma_params;
> >  	struct clk *emac_clk;
> >  	unsigned long emac_bus_frequency;
> > -
> > +#ifdef CONFIG_MTD
> > +	size_t mac_addr_len;
> > +	struct mtd_info *mtd;
> > +#endif /* CONFIG_MTD */
> >  
> >  	/* obtain emac clock from kernel */
> >  	emac_clk = devm_clk_get(&pdev->dev, NULL);
> > @@ -1815,6 +1818,19 @@ static int davinci_emac_probe(struct platform_device *pdev)
> >  		goto err_free_netdev;
> >  	}
> >  
> > +#ifdef CONFIG_MTD
> > +	mtd = get_mtd_device_nm("MAC-Address");
> > +	if (!IS_ERR(mtd)) {
> > +		rc = mtd_read(mtd, 0, ETH_ALEN,
> > +			      &mac_addr_len, priv->mac_addr);
> > +		if (rc == 0)
> > +			dev_info(&pdev->dev,
> > +				 "Read MAC addr from SPI Flash: %pM\n",
> > +				 priv->mac_addr);
> > +		put_mtd_device(mtd);
> > +	}
> > +#endif /* CONFIG_MTD */
> > +
> >  	/* MAC addr and PHY mask , RMII enable info from platform_data */
> >  	memcpy(priv->mac_addr, pdata->mac_addr, ETH_ALEN);
> >  	priv->phy_id = pdata->phy_id;
> > 
> 
> -- 
> Florian
> --
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majordomo at vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH v4 08/18] net: davinci_emac: potentially get the MAC address from MTD
  2018-07-04  7:09       ` Ladislav Michl
  (?)
  (?)
@ 2018-07-04  8:29         ` Bartosz Golaszewski
  -1 siblings, 0 replies; 98+ messages in thread
From: Bartosz Golaszewski @ 2018-07-04  8:29 UTC (permalink / raw)
  To: Ladislav Michl
  Cc: Florian Fainelli, Sekhar Nori, Kevin Hilman, Russell King,
	Grygorii Strashko, David S . Miller, Srinivas Kandagatla,
	Lukas Wunner, Rob Herring, Dan Carpenter, Ivan Khoronzhuk,
	David Lechner, Greg Kroah-Hartman, Andrew Lunn, Jonathan Corbet,
	Linux ARM, Linux Kernel Mailing List, linux-omap, netdev,
	Bartosz Golaszewski

2018-07-04 9:09 GMT+02:00 Ladislav Michl <ladis@linux-mips.org>:
> On Tue, Jul 03, 2018 at 09:39:51AM -0700, Florian Fainelli wrote:
>>
>>
>> On 06/29/2018 02:40 AM, Bartosz Golaszewski wrote:
>> > From: Bartosz Golaszewski <bgolaszewski@baylibre.com>
>> >
>> > On da850-evm board we can read the MAC address from MTD. It's currently
>> > done in the relevant board file, but we want to get rid of all the MAC
>> > reading callbacks from the board file (SPI and NAND). Move the reading
>> > of the MAC address from SPI to the emac driver's probe function.
>>
>> This should be made something generic to all drivers, not just something
>> the davinci_emac driver does, something like this actually:
>>
>> https://lkml.org/lkml/2018/3/24/312
>
> ...and that's would also make it work when MAC address is stored
> in 24c08 EEPROM, which is quite common.
>

This is what the second patch for davinci_emac in this series does. I
agree that this should become more generic at some point - we should
probably have a routine somewhere in net that would try to get the MAC
address from all possible sources (nvmem, of etc.). This is somewhat
related to the work I want to do on nvmem to make the at24 setup()
callback more generic.

Unfortunately we don't have it yet and I will not have time to work on
it before v4.20 so if there are no serious objections, I'd like to get
this series merged for v4.19 and then we can refactor the MAC reading
later.

How does it sound?

Best regards,
Bartosz Golaszewski

>> > Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
>> > ---
>> >  drivers/net/ethernet/ti/davinci_emac.c | 20 ++++++++++++++++++--
>> >  1 file changed, 18 insertions(+), 2 deletions(-)
>> >
>> > diff --git a/drivers/net/ethernet/ti/davinci_emac.c b/drivers/net/ethernet/ti/davinci_emac.c
>> > index a1a6445b5a7e..48e6a7755811 100644
>> > --- a/drivers/net/ethernet/ti/davinci_emac.c
>> > +++ b/drivers/net/ethernet/ti/davinci_emac.c
>> > @@ -67,7 +67,7 @@
>> >  #include <linux/of_irq.h>
>> >  #include <linux/of_net.h>
>> >  #include <linux/mfd/syscon.h>
>> > -
>> > +#include <linux/mtd/mtd.h>
>> >  #include <asm/irq.h>
>> >  #include <asm/page.h>
>> >
>> > @@ -1783,7 +1783,10 @@ static int davinci_emac_probe(struct platform_device *pdev)
>> >     struct cpdma_params dma_params;
>> >     struct clk *emac_clk;
>> >     unsigned long emac_bus_frequency;
>> > -
>> > +#ifdef CONFIG_MTD
>> > +   size_t mac_addr_len;
>> > +   struct mtd_info *mtd;
>> > +#endif /* CONFIG_MTD */
>> >
>> >     /* obtain emac clock from kernel */
>> >     emac_clk = devm_clk_get(&pdev->dev, NULL);
>> > @@ -1815,6 +1818,19 @@ static int davinci_emac_probe(struct platform_device *pdev)
>> >             goto err_free_netdev;
>> >     }
>> >
>> > +#ifdef CONFIG_MTD
>> > +   mtd = get_mtd_device_nm("MAC-Address");
>> > +   if (!IS_ERR(mtd)) {
>> > +           rc = mtd_read(mtd, 0, ETH_ALEN,
>> > +                         &mac_addr_len, priv->mac_addr);
>> > +           if (rc == 0)
>> > +                   dev_info(&pdev->dev,
>> > +                            "Read MAC addr from SPI Flash: %pM\n",
>> > +                            priv->mac_addr);
>> > +           put_mtd_device(mtd);
>> > +   }
>> > +#endif /* CONFIG_MTD */
>> > +
>> >     /* MAC addr and PHY mask , RMII enable info from platform_data */
>> >     memcpy(priv->mac_addr, pdata->mac_addr, ETH_ALEN);
>> >     priv->phy_id = pdata->phy_id;
>> >
>>
>> --
>> Florian
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH v4 08/18] net: davinci_emac: potentially get the MAC address from MTD
@ 2018-07-04  8:29         ` Bartosz Golaszewski
  0 siblings, 0 replies; 98+ messages in thread
From: Bartosz Golaszewski @ 2018-07-04  8:29 UTC (permalink / raw)
  To: Ladislav Michl
  Cc: Florian Fainelli, Sekhar Nori, Kevin Hilman, Russell King,
	Grygorii Strashko, David S . Miller, Srinivas Kandagatla,
	Lukas Wunner, Rob Herring, Dan Carpenter, Ivan Khoronzhuk,
	David Lechner, Greg Kroah-Hartman, Andrew Lunn, Jonathan Corbet,
	Linux ARM, Linux Kernel Mailing List, linux-omap, netdev,
	Bartosz

2018-07-04 9:09 GMT+02:00 Ladislav Michl <ladis@linux-mips.org>:
> On Tue, Jul 03, 2018 at 09:39:51AM -0700, Florian Fainelli wrote:
>>
>>
>> On 06/29/2018 02:40 AM, Bartosz Golaszewski wrote:
>> > From: Bartosz Golaszewski <bgolaszewski@baylibre.com>
>> >
>> > On da850-evm board we can read the MAC address from MTD. It's currently
>> > done in the relevant board file, but we want to get rid of all the MAC
>> > reading callbacks from the board file (SPI and NAND). Move the reading
>> > of the MAC address from SPI to the emac driver's probe function.
>>
>> This should be made something generic to all drivers, not just something
>> the davinci_emac driver does, something like this actually:
>>
>> https://lkml.org/lkml/2018/3/24/312
>
> ...and that's would also make it work when MAC address is stored
> in 24c08 EEPROM, which is quite common.
>

This is what the second patch for davinci_emac in this series does. I
agree that this should become more generic at some point - we should
probably have a routine somewhere in net that would try to get the MAC
address from all possible sources (nvmem, of etc.). This is somewhat
related to the work I want to do on nvmem to make the at24 setup()
callback more generic.

Unfortunately we don't have it yet and I will not have time to work on
it before v4.20 so if there are no serious objections, I'd like to get
this series merged for v4.19 and then we can refactor the MAC reading
later.

How does it sound?

Best regards,
Bartosz Golaszewski

>> > Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
>> > ---
>> >  drivers/net/ethernet/ti/davinci_emac.c | 20 ++++++++++++++++++--
>> >  1 file changed, 18 insertions(+), 2 deletions(-)
>> >
>> > diff --git a/drivers/net/ethernet/ti/davinci_emac.c b/drivers/net/ethernet/ti/davinci_emac.c
>> > index a1a6445b5a7e..48e6a7755811 100644
>> > --- a/drivers/net/ethernet/ti/davinci_emac.c
>> > +++ b/drivers/net/ethernet/ti/davinci_emac.c
>> > @@ -67,7 +67,7 @@
>> >  #include <linux/of_irq.h>
>> >  #include <linux/of_net.h>
>> >  #include <linux/mfd/syscon.h>
>> > -
>> > +#include <linux/mtd/mtd.h>
>> >  #include <asm/irq.h>
>> >  #include <asm/page.h>
>> >
>> > @@ -1783,7 +1783,10 @@ static int davinci_emac_probe(struct platform_device *pdev)
>> >     struct cpdma_params dma_params;
>> >     struct clk *emac_clk;
>> >     unsigned long emac_bus_frequency;
>> > -
>> > +#ifdef CONFIG_MTD
>> > +   size_t mac_addr_len;
>> > +   struct mtd_info *mtd;
>> > +#endif /* CONFIG_MTD */
>> >
>> >     /* obtain emac clock from kernel */
>> >     emac_clk = devm_clk_get(&pdev->dev, NULL);
>> > @@ -1815,6 +1818,19 @@ static int davinci_emac_probe(struct platform_device *pdev)
>> >             goto err_free_netdev;
>> >     }
>> >
>> > +#ifdef CONFIG_MTD
>> > +   mtd = get_mtd_device_nm("MAC-Address");
>> > +   if (!IS_ERR(mtd)) {
>> > +           rc = mtd_read(mtd, 0, ETH_ALEN,
>> > +                         &mac_addr_len, priv->mac_addr);
>> > +           if (rc == 0)
>> > +                   dev_info(&pdev->dev,
>> > +                            "Read MAC addr from SPI Flash: %pM\n",
>> > +                            priv->mac_addr);
>> > +           put_mtd_device(mtd);
>> > +   }
>> > +#endif /* CONFIG_MTD */
>> > +
>> >     /* MAC addr and PHY mask , RMII enable info from platform_data */
>> >     memcpy(priv->mac_addr, pdata->mac_addr, ETH_ALEN);
>> >     priv->phy_id = pdata->phy_id;
>> >
>>
>> --
>> Florian
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH v4 08/18] net: davinci_emac: potentially get the MAC address from MTD
@ 2018-07-04  8:29         ` Bartosz Golaszewski
  0 siblings, 0 replies; 98+ messages in thread
From: Bartosz Golaszewski @ 2018-07-04  8:29 UTC (permalink / raw)
  To: Ladislav Michl
  Cc: Florian Fainelli, Sekhar Nori, Kevin Hilman, Russell King,
	Grygorii Strashko, David S . Miller, Srinivas Kandagatla,
	Lukas Wunner, Rob Herring, Dan Carpenter, Ivan Khoronzhuk,
	David Lechner, Greg Kroah-Hartman, Andrew Lunn, Jonathan Corbet,
	Linux ARM, Linux Kernel Mailing List, linux-omap, netdev,
	Bartosz

2018-07-04 9:09 GMT+02:00 Ladislav Michl <ladis@linux-mips.org>:
> On Tue, Jul 03, 2018 at 09:39:51AM -0700, Florian Fainelli wrote:
>>
>>
>> On 06/29/2018 02:40 AM, Bartosz Golaszewski wrote:
>> > From: Bartosz Golaszewski <bgolaszewski@baylibre.com>
>> >
>> > On da850-evm board we can read the MAC address from MTD. It's currently
>> > done in the relevant board file, but we want to get rid of all the MAC
>> > reading callbacks from the board file (SPI and NAND). Move the reading
>> > of the MAC address from SPI to the emac driver's probe function.
>>
>> This should be made something generic to all drivers, not just something
>> the davinci_emac driver does, something like this actually:
>>
>> https://lkml.org/lkml/2018/3/24/312
>
> ...and that's would also make it work when MAC address is stored
> in 24c08 EEPROM, which is quite common.
>

This is what the second patch for davinci_emac in this series does. I
agree that this should become more generic at some point - we should
probably have a routine somewhere in net that would try to get the MAC
address from all possible sources (nvmem, of etc.). This is somewhat
related to the work I want to do on nvmem to make the at24 setup()
callback more generic.

Unfortunately we don't have it yet and I will not have time to work on
it before v4.20 so if there are no serious objections, I'd like to get
this series merged for v4.19 and then we can refactor the MAC reading
later.

How does it sound?

Best regards,
Bartosz Golaszewski

>> > Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
>> > ---
>> >  drivers/net/ethernet/ti/davinci_emac.c | 20 ++++++++++++++++++--
>> >  1 file changed, 18 insertions(+), 2 deletions(-)
>> >
>> > diff --git a/drivers/net/ethernet/ti/davinci_emac.c b/drivers/net/ethernet/ti/davinci_emac.c
>> > index a1a6445b5a7e..48e6a7755811 100644
>> > --- a/drivers/net/ethernet/ti/davinci_emac.c
>> > +++ b/drivers/net/ethernet/ti/davinci_emac.c
>> > @@ -67,7 +67,7 @@
>> >  #include <linux/of_irq.h>
>> >  #include <linux/of_net.h>
>> >  #include <linux/mfd/syscon.h>
>> > -
>> > +#include <linux/mtd/mtd.h>
>> >  #include <asm/irq.h>
>> >  #include <asm/page.h>
>> >
>> > @@ -1783,7 +1783,10 @@ static int davinci_emac_probe(struct platform_device *pdev)
>> >     struct cpdma_params dma_params;
>> >     struct clk *emac_clk;
>> >     unsigned long emac_bus_frequency;
>> > -
>> > +#ifdef CONFIG_MTD
>> > +   size_t mac_addr_len;
>> > +   struct mtd_info *mtd;
>> > +#endif /* CONFIG_MTD */
>> >
>> >     /* obtain emac clock from kernel */
>> >     emac_clk = devm_clk_get(&pdev->dev, NULL);
>> > @@ -1815,6 +1818,19 @@ static int davinci_emac_probe(struct platform_device *pdev)
>> >             goto err_free_netdev;
>> >     }
>> >
>> > +#ifdef CONFIG_MTD
>> > +   mtd = get_mtd_device_nm("MAC-Address");
>> > +   if (!IS_ERR(mtd)) {
>> > +           rc = mtd_read(mtd, 0, ETH_ALEN,
>> > +                         &mac_addr_len, priv->mac_addr);
>> > +           if (rc == 0)
>> > +                   dev_info(&pdev->dev,
>> > +                            "Read MAC addr from SPI Flash: %pM\n",
>> > +                            priv->mac_addr);
>> > +           put_mtd_device(mtd);
>> > +   }
>> > +#endif /* CONFIG_MTD */
>> > +
>> >     /* MAC addr and PHY mask , RMII enable info from platform_data */
>> >     memcpy(priv->mac_addr, pdata->mac_addr, ETH_ALEN);
>> >     priv->phy_id = pdata->phy_id;
>> >
>>
>> --
>> Florian
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* [PATCH v4 08/18] net: davinci_emac: potentially get the MAC address from MTD
@ 2018-07-04  8:29         ` Bartosz Golaszewski
  0 siblings, 0 replies; 98+ messages in thread
From: Bartosz Golaszewski @ 2018-07-04  8:29 UTC (permalink / raw)
  To: linux-arm-kernel

2018-07-04 9:09 GMT+02:00 Ladislav Michl <ladis@linux-mips.org>:
> On Tue, Jul 03, 2018 at 09:39:51AM -0700, Florian Fainelli wrote:
>>
>>
>> On 06/29/2018 02:40 AM, Bartosz Golaszewski wrote:
>> > From: Bartosz Golaszewski <bgolaszewski@baylibre.com>
>> >
>> > On da850-evm board we can read the MAC address from MTD. It's currently
>> > done in the relevant board file, but we want to get rid of all the MAC
>> > reading callbacks from the board file (SPI and NAND). Move the reading
>> > of the MAC address from SPI to the emac driver's probe function.
>>
>> This should be made something generic to all drivers, not just something
>> the davinci_emac driver does, something like this actually:
>>
>> https://lkml.org/lkml/2018/3/24/312
>
> ...and that's would also make it work when MAC address is stored
> in 24c08 EEPROM, which is quite common.
>

This is what the second patch for davinci_emac in this series does. I
agree that this should become more generic at some point - we should
probably have a routine somewhere in net that would try to get the MAC
address from all possible sources (nvmem, of etc.). This is somewhat
related to the work I want to do on nvmem to make the at24 setup()
callback more generic.

Unfortunately we don't have it yet and I will not have time to work on
it before v4.20 so if there are no serious objections, I'd like to get
this series merged for v4.19 and then we can refactor the MAC reading
later.

How does it sound?

Best regards,
Bartosz Golaszewski

>> > Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
>> > ---
>> >  drivers/net/ethernet/ti/davinci_emac.c | 20 ++++++++++++++++++--
>> >  1 file changed, 18 insertions(+), 2 deletions(-)
>> >
>> > diff --git a/drivers/net/ethernet/ti/davinci_emac.c b/drivers/net/ethernet/ti/davinci_emac.c
>> > index a1a6445b5a7e..48e6a7755811 100644
>> > --- a/drivers/net/ethernet/ti/davinci_emac.c
>> > +++ b/drivers/net/ethernet/ti/davinci_emac.c
>> > @@ -67,7 +67,7 @@
>> >  #include <linux/of_irq.h>
>> >  #include <linux/of_net.h>
>> >  #include <linux/mfd/syscon.h>
>> > -
>> > +#include <linux/mtd/mtd.h>
>> >  #include <asm/irq.h>
>> >  #include <asm/page.h>
>> >
>> > @@ -1783,7 +1783,10 @@ static int davinci_emac_probe(struct platform_device *pdev)
>> >     struct cpdma_params dma_params;
>> >     struct clk *emac_clk;
>> >     unsigned long emac_bus_frequency;
>> > -
>> > +#ifdef CONFIG_MTD
>> > +   size_t mac_addr_len;
>> > +   struct mtd_info *mtd;
>> > +#endif /* CONFIG_MTD */
>> >
>> >     /* obtain emac clock from kernel */
>> >     emac_clk = devm_clk_get(&pdev->dev, NULL);
>> > @@ -1815,6 +1818,19 @@ static int davinci_emac_probe(struct platform_device *pdev)
>> >             goto err_free_netdev;
>> >     }
>> >
>> > +#ifdef CONFIG_MTD
>> > +   mtd = get_mtd_device_nm("MAC-Address");
>> > +   if (!IS_ERR(mtd)) {
>> > +           rc = mtd_read(mtd, 0, ETH_ALEN,
>> > +                         &mac_addr_len, priv->mac_addr);
>> > +           if (rc == 0)
>> > +                   dev_info(&pdev->dev,
>> > +                            "Read MAC addr from SPI Flash: %pM\n",
>> > +                            priv->mac_addr);
>> > +           put_mtd_device(mtd);
>> > +   }
>> > +#endif /* CONFIG_MTD */
>> > +
>> >     /* MAC addr and PHY mask , RMII enable info from platform_data */
>> >     memcpy(priv->mac_addr, pdata->mac_addr, ETH_ALEN);
>> >     priv->phy_id = pdata->phy_id;
>> >
>>
>> --
>> Florian
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
>> the body of a message to majordomo at vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH v4 08/18] net: davinci_emac: potentially get the MAC address from MTD
  2018-07-04  8:29         ` Bartosz Golaszewski
  (?)
@ 2018-07-04  9:04           ` Sekhar Nori
  -1 siblings, 0 replies; 98+ messages in thread
From: Sekhar Nori @ 2018-07-04  9:04 UTC (permalink / raw)
  To: Bartosz Golaszewski, Ladislav Michl
  Cc: Florian Fainelli, Kevin Hilman, Russell King, Grygorii Strashko,
	David S . Miller, Srinivas Kandagatla, Lukas Wunner, Rob Herring,
	Dan Carpenter, Ivan Khoronzhuk, David Lechner,
	Greg Kroah-Hartman, Andrew Lunn, Jonathan Corbet, Linux ARM,
	Linux Kernel Mailing List, linux-omap, netdev,
	Bartosz Golaszewski

On Wednesday 04 July 2018 01:59 PM, Bartosz Golaszewski wrote:
> 2018-07-04 9:09 GMT+02:00 Ladislav Michl <ladis@linux-mips.org>:
>> On Tue, Jul 03, 2018 at 09:39:51AM -0700, Florian Fainelli wrote:
>>>
>>>
>>> On 06/29/2018 02:40 AM, Bartosz Golaszewski wrote:
>>>> From: Bartosz Golaszewski <bgolaszewski@baylibre.com>
>>>>
>>>> On da850-evm board we can read the MAC address from MTD. It's currently
>>>> done in the relevant board file, but we want to get rid of all the MAC
>>>> reading callbacks from the board file (SPI and NAND). Move the reading
>>>> of the MAC address from SPI to the emac driver's probe function.
>>>
>>> This should be made something generic to all drivers, not just something
>>> the davinci_emac driver does, something like this actually:
>>>
>>> https://lkml.org/lkml/2018/3/24/312
>>
>> ...and that's would also make it work when MAC address is stored
>> in 24c08 EEPROM, which is quite common.
>>
> 
> This is what the second patch for davinci_emac in this series does. I
> agree that this should become more generic at some point - we should
> probably have a routine somewhere in net that would try to get the MAC
> address from all possible sources (nvmem, of etc.). This is somewhat
> related to the work I want to do on nvmem to make the at24 setup()
> callback more generic.
> 
> Unfortunately we don't have it yet and I will not have time to work on
> it before v4.20 so if there are no serious objections, I'd like to get
> this series merged for v4.19 and then we can refactor the MAC reading
> later.
> 
> How does it sound?

I don't think the series introduces any regressions. We need to have MTD
and SPI flash built into the kernel even today to get mac address on
DA850 EVM. So from that perspective, I don't have objections (I need to
actually test still).

OTOH, it will be nice to do the conversion once and not piecemeal. That
way there is less churn and scope for regressions.

So from a mach-davinci perspective, I don't have a very strong position
either way.

Thanks,
Sekhar

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

* Re: [PATCH v4 08/18] net: davinci_emac: potentially get the MAC address from MTD
@ 2018-07-04  9:04           ` Sekhar Nori
  0 siblings, 0 replies; 98+ messages in thread
From: Sekhar Nori @ 2018-07-04  9:04 UTC (permalink / raw)
  To: Bartosz Golaszewski, Ladislav Michl
  Cc: Rob Herring, Grygorii Strashko, David Lechner, Ivan Khoronzhuk,
	Kevin Hilman, Greg Kroah-Hartman, Jonathan Corbet, Russell King,
	Linux Kernel Mailing List, Andrew Lunn, Bartosz Golaszewski,
	Florian Fainelli, Srinivas Kandagatla, Linux ARM, netdev,
	Lukas Wunner, linux-omap, David S . Miller, Dan Carpenter

On Wednesday 04 July 2018 01:59 PM, Bartosz Golaszewski wrote:
> 2018-07-04 9:09 GMT+02:00 Ladislav Michl <ladis@linux-mips.org>:
>> On Tue, Jul 03, 2018 at 09:39:51AM -0700, Florian Fainelli wrote:
>>>
>>>
>>> On 06/29/2018 02:40 AM, Bartosz Golaszewski wrote:
>>>> From: Bartosz Golaszewski <bgolaszewski@baylibre.com>
>>>>
>>>> On da850-evm board we can read the MAC address from MTD. It's currently
>>>> done in the relevant board file, but we want to get rid of all the MAC
>>>> reading callbacks from the board file (SPI and NAND). Move the reading
>>>> of the MAC address from SPI to the emac driver's probe function.
>>>
>>> This should be made something generic to all drivers, not just something
>>> the davinci_emac driver does, something like this actually:
>>>
>>> https://lkml.org/lkml/2018/3/24/312
>>
>> ...and that's would also make it work when MAC address is stored
>> in 24c08 EEPROM, which is quite common.
>>
> 
> This is what the second patch for davinci_emac in this series does. I
> agree that this should become more generic at some point - we should
> probably have a routine somewhere in net that would try to get the MAC
> address from all possible sources (nvmem, of etc.). This is somewhat
> related to the work I want to do on nvmem to make the at24 setup()
> callback more generic.
> 
> Unfortunately we don't have it yet and I will not have time to work on
> it before v4.20 so if there are no serious objections, I'd like to get
> this series merged for v4.19 and then we can refactor the MAC reading
> later.
> 
> How does it sound?

I don't think the series introduces any regressions. We need to have MTD
and SPI flash built into the kernel even today to get mac address on
DA850 EVM. So from that perspective, I don't have objections (I need to
actually test still).

OTOH, it will be nice to do the conversion once and not piecemeal. That
way there is less churn and scope for regressions.

So from a mach-davinci perspective, I don't have a very strong position
either way.

Thanks,
Sekhar

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

* [PATCH v4 08/18] net: davinci_emac: potentially get the MAC address from MTD
@ 2018-07-04  9:04           ` Sekhar Nori
  0 siblings, 0 replies; 98+ messages in thread
From: Sekhar Nori @ 2018-07-04  9:04 UTC (permalink / raw)
  To: linux-arm-kernel

On Wednesday 04 July 2018 01:59 PM, Bartosz Golaszewski wrote:
> 2018-07-04 9:09 GMT+02:00 Ladislav Michl <ladis@linux-mips.org>:
>> On Tue, Jul 03, 2018 at 09:39:51AM -0700, Florian Fainelli wrote:
>>>
>>>
>>> On 06/29/2018 02:40 AM, Bartosz Golaszewski wrote:
>>>> From: Bartosz Golaszewski <bgolaszewski@baylibre.com>
>>>>
>>>> On da850-evm board we can read the MAC address from MTD. It's currently
>>>> done in the relevant board file, but we want to get rid of all the MAC
>>>> reading callbacks from the board file (SPI and NAND). Move the reading
>>>> of the MAC address from SPI to the emac driver's probe function.
>>>
>>> This should be made something generic to all drivers, not just something
>>> the davinci_emac driver does, something like this actually:
>>>
>>> https://lkml.org/lkml/2018/3/24/312
>>
>> ...and that's would also make it work when MAC address is stored
>> in 24c08 EEPROM, which is quite common.
>>
> 
> This is what the second patch for davinci_emac in this series does. I
> agree that this should become more generic at some point - we should
> probably have a routine somewhere in net that would try to get the MAC
> address from all possible sources (nvmem, of etc.). This is somewhat
> related to the work I want to do on nvmem to make the at24 setup()
> callback more generic.
> 
> Unfortunately we don't have it yet and I will not have time to work on
> it before v4.20 so if there are no serious objections, I'd like to get
> this series merged for v4.19 and then we can refactor the MAC reading
> later.
> 
> How does it sound?

I don't think the series introduces any regressions. We need to have MTD
and SPI flash built into the kernel even today to get mac address on
DA850 EVM. So from that perspective, I don't have objections (I need to
actually test still).

OTOH, it will be nice to do the conversion once and not piecemeal. That
way there is less churn and scope for regressions.

So from a mach-davinci perspective, I don't have a very strong position
either way.

Thanks,
Sekhar

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

* Re: [PATCH v4 08/18] net: davinci_emac: potentially get the MAC address from MTD
  2018-07-04  9:04           ` Sekhar Nori
  (?)
  (?)
@ 2018-07-13 18:00             ` Bartosz Golaszewski
  -1 siblings, 0 replies; 98+ messages in thread
From: Bartosz Golaszewski @ 2018-07-13 18:00 UTC (permalink / raw)
  To: Sekhar Nori
  Cc: Ladislav Michl, Florian Fainelli, Kevin Hilman, Russell King,
	Grygorii Strashko, David S . Miller, Srinivas Kandagatla,
	Lukas Wunner, Rob Herring, Dan Carpenter, Ivan Khoronzhuk,
	David Lechner, Greg Kroah-Hartman, Andrew Lunn, Jonathan Corbet,
	Linux ARM, Linux Kernel Mailing List, linux-omap, netdev,
	Bartosz Golaszewski

2018-07-04 11:04 GMT+02:00 Sekhar Nori <nsekhar@ti.com>:
> On Wednesday 04 July 2018 01:59 PM, Bartosz Golaszewski wrote:
>> 2018-07-04 9:09 GMT+02:00 Ladislav Michl <ladis@linux-mips.org>:
>>> On Tue, Jul 03, 2018 at 09:39:51AM -0700, Florian Fainelli wrote:
>>>>
>>>>
>>>> On 06/29/2018 02:40 AM, Bartosz Golaszewski wrote:
>>>>> From: Bartosz Golaszewski <bgolaszewski@baylibre.com>
>>>>>
>>>>> On da850-evm board we can read the MAC address from MTD. It's currently
>>>>> done in the relevant board file, but we want to get rid of all the MAC
>>>>> reading callbacks from the board file (SPI and NAND). Move the reading
>>>>> of the MAC address from SPI to the emac driver's probe function.
>>>>
>>>> This should be made something generic to all drivers, not just something
>>>> the davinci_emac driver does, something like this actually:
>>>>
>>>> https://lkml.org/lkml/2018/3/24/312
>>>
>>> ...and that's would also make it work when MAC address is stored
>>> in 24c08 EEPROM, which is quite common.
>>>
>>
>> This is what the second patch for davinci_emac in this series does. I
>> agree that this should become more generic at some point - we should
>> probably have a routine somewhere in net that would try to get the MAC
>> address from all possible sources (nvmem, of etc.). This is somewhat
>> related to the work I want to do on nvmem to make the at24 setup()
>> callback more generic.
>>
>> Unfortunately we don't have it yet and I will not have time to work on
>> it before v4.20 so if there are no serious objections, I'd like to get
>> this series merged for v4.19 and then we can refactor the MAC reading
>> later.
>>
>> How does it sound?
>
> I don't think the series introduces any regressions. We need to have MTD
> and SPI flash built into the kernel even today to get mac address on
> DA850 EVM. So from that perspective, I don't have objections (I need to
> actually test still).
>
> OTOH, it will be nice to do the conversion once and not piecemeal. That
> way there is less churn and scope for regressions.
>
> So from a mach-davinci perspective, I don't have a very strong position
> either way.
>
> Thanks,
> Sekhar

We're getting close to rc5 so I'd like to make a case for this series again.

I understand that there's more to do than just the changes introduced
here, but we shouldn't try to fix several problems in many different
places at once. There's just too many moving pieces. I'd rather start
merging small improvements right away.

The idea behind this series is to remove (almost) all users of
at24_platform_data. The davinci_emac patches are there only because we
need to remove some MAC adress reading stuff from the board files.
Having this code there and calling it back from EEPROM/MTD drivers is
already wrong and we should work towards using nvmem for that anyway.

Currently for MTD the nvmem support series seems to be dead and it's
going to take some time before anything gets upstream.

So I'd like to again ask you to consider picking up the patches from
this series to your respective trees or at the very least: I'd like to
ask Srinivas to pick up the nvmem patches and Sekhar to take the
first, non-controversial batch of davinci platform changes so that
we'll have less code to carry for the next release.

Best regards,
Bartosz Golaszewski

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

* Re: [PATCH v4 08/18] net: davinci_emac: potentially get the MAC address from MTD
@ 2018-07-13 18:00             ` Bartosz Golaszewski
  0 siblings, 0 replies; 98+ messages in thread
From: Bartosz Golaszewski @ 2018-07-13 18:00 UTC (permalink / raw)
  To: Sekhar Nori
  Cc: Ladislav Michl, Florian Fainelli, Kevin Hilman, Russell King,
	Grygorii Strashko, David S . Miller, Srinivas Kandagatla,
	Lukas Wunner, Rob Herring, Dan Carpenter, Ivan Khoronzhuk,
	David Lechner, Greg Kroah-Hartman, Andrew Lunn, Jonathan Corbet,
	Linux ARM, Linux Kernel Mailing List, linux-omap, netdev,
	Bartosz

2018-07-04 11:04 GMT+02:00 Sekhar Nori <nsekhar@ti.com>:
> On Wednesday 04 July 2018 01:59 PM, Bartosz Golaszewski wrote:
>> 2018-07-04 9:09 GMT+02:00 Ladislav Michl <ladis@linux-mips.org>:
>>> On Tue, Jul 03, 2018 at 09:39:51AM -0700, Florian Fainelli wrote:
>>>>
>>>>
>>>> On 06/29/2018 02:40 AM, Bartosz Golaszewski wrote:
>>>>> From: Bartosz Golaszewski <bgolaszewski@baylibre.com>
>>>>>
>>>>> On da850-evm board we can read the MAC address from MTD. It's currently
>>>>> done in the relevant board file, but we want to get rid of all the MAC
>>>>> reading callbacks from the board file (SPI and NAND). Move the reading
>>>>> of the MAC address from SPI to the emac driver's probe function.
>>>>
>>>> This should be made something generic to all drivers, not just something
>>>> the davinci_emac driver does, something like this actually:
>>>>
>>>> https://lkml.org/lkml/2018/3/24/312
>>>
>>> ...and that's would also make it work when MAC address is stored
>>> in 24c08 EEPROM, which is quite common.
>>>
>>
>> This is what the second patch for davinci_emac in this series does. I
>> agree that this should become more generic at some point - we should
>> probably have a routine somewhere in net that would try to get the MAC
>> address from all possible sources (nvmem, of etc.). This is somewhat
>> related to the work I want to do on nvmem to make the at24 setup()
>> callback more generic.
>>
>> Unfortunately we don't have it yet and I will not have time to work on
>> it before v4.20 so if there are no serious objections, I'd like to get
>> this series merged for v4.19 and then we can refactor the MAC reading
>> later.
>>
>> How does it sound?
>
> I don't think the series introduces any regressions. We need to have MTD
> and SPI flash built into the kernel even today to get mac address on
> DA850 EVM. So from that perspective, I don't have objections (I need to
> actually test still).
>
> OTOH, it will be nice to do the conversion once and not piecemeal. That
> way there is less churn and scope for regressions.
>
> So from a mach-davinci perspective, I don't have a very strong position
> either way.
>
> Thanks,
> Sekhar

We're getting close to rc5 so I'd like to make a case for this series again.

I understand that there's more to do than just the changes introduced
here, but we shouldn't try to fix several problems in many different
places at once. There's just too many moving pieces. I'd rather start
merging small improvements right away.

The idea behind this series is to remove (almost) all users of
at24_platform_data. The davinci_emac patches are there only because we
need to remove some MAC adress reading stuff from the board files.
Having this code there and calling it back from EEPROM/MTD drivers is
already wrong and we should work towards using nvmem for that anyway.

Currently for MTD the nvmem support series seems to be dead and it's
going to take some time before anything gets upstream.

So I'd like to again ask you to consider picking up the patches from
this series to your respective trees or at the very least: I'd like to
ask Srinivas to pick up the nvmem patches and Sekhar to take the
first, non-controversial batch of davinci platform changes so that
we'll have less code to carry for the next release.

Best regards,
Bartosz Golaszewski

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

* Re: [PATCH v4 08/18] net: davinci_emac: potentially get the MAC address from MTD
@ 2018-07-13 18:00             ` Bartosz Golaszewski
  0 siblings, 0 replies; 98+ messages in thread
From: Bartosz Golaszewski @ 2018-07-13 18:00 UTC (permalink / raw)
  To: Sekhar Nori
  Cc: Ladislav Michl, Florian Fainelli, Kevin Hilman, Russell King,
	Grygorii Strashko, David S . Miller, Srinivas Kandagatla,
	Lukas Wunner, Rob Herring, Dan Carpenter, Ivan Khoronzhuk,
	David Lechner, Greg Kroah-Hartman, Andrew Lunn, Jonathan Corbet,
	Linux ARM, Linux Kernel Mailing List, linux-omap, netdev,
	Bartosz

2018-07-04 11:04 GMT+02:00 Sekhar Nori <nsekhar@ti.com>:
> On Wednesday 04 July 2018 01:59 PM, Bartosz Golaszewski wrote:
>> 2018-07-04 9:09 GMT+02:00 Ladislav Michl <ladis@linux-mips.org>:
>>> On Tue, Jul 03, 2018 at 09:39:51AM -0700, Florian Fainelli wrote:
>>>>
>>>>
>>>> On 06/29/2018 02:40 AM, Bartosz Golaszewski wrote:
>>>>> From: Bartosz Golaszewski <bgolaszewski@baylibre.com>
>>>>>
>>>>> On da850-evm board we can read the MAC address from MTD. It's currently
>>>>> done in the relevant board file, but we want to get rid of all the MAC
>>>>> reading callbacks from the board file (SPI and NAND). Move the reading
>>>>> of the MAC address from SPI to the emac driver's probe function.
>>>>
>>>> This should be made something generic to all drivers, not just something
>>>> the davinci_emac driver does, something like this actually:
>>>>
>>>> https://lkml.org/lkml/2018/3/24/312
>>>
>>> ...and that's would also make it work when MAC address is stored
>>> in 24c08 EEPROM, which is quite common.
>>>
>>
>> This is what the second patch for davinci_emac in this series does. I
>> agree that this should become more generic at some point - we should
>> probably have a routine somewhere in net that would try to get the MAC
>> address from all possible sources (nvmem, of etc.). This is somewhat
>> related to the work I want to do on nvmem to make the at24 setup()
>> callback more generic.
>>
>> Unfortunately we don't have it yet and I will not have time to work on
>> it before v4.20 so if there are no serious objections, I'd like to get
>> this series merged for v4.19 and then we can refactor the MAC reading
>> later.
>>
>> How does it sound?
>
> I don't think the series introduces any regressions. We need to have MTD
> and SPI flash built into the kernel even today to get mac address on
> DA850 EVM. So from that perspective, I don't have objections (I need to
> actually test still).
>
> OTOH, it will be nice to do the conversion once and not piecemeal. That
> way there is less churn and scope for regressions.
>
> So from a mach-davinci perspective, I don't have a very strong position
> either way.
>
> Thanks,
> Sekhar

We're getting close to rc5 so I'd like to make a case for this series again.

I understand that there's more to do than just the changes introduced
here, but we shouldn't try to fix several problems in many different
places at once. There's just too many moving pieces. I'd rather start
merging small improvements right away.

The idea behind this series is to remove (almost) all users of
at24_platform_data. The davinci_emac patches are there only because we
need to remove some MAC adress reading stuff from the board files.
Having this code there and calling it back from EEPROM/MTD drivers is
already wrong and we should work towards using nvmem for that anyway.

Currently for MTD the nvmem support series seems to be dead and it's
going to take some time before anything gets upstream.

So I'd like to again ask you to consider picking up the patches from
this series to your respective trees or at the very least: I'd like to
ask Srinivas to pick up the nvmem patches and Sekhar to take the
first, non-controversial batch of davinci platform changes so that
we'll have less code to carry for the next release.

Best regards,
Bartosz Golaszewski

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

* [PATCH v4 08/18] net: davinci_emac: potentially get the MAC address from MTD
@ 2018-07-13 18:00             ` Bartosz Golaszewski
  0 siblings, 0 replies; 98+ messages in thread
From: Bartosz Golaszewski @ 2018-07-13 18:00 UTC (permalink / raw)
  To: linux-arm-kernel

2018-07-04 11:04 GMT+02:00 Sekhar Nori <nsekhar@ti.com>:
> On Wednesday 04 July 2018 01:59 PM, Bartosz Golaszewski wrote:
>> 2018-07-04 9:09 GMT+02:00 Ladislav Michl <ladis@linux-mips.org>:
>>> On Tue, Jul 03, 2018 at 09:39:51AM -0700, Florian Fainelli wrote:
>>>>
>>>>
>>>> On 06/29/2018 02:40 AM, Bartosz Golaszewski wrote:
>>>>> From: Bartosz Golaszewski <bgolaszewski@baylibre.com>
>>>>>
>>>>> On da850-evm board we can read the MAC address from MTD. It's currently
>>>>> done in the relevant board file, but we want to get rid of all the MAC
>>>>> reading callbacks from the board file (SPI and NAND). Move the reading
>>>>> of the MAC address from SPI to the emac driver's probe function.
>>>>
>>>> This should be made something generic to all drivers, not just something
>>>> the davinci_emac driver does, something like this actually:
>>>>
>>>> https://lkml.org/lkml/2018/3/24/312
>>>
>>> ...and that's would also make it work when MAC address is stored
>>> in 24c08 EEPROM, which is quite common.
>>>
>>
>> This is what the second patch for davinci_emac in this series does. I
>> agree that this should become more generic at some point - we should
>> probably have a routine somewhere in net that would try to get the MAC
>> address from all possible sources (nvmem, of etc.). This is somewhat
>> related to the work I want to do on nvmem to make the at24 setup()
>> callback more generic.
>>
>> Unfortunately we don't have it yet and I will not have time to work on
>> it before v4.20 so if there are no serious objections, I'd like to get
>> this series merged for v4.19 and then we can refactor the MAC reading
>> later.
>>
>> How does it sound?
>
> I don't think the series introduces any regressions. We need to have MTD
> and SPI flash built into the kernel even today to get mac address on
> DA850 EVM. So from that perspective, I don't have objections (I need to
> actually test still).
>
> OTOH, it will be nice to do the conversion once and not piecemeal. That
> way there is less churn and scope for regressions.
>
> So from a mach-davinci perspective, I don't have a very strong position
> either way.
>
> Thanks,
> Sekhar

We're getting close to rc5 so I'd like to make a case for this series again.

I understand that there's more to do than just the changes introduced
here, but we shouldn't try to fix several problems in many different
places at once. There's just too many moving pieces. I'd rather start
merging small improvements right away.

The idea behind this series is to remove (almost) all users of
at24_platform_data. The davinci_emac patches are there only because we
need to remove some MAC adress reading stuff from the board files.
Having this code there and calling it back from EEPROM/MTD drivers is
already wrong and we should work towards using nvmem for that anyway.

Currently for MTD the nvmem support series seems to be dead and it's
going to take some time before anything gets upstream.

So I'd like to again ask you to consider picking up the patches from
this series to your respective trees or at the very least: I'd like to
ask Srinivas to pick up the nvmem patches and Sekhar to take the
first, non-controversial batch of davinci platform changes so that
we'll have less code to carry for the next release.

Best regards,
Bartosz Golaszewski

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

* Re: [PATCH v4 08/18] net: davinci_emac: potentially get the MAC address from MTD
  2018-07-13 18:00             ` Bartosz Golaszewski
  (?)
@ 2018-07-16  8:50               ` Sekhar Nori
  -1 siblings, 0 replies; 98+ messages in thread
From: Sekhar Nori @ 2018-07-16  8:50 UTC (permalink / raw)
  To: Bartosz Golaszewski
  Cc: Ladislav Michl, Florian Fainelli, Kevin Hilman, Russell King,
	Grygorii Strashko, David S . Miller, Srinivas Kandagatla,
	Lukas Wunner, Rob Herring, Dan Carpenter, Ivan Khoronzhuk,
	David Lechner, Greg Kroah-Hartman, Andrew Lunn, Jonathan Corbet,
	Linux ARM, Linux Kernel Mailing List, linux-omap, netdev,
	Bartosz Golaszewski

On Friday 13 July 2018 11:30 PM, Bartosz Golaszewski wrote:

> We're getting close to rc5 so I'd like to make a case for this series again.
> 
> I understand that there's more to do than just the changes introduced
> here, but we shouldn't try to fix several problems in many different
> places at once. There's just too many moving pieces. I'd rather start
> merging small improvements right away.
> 
> The idea behind this series is to remove (almost) all users of
> at24_platform_data. The davinci_emac patches are there only because we
> need to remove some MAC adress reading stuff from the board files.
> Having this code there and calling it back from EEPROM/MTD drivers is
> already wrong and we should work towards using nvmem for that anyway.
> 
> Currently for MTD the nvmem support series seems to be dead and it's
> going to take some time before anything gets upstream.
> 
> So I'd like to again ask you to consider picking up the patches from
> this series to your respective trees or at the very least: I'd like to
> ask Srinivas to pick up the nvmem patches and Sekhar to take the
> first, non-controversial batch of davinci platform changes so that
> we'll have less code to carry for the next release.

I think those are patches 3-7. I can take those if I get an immutable
commit over v4.18-rc1 from Srinivas with patches 1 & 2 applied.

Thanks,
Sekhar

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

* Re: [PATCH v4 08/18] net: davinci_emac: potentially get the MAC address from MTD
@ 2018-07-16  8:50               ` Sekhar Nori
  0 siblings, 0 replies; 98+ messages in thread
From: Sekhar Nori @ 2018-07-16  8:50 UTC (permalink / raw)
  To: Bartosz Golaszewski
  Cc: Linux ARM, Rob Herring, Florian Fainelli, David Lechner,
	Ivan Khoronzhuk, Kevin Hilman, Greg Kroah-Hartman,
	Jonathan Corbet, Russell King, Linux Kernel Mailing List,
	Andrew Lunn, Bartosz Golaszewski, Grygorii Strashko,
	Srinivas Kandagatla, Ladislav Michl, netdev, Lukas Wunner,
	linux-omap, David S . Miller, Dan Carpenter

On Friday 13 July 2018 11:30 PM, Bartosz Golaszewski wrote:

> We're getting close to rc5 so I'd like to make a case for this series again.
> 
> I understand that there's more to do than just the changes introduced
> here, but we shouldn't try to fix several problems in many different
> places at once. There's just too many moving pieces. I'd rather start
> merging small improvements right away.
> 
> The idea behind this series is to remove (almost) all users of
> at24_platform_data. The davinci_emac patches are there only because we
> need to remove some MAC adress reading stuff from the board files.
> Having this code there and calling it back from EEPROM/MTD drivers is
> already wrong and we should work towards using nvmem for that anyway.
> 
> Currently for MTD the nvmem support series seems to be dead and it's
> going to take some time before anything gets upstream.
> 
> So I'd like to again ask you to consider picking up the patches from
> this series to your respective trees or at the very least: I'd like to
> ask Srinivas to pick up the nvmem patches and Sekhar to take the
> first, non-controversial batch of davinci platform changes so that
> we'll have less code to carry for the next release.

I think those are patches 3-7. I can take those if I get an immutable
commit over v4.18-rc1 from Srinivas with patches 1 & 2 applied.

Thanks,
Sekhar

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

* [PATCH v4 08/18] net: davinci_emac: potentially get the MAC address from MTD
@ 2018-07-16  8:50               ` Sekhar Nori
  0 siblings, 0 replies; 98+ messages in thread
From: Sekhar Nori @ 2018-07-16  8:50 UTC (permalink / raw)
  To: linux-arm-kernel

On Friday 13 July 2018 11:30 PM, Bartosz Golaszewski wrote:

> We're getting close to rc5 so I'd like to make a case for this series again.
> 
> I understand that there's more to do than just the changes introduced
> here, but we shouldn't try to fix several problems in many different
> places at once. There's just too many moving pieces. I'd rather start
> merging small improvements right away.
> 
> The idea behind this series is to remove (almost) all users of
> at24_platform_data. The davinci_emac patches are there only because we
> need to remove some MAC adress reading stuff from the board files.
> Having this code there and calling it back from EEPROM/MTD drivers is
> already wrong and we should work towards using nvmem for that anyway.
> 
> Currently for MTD the nvmem support series seems to be dead and it's
> going to take some time before anything gets upstream.
> 
> So I'd like to again ask you to consider picking up the patches from
> this series to your respective trees or at the very least: I'd like to
> ask Srinivas to pick up the nvmem patches and Sekhar to take the
> first, non-controversial batch of davinci platform changes so that
> we'll have less code to carry for the next release.

I think those are patches 3-7. I can take those if I get an immutable
commit over v4.18-rc1 from Srinivas with patches 1 & 2 applied.

Thanks,
Sekhar

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

* Re: [PATCH v4 08/18] net: davinci_emac: potentially get the MAC address from MTD
  2018-07-16  8:50               ` Sekhar Nori
@ 2018-07-16  8:56                 ` Srinivas Kandagatla
  -1 siblings, 0 replies; 98+ messages in thread
From: Srinivas Kandagatla @ 2018-07-16  8:56 UTC (permalink / raw)
  To: Sekhar Nori, Bartosz Golaszewski
  Cc: Ladislav Michl, Florian Fainelli, Kevin Hilman, Russell King,
	Grygorii Strashko, David S . Miller, Lukas Wunner, Rob Herring,
	Dan Carpenter, Ivan Khoronzhuk, David Lechner,
	Greg Kroah-Hartman, Andrew Lunn, Jonathan Corbet, Linux ARM,
	Linux Kernel Mailing List, linux-omap, netdev,
	Bartosz Golaszewski



On 16/07/18 09:50, Sekhar Nori wrote:
> On Friday 13 July 2018 11:30 PM, Bartosz Golaszewski wrote:
> 
>> We're getting close to rc5 so I'd like to make a case for this series again.
>>
>> I understand that there's more to do than just the changes introduced
>> here, but we shouldn't try to fix several problems in many different
>> places at once. There's just too many moving pieces. I'd rather start
>> merging small improvements right away.
>>
>> The idea behind this series is to remove (almost) all users of
>> at24_platform_data. The davinci_emac patches are there only because we
>> need to remove some MAC adress reading stuff from the board files.
>> Having this code there and calling it back from EEPROM/MTD drivers is
>> already wrong and we should work towards using nvmem for that anyway.
>>
>> Currently for MTD the nvmem support series seems to be dead and it's
>> going to take some time before anything gets upstream.
>>
>> So I'd like to again ask you to consider picking up the patches from
>> this series to your respective trees or at the very least: I'd like to
>> ask Srinivas to pick up the nvmem patches and Sekhar to take the
>> first, non-controversial batch of davinci platform changes so that
>> we'll have less code to carry for the next release.
> 
> I think those are patches 3-7. I can take those if I get an immutable
> commit over v4.18-rc1 from Srinivas with patches 1 & 2 applied.
nvmem patches go via Greg KH char-misc tree, if it makes things easy I 
can provide Ack on nvmem patches, so that you can take these patches via 
your tree?

Let me know.

--srini
> 
> Thanks,
> Sekhar
> 

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

* [PATCH v4 08/18] net: davinci_emac: potentially get the MAC address from MTD
@ 2018-07-16  8:56                 ` Srinivas Kandagatla
  0 siblings, 0 replies; 98+ messages in thread
From: Srinivas Kandagatla @ 2018-07-16  8:56 UTC (permalink / raw)
  To: linux-arm-kernel



On 16/07/18 09:50, Sekhar Nori wrote:
> On Friday 13 July 2018 11:30 PM, Bartosz Golaszewski wrote:
> 
>> We're getting close to rc5 so I'd like to make a case for this series again.
>>
>> I understand that there's more to do than just the changes introduced
>> here, but we shouldn't try to fix several problems in many different
>> places at once. There's just too many moving pieces. I'd rather start
>> merging small improvements right away.
>>
>> The idea behind this series is to remove (almost) all users of
>> at24_platform_data. The davinci_emac patches are there only because we
>> need to remove some MAC adress reading stuff from the board files.
>> Having this code there and calling it back from EEPROM/MTD drivers is
>> already wrong and we should work towards using nvmem for that anyway.
>>
>> Currently for MTD the nvmem support series seems to be dead and it's
>> going to take some time before anything gets upstream.
>>
>> So I'd like to again ask you to consider picking up the patches from
>> this series to your respective trees or at the very least: I'd like to
>> ask Srinivas to pick up the nvmem patches and Sekhar to take the
>> first, non-controversial batch of davinci platform changes so that
>> we'll have less code to carry for the next release.
> 
> I think those are patches 3-7. I can take those if I get an immutable
> commit over v4.18-rc1 from Srinivas with patches 1 & 2 applied.
nvmem patches go via Greg KH char-misc tree, if it makes things easy I 
can provide Ack on nvmem patches, so that you can take these patches via 
your tree?

Let me know.

--srini
> 
> Thanks,
> Sekhar
> 

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

* Re: [PATCH v4 08/18] net: davinci_emac: potentially get the MAC address from MTD
  2018-07-16  8:56                 ` Srinivas Kandagatla
  (?)
@ 2018-07-16 11:57                   ` Sekhar Nori
  -1 siblings, 0 replies; 98+ messages in thread
From: Sekhar Nori @ 2018-07-16 11:57 UTC (permalink / raw)
  To: Srinivas Kandagatla, Bartosz Golaszewski, Greg Kroah-Hartman
  Cc: Ladislav Michl, Florian Fainelli, Kevin Hilman, Russell King,
	Grygorii Strashko, David S . Miller, Lukas Wunner, Rob Herring,
	Dan Carpenter, Ivan Khoronzhuk, David Lechner, Andrew Lunn,
	Jonathan Corbet, Linux ARM, Linux Kernel Mailing List,
	linux-omap, netdev, Bartosz Golaszewski

On Monday 16 July 2018 02:26 PM, Srinivas Kandagatla wrote:
> 
> 
> On 16/07/18 09:50, Sekhar Nori wrote:
>> On Friday 13 July 2018 11:30 PM, Bartosz Golaszewski wrote:
>>
>>> We're getting close to rc5 so I'd like to make a case for this series
>>> again.
>>>
>>> I understand that there's more to do than just the changes introduced
>>> here, but we shouldn't try to fix several problems in many different
>>> places at once. There's just too many moving pieces. I'd rather start
>>> merging small improvements right away.
>>>
>>> The idea behind this series is to remove (almost) all users of
>>> at24_platform_data. The davinci_emac patches are there only because we
>>> need to remove some MAC adress reading stuff from the board files.
>>> Having this code there and calling it back from EEPROM/MTD drivers is
>>> already wrong and we should work towards using nvmem for that anyway.
>>>
>>> Currently for MTD the nvmem support series seems to be dead and it's
>>> going to take some time before anything gets upstream.
>>>
>>> So I'd like to again ask you to consider picking up the patches from
>>> this series to your respective trees or at the very least: I'd like to
>>> ask Srinivas to pick up the nvmem patches and Sekhar to take the
>>> first, non-controversial batch of davinci platform changes so that
>>> we'll have less code to carry for the next release.
>>
>> I think those are patches 3-7. I can take those if I get an immutable
>> commit over v4.18-rc1 from Srinivas with patches 1 & 2 applied.

> nvmem patches go via Greg KH char-misc tree, if it makes things easy I
> can provide Ack on nvmem patches, so that you can take these patches via
> your tree?
> 
> Let me know.

I can do that.

Greg, are you fine with this? It will be great to have your ack for
patches 1/8 and 2/18.

Thanks,
Sekhar

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

* Re: [PATCH v4 08/18] net: davinci_emac: potentially get the MAC address from MTD
@ 2018-07-16 11:57                   ` Sekhar Nori
  0 siblings, 0 replies; 98+ messages in thread
From: Sekhar Nori @ 2018-07-16 11:57 UTC (permalink / raw)
  To: Srinivas Kandagatla, Bartosz Golaszewski, Greg Kroah-Hartman
  Cc: Linux ARM, Rob Herring, Florian Fainelli, David Lechner,
	Ivan Khoronzhuk, Kevin Hilman, netdev, Jonathan Corbet,
	Russell King, Linux Kernel Mailing List, Bartosz Golaszewski,
	Grygorii Strashko, Andrew Lunn, Ladislav Michl, Lukas Wunner,
	linux-omap, David S . Miller, Dan Carpenter

On Monday 16 July 2018 02:26 PM, Srinivas Kandagatla wrote:
> 
> 
> On 16/07/18 09:50, Sekhar Nori wrote:
>> On Friday 13 July 2018 11:30 PM, Bartosz Golaszewski wrote:
>>
>>> We're getting close to rc5 so I'd like to make a case for this series
>>> again.
>>>
>>> I understand that there's more to do than just the changes introduced
>>> here, but we shouldn't try to fix several problems in many different
>>> places at once. There's just too many moving pieces. I'd rather start
>>> merging small improvements right away.
>>>
>>> The idea behind this series is to remove (almost) all users of
>>> at24_platform_data. The davinci_emac patches are there only because we
>>> need to remove some MAC adress reading stuff from the board files.
>>> Having this code there and calling it back from EEPROM/MTD drivers is
>>> already wrong and we should work towards using nvmem for that anyway.
>>>
>>> Currently for MTD the nvmem support series seems to be dead and it's
>>> going to take some time before anything gets upstream.
>>>
>>> So I'd like to again ask you to consider picking up the patches from
>>> this series to your respective trees or at the very least: I'd like to
>>> ask Srinivas to pick up the nvmem patches and Sekhar to take the
>>> first, non-controversial batch of davinci platform changes so that
>>> we'll have less code to carry for the next release.
>>
>> I think those are patches 3-7. I can take those if I get an immutable
>> commit over v4.18-rc1 from Srinivas with patches 1 & 2 applied.

> nvmem patches go via Greg KH char-misc tree, if it makes things easy I
> can provide Ack on nvmem patches, so that you can take these patches via
> your tree?
> 
> Let me know.

I can do that.

Greg, are you fine with this? It will be great to have your ack for
patches 1/8 and 2/18.

Thanks,
Sekhar

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

* [PATCH v4 08/18] net: davinci_emac: potentially get the MAC address from MTD
@ 2018-07-16 11:57                   ` Sekhar Nori
  0 siblings, 0 replies; 98+ messages in thread
From: Sekhar Nori @ 2018-07-16 11:57 UTC (permalink / raw)
  To: linux-arm-kernel

On Monday 16 July 2018 02:26 PM, Srinivas Kandagatla wrote:
> 
> 
> On 16/07/18 09:50, Sekhar Nori wrote:
>> On Friday 13 July 2018 11:30 PM, Bartosz Golaszewski wrote:
>>
>>> We're getting close to rc5 so I'd like to make a case for this series
>>> again.
>>>
>>> I understand that there's more to do than just the changes introduced
>>> here, but we shouldn't try to fix several problems in many different
>>> places at once. There's just too many moving pieces. I'd rather start
>>> merging small improvements right away.
>>>
>>> The idea behind this series is to remove (almost) all users of
>>> at24_platform_data. The davinci_emac patches are there only because we
>>> need to remove some MAC adress reading stuff from the board files.
>>> Having this code there and calling it back from EEPROM/MTD drivers is
>>> already wrong and we should work towards using nvmem for that anyway.
>>>
>>> Currently for MTD the nvmem support series seems to be dead and it's
>>> going to take some time before anything gets upstream.
>>>
>>> So I'd like to again ask you to consider picking up the patches from
>>> this series to your respective trees or at the very least: I'd like to
>>> ask Srinivas to pick up the nvmem patches and Sekhar to take the
>>> first, non-controversial batch of davinci platform changes so that
>>> we'll have less code to carry for the next release.
>>
>> I think those are patches 3-7. I can take those if I get an immutable
>> commit over v4.18-rc1 from Srinivas with patches 1 & 2 applied.

> nvmem patches go via Greg KH char-misc tree, if it makes things easy I
> can provide Ack on nvmem patches, so that you can take these patches via
> your tree?
> 
> Let me know.

I can do that.

Greg, are you fine with this? It will be great to have your ack for
patches 1/8 and 2/18.

Thanks,
Sekhar

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

* Re: [PATCH v4 08/18] net: davinci_emac: potentially get the MAC address from MTD
  2018-07-16 11:57                   ` Sekhar Nori
  (?)
  (?)
@ 2018-07-16 12:10                     ` Greg Kroah-Hartman
  -1 siblings, 0 replies; 98+ messages in thread
From: Greg Kroah-Hartman @ 2018-07-16 12:10 UTC (permalink / raw)
  To: Sekhar Nori
  Cc: Srinivas Kandagatla, Bartosz Golaszewski, Ladislav Michl,
	Florian Fainelli, Kevin Hilman, Russell King, Grygorii Strashko,
	David S . Miller, Lukas Wunner, Rob Herring, Dan Carpenter,
	Ivan Khoronzhuk, David Lechner, Andrew Lunn, Jonathan Corbet,
	Linux ARM, Linux Kernel Mailing List, linux-omap, netdev,
	Bartosz Golaszewski

On Mon, Jul 16, 2018 at 05:27:00PM +0530, Sekhar Nori wrote:
> On Monday 16 July 2018 02:26 PM, Srinivas Kandagatla wrote:
> > 
> > 
> > On 16/07/18 09:50, Sekhar Nori wrote:
> >> On Friday 13 July 2018 11:30 PM, Bartosz Golaszewski wrote:
> >>
> >>> We're getting close to rc5 so I'd like to make a case for this series
> >>> again.
> >>>
> >>> I understand that there's more to do than just the changes introduced
> >>> here, but we shouldn't try to fix several problems in many different
> >>> places at once. There's just too many moving pieces. I'd rather start
> >>> merging small improvements right away.
> >>>
> >>> The idea behind this series is to remove (almost) all users of
> >>> at24_platform_data. The davinci_emac patches are there only because we
> >>> need to remove some MAC adress reading stuff from the board files.
> >>> Having this code there and calling it back from EEPROM/MTD drivers is
> >>> already wrong and we should work towards using nvmem for that anyway.
> >>>
> >>> Currently for MTD the nvmem support series seems to be dead and it's
> >>> going to take some time before anything gets upstream.
> >>>
> >>> So I'd like to again ask you to consider picking up the patches from
> >>> this series to your respective trees or at the very least: I'd like to
> >>> ask Srinivas to pick up the nvmem patches and Sekhar to take the
> >>> first, non-controversial batch of davinci platform changes so that
> >>> we'll have less code to carry for the next release.
> >>
> >> I think those are patches 3-7. I can take those if I get an immutable
> >> commit over v4.18-rc1 from Srinivas with patches 1 & 2 applied.
> 
> > nvmem patches go via Greg KH char-misc tree, if it makes things easy I
> > can provide Ack on nvmem patches, so that you can take these patches via
> > your tree?
> > 
> > Let me know.
> 
> I can do that.
> 
> Greg, are you fine with this? It will be great to have your ack for
> patches 1/8 and 2/18.

I'm not the nvmem maintainer :)


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

* Re: [PATCH v4 08/18] net: davinci_emac: potentially get the MAC address from MTD
@ 2018-07-16 12:10                     ` Greg Kroah-Hartman
  0 siblings, 0 replies; 98+ messages in thread
From: Greg Kroah-Hartman @ 2018-07-16 12:10 UTC (permalink / raw)
  To: Sekhar Nori
  Cc: Srinivas Kandagatla, Bartosz Golaszewski, Ladislav Michl,
	Florian Fainelli, Kevin Hilman, Russell King, Grygorii Strashko,
	David S . Miller, Lukas Wunner, Rob Herring, Dan Carpenter,
	Ivan Khoronzhuk, David Lechner, Andrew Lunn, Jonathan Corbet,
	Linux ARM, Linux Kernel Mailing List, linux-omap, netdev,
	Bartosz Golaszewski

On Mon, Jul 16, 2018 at 05:27:00PM +0530, Sekhar Nori wrote:
> On Monday 16 July 2018 02:26 PM, Srinivas Kandagatla wrote:
> > 
> > 
> > On 16/07/18 09:50, Sekhar Nori wrote:
> >> On Friday 13 July 2018 11:30 PM, Bartosz Golaszewski wrote:
> >>
> >>> We're getting close to rc5 so I'd like to make a case for this series
> >>> again.
> >>>
> >>> I understand that there's more to do than just the changes introduced
> >>> here, but we shouldn't try to fix several problems in many different
> >>> places at once. There's just too many moving pieces. I'd rather start
> >>> merging small improvements right away.
> >>>
> >>> The idea behind this series is to remove (almost) all users of
> >>> at24_platform_data. The davinci_emac patches are there only because we
> >>> need to remove some MAC adress reading stuff from the board files.
> >>> Having this code there and calling it back from EEPROM/MTD drivers is
> >>> already wrong and we should work towards using nvmem for that anyway.
> >>>
> >>> Currently for MTD the nvmem support series seems to be dead and it's
> >>> going to take some time before anything gets upstream.
> >>>
> >>> So I'd like to again ask you to consider picking up the patches from
> >>> this series to your respective trees or at the very least: I'd like to
> >>> ask Srinivas to pick up the nvmem patches and Sekhar to take the
> >>> first, non-controversial batch of davinci platform changes so that
> >>> we'll have less code to carry for the next release.
> >>
> >> I think those are patches 3-7. I can take those if I get an immutable
> >> commit over v4.18-rc1 from Srinivas with patches 1 & 2 applied.
> 
> > nvmem patches go via Greg KH char-misc tree, if it makes things easy I
> > can provide Ack on nvmem patches, so that you can take these patches via
> > your tree?
> > 
> > Let me know.
> 
> I can do that.
> 
> Greg, are you fine with this? It will be great to have your ack for
> patches 1/8 and 2/18.

I'm not the nvmem maintainer :)

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

* Re: [PATCH v4 08/18] net: davinci_emac: potentially get the MAC address from MTD
@ 2018-07-16 12:10                     ` Greg Kroah-Hartman
  0 siblings, 0 replies; 98+ messages in thread
From: Greg Kroah-Hartman @ 2018-07-16 12:10 UTC (permalink / raw)
  To: Sekhar Nori
  Cc: Srinivas Kandagatla, Bartosz Golaszewski, Ladislav Michl,
	Florian Fainelli, Kevin Hilman, Russell King, Grygorii Strashko,
	David S . Miller, Lukas Wunner, Rob Herring, Dan Carpenter,
	Ivan Khoronzhuk, David Lechner, Andrew Lunn, Jonathan Corbet,
	Linux ARM, Linux Kernel Mailing List, linux-omap, netdev

On Mon, Jul 16, 2018 at 05:27:00PM +0530, Sekhar Nori wrote:
> On Monday 16 July 2018 02:26 PM, Srinivas Kandagatla wrote:
> > 
> > 
> > On 16/07/18 09:50, Sekhar Nori wrote:
> >> On Friday 13 July 2018 11:30 PM, Bartosz Golaszewski wrote:
> >>
> >>> We're getting close to rc5 so I'd like to make a case for this series
> >>> again.
> >>>
> >>> I understand that there's more to do than just the changes introduced
> >>> here, but we shouldn't try to fix several problems in many different
> >>> places at once. There's just too many moving pieces. I'd rather start
> >>> merging small improvements right away.
> >>>
> >>> The idea behind this series is to remove (almost) all users of
> >>> at24_platform_data. The davinci_emac patches are there only because we
> >>> need to remove some MAC adress reading stuff from the board files.
> >>> Having this code there and calling it back from EEPROM/MTD drivers is
> >>> already wrong and we should work towards using nvmem for that anyway.
> >>>
> >>> Currently for MTD the nvmem support series seems to be dead and it's
> >>> going to take some time before anything gets upstream.
> >>>
> >>> So I'd like to again ask you to consider picking up the patches from
> >>> this series to your respective trees or at the very least: I'd like to
> >>> ask Srinivas to pick up the nvmem patches and Sekhar to take the
> >>> first, non-controversial batch of davinci platform changes so that
> >>> we'll have less code to carry for the next release.
> >>
> >> I think those are patches 3-7. I can take those if I get an immutable
> >> commit over v4.18-rc1 from Srinivas with patches 1 & 2 applied.
> 
> > nvmem patches go via Greg KH char-misc tree, if it makes things easy I
> > can provide Ack on nvmem patches, so that you can take these patches via
> > your tree?
> > 
> > Let me know.
> 
> I can do that.
> 
> Greg, are you fine with this? It will be great to have your ack for
> patches 1/8 and 2/18.

I'm not the nvmem maintainer :)

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

* [PATCH v4 08/18] net: davinci_emac: potentially get the MAC address from MTD
@ 2018-07-16 12:10                     ` Greg Kroah-Hartman
  0 siblings, 0 replies; 98+ messages in thread
From: Greg Kroah-Hartman @ 2018-07-16 12:10 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Jul 16, 2018 at 05:27:00PM +0530, Sekhar Nori wrote:
> On Monday 16 July 2018 02:26 PM, Srinivas Kandagatla wrote:
> > 
> > 
> > On 16/07/18 09:50, Sekhar Nori wrote:
> >> On Friday 13 July 2018 11:30 PM, Bartosz Golaszewski wrote:
> >>
> >>> We're getting close to rc5 so I'd like to make a case for this series
> >>> again.
> >>>
> >>> I understand that there's more to do than just the changes introduced
> >>> here, but we shouldn't try to fix several problems in many different
> >>> places at once. There's just too many moving pieces. I'd rather start
> >>> merging small improvements right away.
> >>>
> >>> The idea behind this series is to remove (almost) all users of
> >>> at24_platform_data. The davinci_emac patches are there only because we
> >>> need to remove some MAC adress reading stuff from the board files.
> >>> Having this code there and calling it back from EEPROM/MTD drivers is
> >>> already wrong and we should work towards using nvmem for that anyway.
> >>>
> >>> Currently for MTD the nvmem support series seems to be dead and it's
> >>> going to take some time before anything gets upstream.
> >>>
> >>> So I'd like to again ask you to consider picking up the patches from
> >>> this series to your respective trees or at the very least: I'd like to
> >>> ask Srinivas to pick up the nvmem patches and Sekhar to take the
> >>> first, non-controversial batch of davinci platform changes so that
> >>> we'll have less code to carry for the next release.
> >>
> >> I think those are patches 3-7. I can take those if I get an immutable
> >> commit over v4.18-rc1 from Srinivas with patches 1 & 2 applied.
> 
> > nvmem patches go via Greg KH char-misc tree, if it makes things easy I
> > can provide Ack on nvmem patches, so that you can take these patches via
> > your tree?
> > 
> > Let me know.
> 
> I can do that.
> 
> Greg, are you fine with this? It will be great to have your ack for
> patches 1/8 and 2/18.

I'm not the nvmem maintainer :)

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

* Re: [PATCH v4 08/18] net: davinci_emac: potentially get the MAC address from MTD
  2018-07-16 12:10                     ` Greg Kroah-Hartman
  (?)
@ 2018-07-16 12:13                       ` Sekhar Nori
  -1 siblings, 0 replies; 98+ messages in thread
From: Sekhar Nori @ 2018-07-16 12:13 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Srinivas Kandagatla, Bartosz Golaszewski, Ladislav Michl,
	Florian Fainelli, Kevin Hilman, Russell King, Grygorii Strashko,
	David S . Miller, Lukas Wunner, Rob Herring, Dan Carpenter,
	Ivan Khoronzhuk, David Lechner, Andrew Lunn, Jonathan Corbet,
	Linux ARM, Linux Kernel Mailing List, linux-omap, netdev,
	Bartosz Golaszewski

On Monday 16 July 2018 05:40 PM, Greg Kroah-Hartman wrote:
> On Mon, Jul 16, 2018 at 05:27:00PM +0530, Sekhar Nori wrote:
>> On Monday 16 July 2018 02:26 PM, Srinivas Kandagatla wrote:
>>>
>>>
>>> On 16/07/18 09:50, Sekhar Nori wrote:
>>>> On Friday 13 July 2018 11:30 PM, Bartosz Golaszewski wrote:
>>>>
>>>>> We're getting close to rc5 so I'd like to make a case for this series
>>>>> again.
>>>>>
>>>>> I understand that there's more to do than just the changes introduced
>>>>> here, but we shouldn't try to fix several problems in many different
>>>>> places at once. There's just too many moving pieces. I'd rather start
>>>>> merging small improvements right away.
>>>>>
>>>>> The idea behind this series is to remove (almost) all users of
>>>>> at24_platform_data. The davinci_emac patches are there only because we
>>>>> need to remove some MAC adress reading stuff from the board files.
>>>>> Having this code there and calling it back from EEPROM/MTD drivers is
>>>>> already wrong and we should work towards using nvmem for that anyway.
>>>>>
>>>>> Currently for MTD the nvmem support series seems to be dead and it's
>>>>> going to take some time before anything gets upstream.
>>>>>
>>>>> So I'd like to again ask you to consider picking up the patches from
>>>>> this series to your respective trees or at the very least: I'd like to
>>>>> ask Srinivas to pick up the nvmem patches and Sekhar to take the
>>>>> first, non-controversial batch of davinci platform changes so that
>>>>> we'll have less code to carry for the next release.
>>>>
>>>> I think those are patches 3-7. I can take those if I get an immutable
>>>> commit over v4.18-rc1 from Srinivas with patches 1 & 2 applied.
>>
>>> nvmem patches go via Greg KH char-misc tree, if it makes things easy I
>>> can provide Ack on nvmem patches, so that you can take these patches via
>>> your tree?
>>>
>>> Let me know.
>>
>> I can do that.
>>
>> Greg, are you fine with this? It will be great to have your ack for
>> patches 1/8 and 2/18.
> 
> I'm not the nvmem maintainer :)

Got it. Will apply with Srinivas's ack.

Regards,
Sekhar

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

* Re: [PATCH v4 08/18] net: davinci_emac: potentially get the MAC address from MTD
@ 2018-07-16 12:13                       ` Sekhar Nori
  0 siblings, 0 replies; 98+ messages in thread
From: Sekhar Nori @ 2018-07-16 12:13 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Rob Herring, Florian Fainelli, David Lechner, Ivan Khoronzhuk,
	Kevin Hilman, netdev, Bartosz Golaszewski, Jonathan Corbet,
	Russell King, Linux Kernel Mailing List, Andrew Lunn,
	Bartosz Golaszewski, Ladislav Michl, Srinivas Kandagatla,
	Linux ARM, Lukas Wunner, Grygorii Strashko, linux-omap,
	David S . Miller, Dan Carpenter

On Monday 16 July 2018 05:40 PM, Greg Kroah-Hartman wrote:
> On Mon, Jul 16, 2018 at 05:27:00PM +0530, Sekhar Nori wrote:
>> On Monday 16 July 2018 02:26 PM, Srinivas Kandagatla wrote:
>>>
>>>
>>> On 16/07/18 09:50, Sekhar Nori wrote:
>>>> On Friday 13 July 2018 11:30 PM, Bartosz Golaszewski wrote:
>>>>
>>>>> We're getting close to rc5 so I'd like to make a case for this series
>>>>> again.
>>>>>
>>>>> I understand that there's more to do than just the changes introduced
>>>>> here, but we shouldn't try to fix several problems in many different
>>>>> places at once. There's just too many moving pieces. I'd rather start
>>>>> merging small improvements right away.
>>>>>
>>>>> The idea behind this series is to remove (almost) all users of
>>>>> at24_platform_data. The davinci_emac patches are there only because we
>>>>> need to remove some MAC adress reading stuff from the board files.
>>>>> Having this code there and calling it back from EEPROM/MTD drivers is
>>>>> already wrong and we should work towards using nvmem for that anyway.
>>>>>
>>>>> Currently for MTD the nvmem support series seems to be dead and it's
>>>>> going to take some time before anything gets upstream.
>>>>>
>>>>> So I'd like to again ask you to consider picking up the patches from
>>>>> this series to your respective trees or at the very least: I'd like to
>>>>> ask Srinivas to pick up the nvmem patches and Sekhar to take the
>>>>> first, non-controversial batch of davinci platform changes so that
>>>>> we'll have less code to carry for the next release.
>>>>
>>>> I think those are patches 3-7. I can take those if I get an immutable
>>>> commit over v4.18-rc1 from Srinivas with patches 1 & 2 applied.
>>
>>> nvmem patches go via Greg KH char-misc tree, if it makes things easy I
>>> can provide Ack on nvmem patches, so that you can take these patches via
>>> your tree?
>>>
>>> Let me know.
>>
>> I can do that.
>>
>> Greg, are you fine with this? It will be great to have your ack for
>> patches 1/8 and 2/18.
> 
> I'm not the nvmem maintainer :)

Got it. Will apply with Srinivas's ack.

Regards,
Sekhar

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

* [PATCH v4 08/18] net: davinci_emac: potentially get the MAC address from MTD
@ 2018-07-16 12:13                       ` Sekhar Nori
  0 siblings, 0 replies; 98+ messages in thread
From: Sekhar Nori @ 2018-07-16 12:13 UTC (permalink / raw)
  To: linux-arm-kernel

On Monday 16 July 2018 05:40 PM, Greg Kroah-Hartman wrote:
> On Mon, Jul 16, 2018 at 05:27:00PM +0530, Sekhar Nori wrote:
>> On Monday 16 July 2018 02:26 PM, Srinivas Kandagatla wrote:
>>>
>>>
>>> On 16/07/18 09:50, Sekhar Nori wrote:
>>>> On Friday 13 July 2018 11:30 PM, Bartosz Golaszewski wrote:
>>>>
>>>>> We're getting close to rc5 so I'd like to make a case for this series
>>>>> again.
>>>>>
>>>>> I understand that there's more to do than just the changes introduced
>>>>> here, but we shouldn't try to fix several problems in many different
>>>>> places at once. There's just too many moving pieces. I'd rather start
>>>>> merging small improvements right away.
>>>>>
>>>>> The idea behind this series is to remove (almost) all users of
>>>>> at24_platform_data. The davinci_emac patches are there only because we
>>>>> need to remove some MAC adress reading stuff from the board files.
>>>>> Having this code there and calling it back from EEPROM/MTD drivers is
>>>>> already wrong and we should work towards using nvmem for that anyway.
>>>>>
>>>>> Currently for MTD the nvmem support series seems to be dead and it's
>>>>> going to take some time before anything gets upstream.
>>>>>
>>>>> So I'd like to again ask you to consider picking up the patches from
>>>>> this series to your respective trees or at the very least: I'd like to
>>>>> ask Srinivas to pick up the nvmem patches and Sekhar to take the
>>>>> first, non-controversial batch of davinci platform changes so that
>>>>> we'll have less code to carry for the next release.
>>>>
>>>> I think those are patches 3-7. I can take those if I get an immutable
>>>> commit over v4.18-rc1 from Srinivas with patches 1 & 2 applied.
>>
>>> nvmem patches go via Greg KH char-misc tree, if it makes things easy I
>>> can provide Ack on nvmem patches, so that you can take these patches via
>>> your tree?
>>>
>>> Let me know.
>>
>> I can do that.
>>
>> Greg, are you fine with this? It will be great to have your ack for
>> patches 1/8 and 2/18.
> 
> I'm not the nvmem maintainer :)

Got it. Will apply with Srinivas's ack.

Regards,
Sekhar

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

* Re: [PATCH v4 02/18] Documentation: nvmem: document lookup entries
  2018-06-29  9:40   ` Bartosz Golaszewski
  (?)
@ 2018-07-16 12:14     ` Sekhar Nori
  -1 siblings, 0 replies; 98+ messages in thread
From: Sekhar Nori @ 2018-07-16 12:14 UTC (permalink / raw)
  To: Bartosz Golaszewski, Kevin Hilman, Russell King,
	Grygorii Strashko, David S . Miller, Srinivas Kandagatla,
	Lukas Wunner, Rob Herring, Florian Fainelli, Dan Carpenter,
	Ivan Khoronzhuk, David Lechner, Greg Kroah-Hartman, Andrew Lunn,
	Jonathan Corbet
  Cc: linux-arm-kernel, linux-kernel, linux-omap, netdev, Bartosz Golaszewski

On Friday 29 June 2018 03:10 PM, Bartosz Golaszewski wrote:
> From: Bartosz Golaszewski <bgolaszewski@baylibre.com>
> 
> Describe the usage of nvmem cell lookup tables.
> 
> Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
> ---
>  Documentation/nvmem/nvmem.txt | 28 ++++++++++++++++++++++++++++
>  1 file changed, 28 insertions(+)
> 
> diff --git a/Documentation/nvmem/nvmem.txt b/Documentation/nvmem/nvmem.txt
> index 8d8d8f58f96f..9d5e3ca2b4f3 100644
> --- a/Documentation/nvmem/nvmem.txt
> +++ b/Documentation/nvmem/nvmem.txt
> @@ -58,6 +58,34 @@ static int qfprom_probe(struct platform_device *pdev)
>  It is mandatory that the NVMEM provider has a regmap associated with its
>  struct device. Failure to do would return error code from nvmem_register().
>  
> +Additionally it is possible to create nvmem cell lookup entries and register
> +them with the nvmem framework from machine code as shown in the example below:
> +
> +static struct nvmem_cell_lookup foobar_lookup = {
> +	.info = {
> +		.name = "mac-address",
> +		.offset = 0xd000,
> +		.bytes = ERH_ALEN,

ETH_ALEN. Will fix while applying.

Regards,
Sekhar

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

* Re: [PATCH v4 02/18] Documentation: nvmem: document lookup entries
@ 2018-07-16 12:14     ` Sekhar Nori
  0 siblings, 0 replies; 98+ messages in thread
From: Sekhar Nori @ 2018-07-16 12:14 UTC (permalink / raw)
  To: Bartosz Golaszewski, Kevin Hilman, Russell King,
	Grygorii Strashko, David S . Miller, Srinivas Kandagatla,
	Lukas Wunner, Rob Herring, Florian Fainelli, Dan Carpenter,
	Ivan Khoronzhuk, David Lechner, Greg Kroah-Hartman, Andrew Lunn,
	Jonathan Corbet
  Cc: netdev, linux-omap, linux-kernel, linux-arm-kernel, Bartosz Golaszewski

On Friday 29 June 2018 03:10 PM, Bartosz Golaszewski wrote:
> From: Bartosz Golaszewski <bgolaszewski@baylibre.com>
> 
> Describe the usage of nvmem cell lookup tables.
> 
> Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
> ---
>  Documentation/nvmem/nvmem.txt | 28 ++++++++++++++++++++++++++++
>  1 file changed, 28 insertions(+)
> 
> diff --git a/Documentation/nvmem/nvmem.txt b/Documentation/nvmem/nvmem.txt
> index 8d8d8f58f96f..9d5e3ca2b4f3 100644
> --- a/Documentation/nvmem/nvmem.txt
> +++ b/Documentation/nvmem/nvmem.txt
> @@ -58,6 +58,34 @@ static int qfprom_probe(struct platform_device *pdev)
>  It is mandatory that the NVMEM provider has a regmap associated with its
>  struct device. Failure to do would return error code from nvmem_register().
>  
> +Additionally it is possible to create nvmem cell lookup entries and register
> +them with the nvmem framework from machine code as shown in the example below:
> +
> +static struct nvmem_cell_lookup foobar_lookup = {
> +	.info = {
> +		.name = "mac-address",
> +		.offset = 0xd000,
> +		.bytes = ERH_ALEN,

ETH_ALEN. Will fix while applying.

Regards,
Sekhar

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

* [PATCH v4 02/18] Documentation: nvmem: document lookup entries
@ 2018-07-16 12:14     ` Sekhar Nori
  0 siblings, 0 replies; 98+ messages in thread
From: Sekhar Nori @ 2018-07-16 12:14 UTC (permalink / raw)
  To: linux-arm-kernel

On Friday 29 June 2018 03:10 PM, Bartosz Golaszewski wrote:
> From: Bartosz Golaszewski <bgolaszewski@baylibre.com>
> 
> Describe the usage of nvmem cell lookup tables.
> 
> Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
> ---
>  Documentation/nvmem/nvmem.txt | 28 ++++++++++++++++++++++++++++
>  1 file changed, 28 insertions(+)
> 
> diff --git a/Documentation/nvmem/nvmem.txt b/Documentation/nvmem/nvmem.txt
> index 8d8d8f58f96f..9d5e3ca2b4f3 100644
> --- a/Documentation/nvmem/nvmem.txt
> +++ b/Documentation/nvmem/nvmem.txt
> @@ -58,6 +58,34 @@ static int qfprom_probe(struct platform_device *pdev)
>  It is mandatory that the NVMEM provider has a regmap associated with its
>  struct device. Failure to do would return error code from nvmem_register().
>  
> +Additionally it is possible to create nvmem cell lookup entries and register
> +them with the nvmem framework from machine code as shown in the example below:
> +
> +static struct nvmem_cell_lookup foobar_lookup = {
> +	.info = {
> +		.name = "mac-address",
> +		.offset = 0xd000,
> +		.bytes = ERH_ALEN,

ETH_ALEN. Will fix while applying.

Regards,
Sekhar

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

* Re: [PATCH v4 02/18] Documentation: nvmem: document lookup entries
  2018-06-29  9:40   ` Bartosz Golaszewski
@ 2018-07-16 12:18     ` Srinivas Kandagatla
  -1 siblings, 0 replies; 98+ messages in thread
From: Srinivas Kandagatla @ 2018-07-16 12:18 UTC (permalink / raw)
  To: Bartosz Golaszewski, Sekhar Nori, Kevin Hilman, Russell King,
	Grygorii Strashko, David S . Miller, Lukas Wunner, Rob Herring,
	Florian Fainelli, Dan Carpenter, Ivan Khoronzhuk, David Lechner,
	Greg Kroah-Hartman, Andrew Lunn, Jonathan Corbet
  Cc: linux-arm-kernel, linux-kernel, linux-omap, netdev, Bartosz Golaszewski



On 29/06/18 10:40, Bartosz Golaszewski wrote:
> From: Bartosz Golaszewski <bgolaszewski@baylibre.com>
> 
> Describe the usage of nvmem cell lookup tables.
> 
> Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>

Acked-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>

> ---
>   Documentation/nvmem/nvmem.txt | 28 ++++++++++++++++++++++++++++
>   1 file changed, 28 insertions(+)
> 
> diff --git a/Documentation/nvmem/nvmem.txt b/Documentation/nvmem/nvmem.txt
> index 8d8d8f58f96f..9d5e3ca2b4f3 100644
> --- a/Documentation/nvmem/nvmem.txt
> +++ b/Documentation/nvmem/nvmem.txt
> @@ -58,6 +58,34 @@ static int qfprom_probe(struct platform_device *pdev)
>   It is mandatory that the NVMEM provider has a regmap associated with its
>   struct device. Failure to do would return error code from nvmem_register().
>   
> +Additionally it is possible to create nvmem cell lookup entries and register
> +them with the nvmem framework from machine code as shown in the example below:
> +
> +static struct nvmem_cell_lookup foobar_lookup = {
> +	.info = {
> +		.name = "mac-address",
> +		.offset = 0xd000,
> +		.bytes = ERH_ALEN,
> +	},
> +	.nvmem_name = "foobar",
> +};
> +
> +static void foobar_register(void)
> +{
> +	...
> +	nvmem_add_lookup_table(&foobar_lookup, 1);
> +	...
> +}
> +
> +A lookup entry table can be later removed if needed:
> +
> +static void foobar_fini(void)
> +{
> +	...
> +	nvmem_del_lookup_table(&foobar_lookup, 1);
> +	...
> +}
> +
>   NVMEM Consumers
>   +++++++++++++++
>   
> 

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

* [PATCH v4 02/18] Documentation: nvmem: document lookup entries
@ 2018-07-16 12:18     ` Srinivas Kandagatla
  0 siblings, 0 replies; 98+ messages in thread
From: Srinivas Kandagatla @ 2018-07-16 12:18 UTC (permalink / raw)
  To: linux-arm-kernel



On 29/06/18 10:40, Bartosz Golaszewski wrote:
> From: Bartosz Golaszewski <bgolaszewski@baylibre.com>
> 
> Describe the usage of nvmem cell lookup tables.
> 
> Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>

Acked-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>

> ---
>   Documentation/nvmem/nvmem.txt | 28 ++++++++++++++++++++++++++++
>   1 file changed, 28 insertions(+)
> 
> diff --git a/Documentation/nvmem/nvmem.txt b/Documentation/nvmem/nvmem.txt
> index 8d8d8f58f96f..9d5e3ca2b4f3 100644
> --- a/Documentation/nvmem/nvmem.txt
> +++ b/Documentation/nvmem/nvmem.txt
> @@ -58,6 +58,34 @@ static int qfprom_probe(struct platform_device *pdev)
>   It is mandatory that the NVMEM provider has a regmap associated with its
>   struct device. Failure to do would return error code from nvmem_register().
>   
> +Additionally it is possible to create nvmem cell lookup entries and register
> +them with the nvmem framework from machine code as shown in the example below:
> +
> +static struct nvmem_cell_lookup foobar_lookup = {
> +	.info = {
> +		.name = "mac-address",
> +		.offset = 0xd000,
> +		.bytes = ERH_ALEN,
> +	},
> +	.nvmem_name = "foobar",
> +};
> +
> +static void foobar_register(void)
> +{
> +	...
> +	nvmem_add_lookup_table(&foobar_lookup, 1);
> +	...
> +}
> +
> +A lookup entry table can be later removed if needed:
> +
> +static void foobar_fini(void)
> +{
> +	...
> +	nvmem_del_lookup_table(&foobar_lookup, 1);
> +	...
> +}
> +
>   NVMEM Consumers
>   +++++++++++++++
>   
> 

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

* Re: [PATCH v4 01/18] nvmem: add support for cell lookups
  2018-06-29  9:40   ` Bartosz Golaszewski
@ 2018-07-16 12:19     ` Srinivas Kandagatla
  -1 siblings, 0 replies; 98+ messages in thread
From: Srinivas Kandagatla @ 2018-07-16 12:19 UTC (permalink / raw)
  To: Bartosz Golaszewski, Sekhar Nori, Kevin Hilman, Russell King,
	Grygorii Strashko, David S . Miller, Lukas Wunner, Rob Herring,
	Florian Fainelli, Dan Carpenter, Ivan Khoronzhuk, David Lechner,
	Greg Kroah-Hartman, Andrew Lunn, Jonathan Corbet
  Cc: linux-arm-kernel, linux-kernel, linux-omap, netdev, Bartosz Golaszewski



On 29/06/18 10:40, Bartosz Golaszewski wrote:
> From: Bartosz Golaszewski <bgolaszewski@baylibre.com>
> 
> We can currently only register nvmem cells from device tree or by
> manually calling nvmem_add_cells(). The latter options however forces
> users to make sure that the nvmem provider with which the cells are
> associated is registered before the call.
> 
> This patch proposes a new solution inspired by other frameworks that
> offer resource lookups (GPIO, PWM etc.). It adds functions that allow
> machine code to register nvmem lookup which are later lazily used to
> add corresponding nvmem cells and remove them if no longer needed.
> 
> Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>

Acked-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>

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

* [PATCH v4 01/18] nvmem: add support for cell lookups
@ 2018-07-16 12:19     ` Srinivas Kandagatla
  0 siblings, 0 replies; 98+ messages in thread
From: Srinivas Kandagatla @ 2018-07-16 12:19 UTC (permalink / raw)
  To: linux-arm-kernel



On 29/06/18 10:40, Bartosz Golaszewski wrote:
> From: Bartosz Golaszewski <bgolaszewski@baylibre.com>
> 
> We can currently only register nvmem cells from device tree or by
> manually calling nvmem_add_cells(). The latter options however forces
> users to make sure that the nvmem provider with which the cells are
> associated is registered before the call.
> 
> This patch proposes a new solution inspired by other frameworks that
> offer resource lookups (GPIO, PWM etc.). It adds functions that allow
> machine code to register nvmem lookup which are later lazily used to
> add corresponding nvmem cells and remove them if no longer needed.
> 
> Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>

Acked-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>

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

* Re: [PATCH v4 01/18] nvmem: add support for cell lookups
  2018-06-29  9:40   ` Bartosz Golaszewski
@ 2018-07-16 12:20     ` Srinivas Kandagatla
  -1 siblings, 0 replies; 98+ messages in thread
From: Srinivas Kandagatla @ 2018-07-16 12:20 UTC (permalink / raw)
  To: Bartosz Golaszewski, Sekhar Nori, Kevin Hilman, Russell King,
	Grygorii Strashko, David S . Miller, Lukas Wunner, Rob Herring,
	Florian Fainelli, Dan Carpenter, Ivan Khoronzhuk, David Lechner,
	Greg Kroah-Hartman, Andrew Lunn, Jonathan Corbet
  Cc: linux-arm-kernel, linux-kernel, linux-omap, netdev, Bartosz Golaszewski



On 29/06/18 10:40, Bartosz Golaszewski wrote:
> From: Bartosz Golaszewski<bgolaszewski@baylibre.com>
> 
> We can currently only register nvmem cells from device tree or by
> manually calling nvmem_add_cells(). The latter options however forces
> users to make sure that the nvmem provider with which the cells are
> associated is registered before the call.
> 
> This patch proposes a new solution inspired by other frameworks that
> offer resource lookups (GPIO, PWM etc.). It adds functions that allow
> machine code to register nvmem lookup which are later lazily used to
> add corresponding nvmem cells and remove them if no longer needed.
> 
> Signed-off-by: Bartosz Golaszewski<bgolaszewski@baylibre.com>

Acked-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>

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

* [PATCH v4 01/18] nvmem: add support for cell lookups
@ 2018-07-16 12:20     ` Srinivas Kandagatla
  0 siblings, 0 replies; 98+ messages in thread
From: Srinivas Kandagatla @ 2018-07-16 12:20 UTC (permalink / raw)
  To: linux-arm-kernel



On 29/06/18 10:40, Bartosz Golaszewski wrote:
> From: Bartosz Golaszewski<bgolaszewski@baylibre.com>
> 
> We can currently only register nvmem cells from device tree or by
> manually calling nvmem_add_cells(). The latter options however forces
> users to make sure that the nvmem provider with which the cells are
> associated is registered before the call.
> 
> This patch proposes a new solution inspired by other frameworks that
> offer resource lookups (GPIO, PWM etc.). It adds functions that allow
> machine code to register nvmem lookup which are later lazily used to
> add corresponding nvmem cells and remove them if no longer needed.
> 
> Signed-off-by: Bartosz Golaszewski<bgolaszewski@baylibre.com>

Acked-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>

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

* Re: [PATCH v4 08/18] net: davinci_emac: potentially get the MAC address from MTD
  2018-07-16  8:56                 ` Srinivas Kandagatla
  (?)
@ 2018-07-20  5:04                   ` Sekhar Nori
  -1 siblings, 0 replies; 98+ messages in thread
From: Sekhar Nori @ 2018-07-20  5:04 UTC (permalink / raw)
  To: Srinivas Kandagatla, Bartosz Golaszewski, Andrew Lunn
  Cc: Ladislav Michl, Florian Fainelli, Kevin Hilman, Russell King,
	Grygorii Strashko, David S . Miller, Lukas Wunner, Rob Herring,
	Dan Carpenter, Ivan Khoronzhuk, David Lechner,
	Greg Kroah-Hartman, Jonathan Corbet, Linux ARM,
	Linux Kernel Mailing List, linux-omap, netdev,
	Bartosz Golaszewski

On Monday 16 July 2018 02:26 PM, Srinivas Kandagatla wrote:
> 
> 
> On 16/07/18 09:50, Sekhar Nori wrote:
>> On Friday 13 July 2018 11:30 PM, Bartosz Golaszewski wrote:
>>
>>> We're getting close to rc5 so I'd like to make a case for this series
>>> again.
>>>
>>> I understand that there's more to do than just the changes introduced
>>> here, but we shouldn't try to fix several problems in many different
>>> places at once. There's just too many moving pieces. I'd rather start
>>> merging small improvements right away.
>>>
>>> The idea behind this series is to remove (almost) all users of
>>> at24_platform_data. The davinci_emac patches are there only because we
>>> need to remove some MAC adress reading stuff from the board files.
>>> Having this code there and calling it back from EEPROM/MTD drivers is
>>> already wrong and we should work towards using nvmem for that anyway.
>>>
>>> Currently for MTD the nvmem support series seems to be dead and it's
>>> going to take some time before anything gets upstream.
>>>
>>> So I'd like to again ask you to consider picking up the patches from
>>> this series to your respective trees or at the very least: I'd like to
>>> ask Srinivas to pick up the nvmem patches and Sekhar to take the
>>> first, non-controversial batch of davinci platform changes so that
>>> we'll have less code to carry for the next release.
>>
>> I think those are patches 3-7. I can take those if I get an immutable
>> commit over v4.18-rc1 from Srinivas with patches 1 & 2 applied.
> nvmem patches go via Greg KH char-misc tree, if it makes things easy I
> can provide Ack on nvmem patches, so that you can take these patches via
> your tree?

There is a lot of follow-up traffic on how exactly to develop the needed
interfaces for reading mac address in mtd and/or network subsystem.

But, I don't think any of that negates the need for nvmem lookups that
work for non-device-tree and populating the lookups in mach-davinci
board code.

I am going to send patches 1-7 to ARM-SoC soon, so please do say if
there is any disagreement on this.

Thanks,
Sekhar

> 
> Let me know.
> 
> --srini
>>
>> Thanks,
>> Sekhar
>>


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

* Re: [PATCH v4 08/18] net: davinci_emac: potentially get the MAC address from MTD
@ 2018-07-20  5:04                   ` Sekhar Nori
  0 siblings, 0 replies; 98+ messages in thread
From: Sekhar Nori @ 2018-07-20  5:04 UTC (permalink / raw)
  To: Srinivas Kandagatla, Bartosz Golaszewski, Andrew Lunn
  Cc: Linux ARM, Rob Herring, Florian Fainelli, David Lechner,
	Ivan Khoronzhuk, Kevin Hilman, Greg Kroah-Hartman,
	Jonathan Corbet, Russell King, Linux Kernel Mailing List,
	Bartosz Golaszewski, Grygorii Strashko, Ladislav Michl, netdev,
	Lukas Wunner, linux-omap, David S . Miller, Dan Carpenter

On Monday 16 July 2018 02:26 PM, Srinivas Kandagatla wrote:
> 
> 
> On 16/07/18 09:50, Sekhar Nori wrote:
>> On Friday 13 July 2018 11:30 PM, Bartosz Golaszewski wrote:
>>
>>> We're getting close to rc5 so I'd like to make a case for this series
>>> again.
>>>
>>> I understand that there's more to do than just the changes introduced
>>> here, but we shouldn't try to fix several problems in many different
>>> places at once. There's just too many moving pieces. I'd rather start
>>> merging small improvements right away.
>>>
>>> The idea behind this series is to remove (almost) all users of
>>> at24_platform_data. The davinci_emac patches are there only because we
>>> need to remove some MAC adress reading stuff from the board files.
>>> Having this code there and calling it back from EEPROM/MTD drivers is
>>> already wrong and we should work towards using nvmem for that anyway.
>>>
>>> Currently for MTD the nvmem support series seems to be dead and it's
>>> going to take some time before anything gets upstream.
>>>
>>> So I'd like to again ask you to consider picking up the patches from
>>> this series to your respective trees or at the very least: I'd like to
>>> ask Srinivas to pick up the nvmem patches and Sekhar to take the
>>> first, non-controversial batch of davinci platform changes so that
>>> we'll have less code to carry for the next release.
>>
>> I think those are patches 3-7. I can take those if I get an immutable
>> commit over v4.18-rc1 from Srinivas with patches 1 & 2 applied.
> nvmem patches go via Greg KH char-misc tree, if it makes things easy I
> can provide Ack on nvmem patches, so that you can take these patches via
> your tree?

There is a lot of follow-up traffic on how exactly to develop the needed
interfaces for reading mac address in mtd and/or network subsystem.

But, I don't think any of that negates the need for nvmem lookups that
work for non-device-tree and populating the lookups in mach-davinci
board code.

I am going to send patches 1-7 to ARM-SoC soon, so please do say if
there is any disagreement on this.

Thanks,
Sekhar

> 
> Let me know.
> 
> --srini
>>
>> Thanks,
>> Sekhar
>>

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

* [PATCH v4 08/18] net: davinci_emac: potentially get the MAC address from MTD
@ 2018-07-20  5:04                   ` Sekhar Nori
  0 siblings, 0 replies; 98+ messages in thread
From: Sekhar Nori @ 2018-07-20  5:04 UTC (permalink / raw)
  To: linux-arm-kernel

On Monday 16 July 2018 02:26 PM, Srinivas Kandagatla wrote:
> 
> 
> On 16/07/18 09:50, Sekhar Nori wrote:
>> On Friday 13 July 2018 11:30 PM, Bartosz Golaszewski wrote:
>>
>>> We're getting close to rc5 so I'd like to make a case for this series
>>> again.
>>>
>>> I understand that there's more to do than just the changes introduced
>>> here, but we shouldn't try to fix several problems in many different
>>> places at once. There's just too many moving pieces. I'd rather start
>>> merging small improvements right away.
>>>
>>> The idea behind this series is to remove (almost) all users of
>>> at24_platform_data. The davinci_emac patches are there only because we
>>> need to remove some MAC adress reading stuff from the board files.
>>> Having this code there and calling it back from EEPROM/MTD drivers is
>>> already wrong and we should work towards using nvmem for that anyway.
>>>
>>> Currently for MTD the nvmem support series seems to be dead and it's
>>> going to take some time before anything gets upstream.
>>>
>>> So I'd like to again ask you to consider picking up the patches from
>>> this series to your respective trees or at the very least: I'd like to
>>> ask Srinivas to pick up the nvmem patches and Sekhar to take the
>>> first, non-controversial batch of davinci platform changes so that
>>> we'll have less code to carry for the next release.
>>
>> I think those are patches 3-7. I can take those if I get an immutable
>> commit over v4.18-rc1 from Srinivas with patches 1 & 2 applied.
> nvmem patches go via Greg KH char-misc tree, if it makes things easy I
> can provide Ack on nvmem patches, so that you can take these patches via
> your tree?

There is a lot of follow-up traffic on how exactly to develop the needed
interfaces for reading mac address in mtd and/or network subsystem.

But, I don't think any of that negates the need for nvmem lookups that
work for non-device-tree and populating the lookups in mach-davinci
board code.

I am going to send patches 1-7 to ARM-SoC soon, so please do say if
there is any disagreement on this.

Thanks,
Sekhar

> 
> Let me know.
> 
> --srini
>>
>> Thanks,
>> Sekhar
>>

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

* Re: [PATCH v4 08/18] net: davinci_emac: potentially get the MAC address from MTD
  2018-07-20  5:04                   ` Sekhar Nori
  (?)
@ 2018-07-27  9:52                     ` Sekhar Nori
  -1 siblings, 0 replies; 98+ messages in thread
From: Sekhar Nori @ 2018-07-27  9:52 UTC (permalink / raw)
  To: Srinivas Kandagatla, Bartosz Golaszewski, Andrew Lunn
  Cc: Linux ARM, Rob Herring, Florian Fainelli, David Lechner,
	Ivan Khoronzhuk, Kevin Hilman, Greg Kroah-Hartman,
	Jonathan Corbet, Russell King, Linux Kernel Mailing List,
	Bartosz Golaszewski, Grygorii Strashko, Ladislav Michl, netdev,
	Lukas Wunner, linux-omap, David S . Miller, Dan Carpenter

On Friday 20 July 2018 10:34 AM, Sekhar Nori wrote:

> There is a lot of follow-up traffic on how exactly to develop the needed
> interfaces for reading mac address in mtd and/or network subsystem.
> 
> But, I don't think any of that negates the need for nvmem lookups that
> work for non-device-tree and populating the lookups in mach-davinci
> board code.
> 
> I am going to send patches 1-7 to ARM-SoC soon, so please do say if
> there is any disagreement on this.

I owed a response on this. After thinking over some and discussing with
Bartosz as well, I decided not to merge any patches from  this series.
Its better to merge anything after the actual path we are talking is
fully clear.

Thanks,
Sekhar

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

* Re: [PATCH v4 08/18] net: davinci_emac: potentially get the MAC address from MTD
@ 2018-07-27  9:52                     ` Sekhar Nori
  0 siblings, 0 replies; 98+ messages in thread
From: Sekhar Nori @ 2018-07-27  9:52 UTC (permalink / raw)
  To: Srinivas Kandagatla, Bartosz Golaszewski, Andrew Lunn
  Cc: Rob Herring, Dan Carpenter, Florian Fainelli, David Lechner,
	Ivan Khoronzhuk, Kevin Hilman, Greg Kroah-Hartman,
	Jonathan Corbet, Russell King, Linux Kernel Mailing List,
	Bartosz Golaszewski, Grygorii Strashko, Ladislav Michl, netdev,
	Lukas Wunner, linux-omap, David S . Miller, Linux ARM

On Friday 20 July 2018 10:34 AM, Sekhar Nori wrote:

> There is a lot of follow-up traffic on how exactly to develop the needed
> interfaces for reading mac address in mtd and/or network subsystem.
> 
> But, I don't think any of that negates the need for nvmem lookups that
> work for non-device-tree and populating the lookups in mach-davinci
> board code.
> 
> I am going to send patches 1-7 to ARM-SoC soon, so please do say if
> there is any disagreement on this.

I owed a response on this. After thinking over some and discussing with
Bartosz as well, I decided not to merge any patches from  this series.
Its better to merge anything after the actual path we are talking is
fully clear.

Thanks,
Sekhar

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

* [PATCH v4 08/18] net: davinci_emac: potentially get the MAC address from MTD
@ 2018-07-27  9:52                     ` Sekhar Nori
  0 siblings, 0 replies; 98+ messages in thread
From: Sekhar Nori @ 2018-07-27  9:52 UTC (permalink / raw)
  To: linux-arm-kernel

On Friday 20 July 2018 10:34 AM, Sekhar Nori wrote:

> There is a lot of follow-up traffic on how exactly to develop the needed
> interfaces for reading mac address in mtd and/or network subsystem.
> 
> But, I don't think any of that negates the need for nvmem lookups that
> work for non-device-tree and populating the lookups in mach-davinci
> board code.
> 
> I am going to send patches 1-7 to ARM-SoC soon, so please do say if
> there is any disagreement on this.

I owed a response on this. After thinking over some and discussing with
Bartosz as well, I decided not to merge any patches from  this series.
Its better to merge anything after the actual path we are talking is
fully clear.

Thanks,
Sekhar

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

end of thread, other threads:[~2018-07-27  9:54 UTC | newest]

Thread overview: 98+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-29  9:40 [PATCH v4 00/18] ARM: davinci: step towards removing at24_platform_data Bartosz Golaszewski
2018-06-29  9:40 ` Bartosz Golaszewski
2018-06-29  9:40 ` [PATCH v4 01/18] nvmem: add support for cell lookups Bartosz Golaszewski
2018-06-29  9:40   ` Bartosz Golaszewski
2018-06-29  9:40   ` Bartosz Golaszewski
2018-07-16 12:19   ` Srinivas Kandagatla
2018-07-16 12:19     ` Srinivas Kandagatla
2018-07-16 12:20   ` Srinivas Kandagatla
2018-07-16 12:20     ` Srinivas Kandagatla
2018-06-29  9:40 ` [PATCH v4 02/18] Documentation: nvmem: document lookup entries Bartosz Golaszewski
2018-06-29  9:40   ` Bartosz Golaszewski
2018-07-16 12:14   ` Sekhar Nori
2018-07-16 12:14     ` Sekhar Nori
2018-07-16 12:14     ` Sekhar Nori
2018-07-16 12:18   ` Srinivas Kandagatla
2018-07-16 12:18     ` Srinivas Kandagatla
2018-06-29  9:40 ` [PATCH v4 03/18] ARM: davinci: dm365-evm: use nvmem lookup for mac address Bartosz Golaszewski
2018-06-29  9:40   ` Bartosz Golaszewski
2018-06-29  9:40   ` Bartosz Golaszewski
2018-06-29  9:40 ` [PATCH v4 04/18] ARM: davinci: dm644-evm: " Bartosz Golaszewski
2018-06-29  9:40   ` Bartosz Golaszewski
2018-06-29  9:40 ` [PATCH v4 05/18] ARM: davinci: dm646x-evm: " Bartosz Golaszewski
2018-06-29  9:40   ` Bartosz Golaszewski
2018-06-29  9:40 ` [PATCH v4 06/18] ARM: davinci: da830-evm: " Bartosz Golaszewski
2018-06-29  9:40   ` Bartosz Golaszewski
2018-06-29  9:40 ` [PATCH v4 07/18] ARM: davinci: mityomapl138: add nvmem cells lookup entries Bartosz Golaszewski
2018-06-29  9:40   ` Bartosz Golaszewski
2018-06-29  9:40 ` [PATCH v4 08/18] net: davinci_emac: potentially get the MAC address from MTD Bartosz Golaszewski
2018-06-29  9:40   ` Bartosz Golaszewski
2018-06-29 20:09   ` David Lechner
2018-06-29 20:09     ` David Lechner
2018-06-29 20:35     ` David Lechner
2018-06-29 20:35       ` David Lechner
2018-07-02  7:41       ` Bartosz Golaszewski
2018-07-02  7:41         ` Bartosz Golaszewski
2018-07-03 16:39   ` Florian Fainelli
2018-07-03 16:39     ` Florian Fainelli
2018-07-03 16:47     ` David Lechner
2018-07-03 16:47       ` David Lechner
2018-07-04  7:09     ` Ladislav Michl
2018-07-04  7:09       ` Ladislav Michl
2018-07-04  7:09       ` Ladislav Michl
2018-07-04  8:29       ` Bartosz Golaszewski
2018-07-04  8:29         ` Bartosz Golaszewski
2018-07-04  8:29         ` Bartosz Golaszewski
2018-07-04  8:29         ` Bartosz Golaszewski
2018-07-04  9:04         ` Sekhar Nori
2018-07-04  9:04           ` Sekhar Nori
2018-07-04  9:04           ` Sekhar Nori
2018-07-13 18:00           ` Bartosz Golaszewski
2018-07-13 18:00             ` Bartosz Golaszewski
2018-07-13 18:00             ` Bartosz Golaszewski
2018-07-13 18:00             ` Bartosz Golaszewski
2018-07-16  8:50             ` Sekhar Nori
2018-07-16  8:50               ` Sekhar Nori
2018-07-16  8:50               ` Sekhar Nori
2018-07-16  8:56               ` Srinivas Kandagatla
2018-07-16  8:56                 ` Srinivas Kandagatla
2018-07-16 11:57                 ` Sekhar Nori
2018-07-16 11:57                   ` Sekhar Nori
2018-07-16 11:57                   ` Sekhar Nori
2018-07-16 12:10                   ` Greg Kroah-Hartman
2018-07-16 12:10                     ` Greg Kroah-Hartman
2018-07-16 12:10                     ` Greg Kroah-Hartman
2018-07-16 12:10                     ` Greg Kroah-Hartman
2018-07-16 12:13                     ` Sekhar Nori
2018-07-16 12:13                       ` Sekhar Nori
2018-07-16 12:13                       ` Sekhar Nori
2018-07-20  5:04                 ` Sekhar Nori
2018-07-20  5:04                   ` Sekhar Nori
2018-07-20  5:04                   ` Sekhar Nori
2018-07-27  9:52                   ` Sekhar Nori
2018-07-27  9:52                     ` Sekhar Nori
2018-07-27  9:52                     ` Sekhar Nori
2018-06-29  9:40 ` [PATCH v4 09/18] ARM: davinci: da850-evm: remove dead MTD code Bartosz Golaszewski
2018-06-29  9:40   ` Bartosz Golaszewski
2018-06-29 17:09   ` David Lechner
2018-06-29 17:09     ` David Lechner
2018-07-02  7:28     ` Bartosz Golaszewski
2018-07-02  7:28       ` Bartosz Golaszewski
2018-06-29  9:40 ` [PATCH v4 10/18] net: davinci_emac: use nvmem to retrieve the mac address Bartosz Golaszewski
2018-06-29  9:40   ` Bartosz Golaszewski
2018-06-29  9:40 ` [PATCH v4 11/18] ARM: davinci: mityomapl138: don't read the MAC address from machine code Bartosz Golaszewski
2018-06-29  9:40   ` Bartosz Golaszewski
2018-06-29  9:40 ` [PATCH v4 12/18] ARM: davinci: dm365-evm: use device properties for at24 eeprom Bartosz Golaszewski
2018-06-29  9:40   ` Bartosz Golaszewski
2018-06-29  9:40 ` [PATCH v4 13/18] ARM: davinci: da830-evm: " Bartosz Golaszewski
2018-06-29  9:40   ` Bartosz Golaszewski
2018-06-29  9:40 ` [PATCH v4 14/18] ARM: davinci: dm644x-evm: " Bartosz Golaszewski
2018-06-29  9:40   ` Bartosz Golaszewski
2018-06-29  9:40 ` [PATCH v4 15/18] ARM: davinci: dm646x-evm: " Bartosz Golaszewski
2018-06-29  9:40   ` Bartosz Golaszewski
2018-06-29  9:40 ` [PATCH v4 16/18] ARM: davinci: sffsdr: fix the at24 eeprom device name Bartosz Golaszewski
2018-06-29  9:40   ` Bartosz Golaszewski
2018-06-29  9:40 ` [PATCH v4 17/18] ARM: davinci: sffsdr: use device properties for at24 eeprom Bartosz Golaszewski
2018-06-29  9:40   ` Bartosz Golaszewski
2018-06-29  9:40 ` [PATCH v4 18/18] ARM: davinci: remove dead code related to MAC address reading Bartosz Golaszewski
2018-06-29  9:40   ` Bartosz Golaszewski

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.