nvmem: add ONIE NVMEM cells provider
v2 cover nvmem: add ONIE NVMEM cells provider
This series adds cells provider for the ONIE TLV attributes which are stored on NVMEM device. It adds possibility to read the mac address (and other info) by other drivers.
Driver needs to register NVMEM cells table for already registered NVMEM device, this requires additional change to the core logic because current logic only allows to add additional cells only before nvmem device registration.
v2:
1) Fixed wrong memcmp comparison
Vadym Kochan (2):
nvmem: core: allow to register cells for existing device
nvmem: add ONIE NVMEM cells support
drivers/nvmem/Kconfig | 9 + drivers/nvmem/Makefile | 3 + drivers/nvmem/core.c | 59 ++++--- drivers/nvmem/onie-cells.c | 332 +++++++++++++++++++++++++++++++++++++ 4 files changed, 381 insertions(+), 22 deletions(-) create mode 100644 drivers/nvmem/onie-cells.c
Signature · 1 line
2.17.1
PATCH v2 1/2 nvmem: core: allow to register cells for existing device
Current implementation does not allow to register nvmem cells for existing device and requires that this will be done before device is registered.
But there might a driver which provides only cells info which needs to be added for already registered nvmem device.
--- drivers/nvmem/core.c | 59 +++++++++++++++++++++++++++----------------- 1 file changed, 37 insertions(+), 22 deletions(-)
drivers/nvmem/core.c +37 -22
@@ -482,35 +482,43 @@ int nvmem_unregister_notifier(struct notifier_block *nb) }EXPORT_SYMBOL_GPL (nvmem_unregister_notifier); -static int nvmem_add_cells_from_table (struct nvmem_device *nvmem) +static int __nvmem_add_cells_from_table (struct nvmem_device *nvmem, +struct nvmem_cell_table *table) {const struct nvmem_cell_info *info; -struct nvmem_cell_table *table;struct nvmem_cell *cell; -int rval =0 , i; +int err, i; + +for (i =0 ; i < table->ncells; i++) { + info = &table->cells[i]; + + cell =kzalloc (sizeof (*cell),GFP_KERNEL ); +if (!cell) +return -ENOMEM ; + + err =nvmem_cell_info_to_nvmem_cell (nvmem, info, cell); +if (err) { +kfree (cell); +return err; + } + +nvmem_cell_add (cell); + } + +return 0 ; +} + +static int nvmem_add_cells_from_table (struct nvmem_device *nvmem) +{ +struct nvmem_cell_table *table; +int rval =0 ;mutex_lock (&nvmem_cell_mutex);list_for_each_entry (table, &nvmem_cell_tables, node) {if (strcmp (nvmem_dev_name (nvmem), table->nvmem_name) ==0 ) { -for (i =0 ; i < table->ncells; i++) { - info = &table->cells[i]; - - cell =kzalloc (sizeof (*cell),GFP_KERNEL ); -if (!cell) { - rval = -ENOMEM ; - goto out; - } - - rval =nvmem_cell_info_to_nvmem_cell (nvmem, - info, - cell); -if (rval) { -kfree (cell); - goto out; - } - -nvmem_cell_add (cell); - } + rval =__nvmem_add_cells_from_table (nvmem, table); +if (rval) + goto out; } }
@@ -1560,6 +1568,13 @@ EXPORT_SYMBOL_GPL(nvmem_device_write);*/ void nvmem_add_cell_table (struct nvmem_cell_table *table) { +const char *dev_name = table->nvmem_name; +struct nvmem_device *nvmem; + + nvmem =__nvmem_device_get ((void *)dev_name, device_match_name); +if (nvmem) +__nvmem_add_cells_from_table (nvmem, table); +mutex_lock (&nvmem_cell_mutex);list_add_tail (&table->node, &nvmem_cell_tables);mutex_unlock (&nvmem_cell_mutex);
Signature · 1 line
2.17.1
PATCH v2 2/2 nvmem: add ONIE NVMEM cells support
In reply to Vadym KochanONIE is a small operating system, pre-installed on bare metal network switches, that provides an environment for automated provisioning.
This system requires that NVMEM (EEPROM) device holds various system information (mac address, platform name, etc) in a special TLV layout.
The driver registers ONIE TLV attributes as NVMEM cells which can be accessed by other platform driver. Also it allows to use of_get_mac_address() to retrieve mac address for the netdev.
--- drivers/nvmem/Kconfig | 9 + drivers/nvmem/Makefile | 3 + drivers/nvmem/onie-cells.c | 332 +++++++++++++++++++++++++++++++++++++ 3 files changed, 344 insertions(+) create mode 100644 drivers/nvmem/onie-cells.c
drivers/nvmem/Kconfig +9 -0
@@ -273,4 +273,13 @@ config SPRD_EFUSE This driver can also be built as a module. If so, the module will be called nvmem-sprd-efuse. +config NVMEM_ONIE_CELLS + tristate "ONIE TLV cells support" + help + This is a driver to provide cells from ONIE TLV structure stored + on NVME device. + + This driver can also be built as a module. If so, the module + will be called nvmem-onie-cells. + endif
drivers/nvmem/Makefile +3 -0
@@ -55,3 +55,6 @@ obj-$(CONFIG_NVMEM_ZYNQMP) += nvmem_zynqmp_nvmem.o nvmem_zynqmp_nvmem-y := zynqmp_nvmem.o obj-$(CONFIG_SPRD_EFUSE) += nvmem_sprd_efuse.o nvmem_sprd_efuse-y := sprd-efuse.o + +obj-$(CONFIG_NVMEM_ONIE_CELLS) += nvmem-onie-cells.o +nvmem-onie-cells-y := onie-cells.o
drivers/nvmem/onie-cells.c new file +332 -0
332 lines not on this page · raw message
Signature · 1 line
2.17.1
Re: [PATCH v2 2/2] nvmem: add ONIE NVMEM cells support
Quoted 10 lines · Vadym Kochan
ONIE is a small operating system, pre-installed on bare metal network switches, that provides an environment for automated provisioning.
This system requires that NVMEM (EEPROM) device holds various system information (mac address, platform name, etc) in a special TLV layout.
The driver registers ONIE TLV attributes as NVMEM cells which can be accessed by other platform driver. Also it allows to use
of_get_mac_address()to retrieve mac address for the netdev.
Quoted 5 lines
Signed-off-by Vadym Kochan <[email protected]>--- drivers/nvmem/Kconfig | 9 + drivers/nvmem/Makefile | 3 + drivers/nvmem/onie-cells.c | 332 +++++++++++++++++++++++++++++++++++++
Is there a reason why Device tree bindings are missing for this driver?
Quoted 63 lines
3 files changed, 344 insertions(+)create mode 100644
drivers/nvmem/onie-cells.cdrivers/nvmem/Kconfig +9
-0@@ -273,4 +273,13 @@ config SPRD_EFUSE This driver can also be built as a module. If so, the module will be called nvmem-sprd-efuse. +config NVMEM_ONIE_CELLS + tristate "ONIE TLV cells support" + help + This is a driver to provide cells from ONIE TLV structure stored + on NVME device. + + This driver can also be built as a module. If so, the module + will be called nvmem-onie-cells. + endifdrivers/nvmem/Makefile +3
-0@@ -55,3 +55,6 @@ obj-$(CONFIG_NVMEM_ZYNQMP) += nvmem_zynqmp_nvmem.o nvmem_zynqmp_nvmem-y := zynqmp_nvmem.o obj-$(CONFIG_SPRD_EFUSE) += nvmem_sprd_efuse.o nvmem_sprd_efuse-y := sprd-efuse.o + +obj-$(CONFIG_NVMEM_ONIE_CELLS) += nvmem-onie-cells.o +nvmem-onie-cells-y := onie-cells.odrivers/nvmem/onie-cells.c new file +25
-0@@ -0,0 +1,332 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* +* ONIE NVMEM cells provider +* +* Author: Vadym Kochan <[email protected]> +*/ + +#define ONIE_NVMEM_DRVNAME "onie-nvmem-cells" + +#define pr_fmt (fmt) ONIE_NVMEM_DRVNAME ": " fmt + +#include <linux/kernel.h> +#include <linux/module.h> +#include <linux/slab.h> +#include <linux/init.h> +#include <linux/of.h> +#include <linux/of_device.h> +#include <linux/platform_device.h> +#include <linux/nvmem-consumer.h> +#include <linux/nvmem-provider.h> + +#define ONIE_NVMEM_TLV_MAX_LEN 2048 + +#define ONIE_NVMEM_HDR_ID "TlvInfo" +
...
Quoted 6 lines
drivers/nvmem/onie-cells.c new file +6
-0+ +static int onie_nvmem_probe (struct platform_device *pdev) +{ +struct device *dev = &pdev->dev; +struct device_node *np = dev->of_node; +struct nvmem_cell_info *cells;
drivers/nvmem/onie-cells.c line 209
Quoted 10 lines
drivers/nvmem/onie-cells.c new file +10
-0+struct onie_nvmem_attr *attr; +struct nvmem_device *nvmem; +struct onie_nvmem *onie; +unsigned int ncells =0 ; +int err; + + nvmem =of_nvmem_device_get (np,NULL ); +if (IS_ERR (nvmem)) +return PTR_ERR (nvmem); +
TBH, this looks completely incorrect way to do this and misuse of nvmem consumer interface.
Ideally nvmem provider driver should populate "cells" in struct nvmem_config after decoding them and then register nvmem provider.
That should just work!
--srini
Quoted 85 lines
drivers/nvmem/onie-cells.c new file +85
-0+ onie =kmalloc (sizeof (*onie),GFP_KERNEL ); +if (!onie) { + err = -ENOMEM ; + goto err_nvmem_alloc; + } + +INIT_LIST_HEAD (&onie->attrs); + onie->attr_count =0 ; + onie->nvmem = nvmem; + + err =onie_nvmem_decode (onie); +if (err) + goto err_nvmem_decode; + +if (!onie->attr_count) { +pr_err ("%s: has no ONIE attributes\n" ,nvmem_dev_name (nvmem)); + err = -EINVAL ; + goto err_no_attrs; + } + + cells =kmalloc_array (onie->attr_count,sizeof (*cells),GFP_KERNEL ); +if (!cells) { + err = -ENOMEM ; + goto err_cells_alloc; + } + + onie->cell_lookup =kmalloc_array (onie->attr_count, +sizeof (struct nvmem_cell_lookup ), +GFP_KERNEL ); +if (!onie->cell_lookup) { + err = -ENOMEM ; + goto err_lookup_alloc; + } + +list_for_each_entry (attr, &onie->attrs, head) { +struct nvmem_cell_lookup *lookup; +struct nvmem_cell_info *cell; + + cell = &cells[ncells]; + + lookup = &onie->cell_lookup[ncells]; + lookup->con_id =NULL ; + + cell->offset = attr->offset; + cell->name = attr->name; + cell->bytes = attr->len; + cell->bit_offset =0 ; + cell->nbits =0 ; + + lookup->nvmem_name =nvmem_dev_name (onie->nvmem); + lookup->dev_id =dev_name (dev); + lookup->cell_name = cell->name; + lookup->con_id = cell->name; + + ncells++; + } + + onie->cell_tbl.nvmem_name =nvmem_dev_name (onie->nvmem); + onie->cell_tbl.ncells = ncells; + onie->cell_tbl.cells = cells; + +nvmem_add_cell_table (&onie->cell_tbl); +nvmem_add_cell_lookups (onie->cell_lookup, ncells); + +dev_set_drvdata (dev, onie); + +onie_nvmem_attrs_free (onie); + +nvmem_device_put (nvmem); + +return 0 ; + +err_lookup_alloc: +kfree (onie->cell_tbl.cells); +err_cells_alloc: +onie_nvmem_attrs_free (onie); +err_no_attrs: +err_nvmem_decode: +kfree (onie); +err_nvmem_alloc: +nvmem_device_put (nvmem); + +return err; +} +
Re: [PATCH v2 2/2] nvmem: add ONIE NVMEM cells support
Hi,
Quoted 13 lines · Srinivas Kandagatla
Quoted 10 lines · Vadym Kochan
ONIE is a small operating system, pre-installed on bare metal network switches, that provides an environment for automated provisioning.
This system requires that NVMEM (EEPROM) device holds various system information (mac address, platform name, etc) in a special TLV layout.
The driver registers ONIE TLV attributes as NVMEM cells which can be accessed by other platform driver. Also it allows to use
of_get_mac_address()to retrieve mac address for the netdev.
Quoted 8 lines
Quoted 5 lines
Signed-off-by Vadym Kochan <[email protected]>--- drivers/nvmem/Kconfig | 9 + drivers/nvmem/Makefile | 3 + drivers/nvmem/onie-cells.c | 332 +++++++++++++++++++++++++++++++++++++Is there a reason why Device tree bindings are missing for this driver?
Sorry, I will do this, but I am not sure if even this driver is conceptually acceptable.
Quoted 86 lines
Quoted 64 lines
3 files changed, 344 insertions(+)create mode 100644
drivers/nvmem/onie-cells.cdrivers/nvmem/Kconfig +9
-0@@ -273,4 +273,13 @@ config SPRD_EFUSE This driver can also be built as a module. If so, the module will be called nvmem-sprd-efuse. +config NVMEM_ONIE_CELLS + tristate "ONIE TLV cells support" + help + This is a driver to provide cells from ONIE TLV structure stored + on NVME device. + + This driver can also be built as a module. If so, the module + will be called nvmem-onie-cells. + endifdrivers/nvmem/Makefile +3
-0@@ -55,3 +55,6 @@ obj-$(CONFIG_NVMEM_ZYNQMP) += nvmem_zynqmp_nvmem.o nvmem_zynqmp_nvmem-y := zynqmp_nvmem.o obj-$(CONFIG_SPRD_EFUSE) += nvmem_sprd_efuse.o nvmem_sprd_efuse-y := sprd-efuse.o + +obj-$(CONFIG_NVMEM_ONIE_CELLS) += nvmem-onie-cells.o +nvmem-onie-cells-y := onie-cells.odrivers/nvmem/onie-cells.c new file +25
-0@@ -0,0 +1,332 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* +* ONIE NVMEM cells provider +* +* Author: Vadym Kochan <[email protected]> +*/ + +#define ONIE_NVMEM_DRVNAME "onie-nvmem-cells" + +#define pr_fmt (fmt) ONIE_NVMEM_DRVNAME ": " fmt + +#include <linux/kernel.h> +#include <linux/module.h> +#include <linux/slab.h> +#include <linux/init.h> +#include <linux/of.h> +#include <linux/of_device.h> +#include <linux/platform_device.h> +#include <linux/nvmem-consumer.h> +#include <linux/nvmem-provider.h> + +#define ONIE_NVMEM_TLV_MAX_LEN 2048 + +#define ONIE_NVMEM_HDR_ID "TlvInfo" +...
Quoted 6 lines
drivers/nvmem/onie-cells.c new file +6
-0+ +static int onie_nvmem_probe (struct platform_device *pdev) +{ +struct device *dev = &pdev->dev; +struct device_node *np = dev->of_node; +struct nvmem_cell_info *cells;drivers/nvmem/onie-cells.c line 209
Quoted 10 lines
drivers/nvmem/onie-cells.c new file +10
-0+struct onie_nvmem_attr *attr; +struct nvmem_device *nvmem; +struct onie_nvmem *onie; +unsigned int ncells =0 ; +int err; + + nvmem =of_nvmem_device_get (np,NULL ); +if (IS_ERR (nvmem)) +return PTR_ERR (nvmem); +TBH, this looks completely incorrect way to do this and misuse of nvmem consumer interface.
Quoted 7 lines
Ideally nvmem provider driver should populate "cells" in struct
nvmem_configafter decoding them and then register nvmem provider.That should just work!
--srini
But this is not nvmem provider but just describes the cells for any nvmem device, because ONIE uses special TLV structure on the nvmem device. So from the nvmem device point it is a consumer but provides the cells for the given device.
Quoted 87 lines
Quoted 87 lines
drivers/nvmem/onie-cells.c new file +85
-0+ onie =kmalloc (sizeof (*onie),GFP_KERNEL ); +if (!onie) { + err = -ENOMEM ; + goto err_nvmem_alloc; + } + +INIT_LIST_HEAD (&onie->attrs); + onie->attr_count =0 ; + onie->nvmem = nvmem; + + err =onie_nvmem_decode (onie); +if (err) + goto err_nvmem_decode; + +if (!onie->attr_count) { +pr_err ("%s: has no ONIE attributes\n" ,nvmem_dev_name (nvmem)); + err = -EINVAL ; + goto err_no_attrs; + } + + cells =kmalloc_array (onie->attr_count,sizeof (*cells),GFP_KERNEL ); +if (!cells) { + err = -ENOMEM ; + goto err_cells_alloc; + } + + onie->cell_lookup =kmalloc_array (onie->attr_count, +sizeof (struct nvmem_cell_lookup ), +GFP_KERNEL ); +if (!onie->cell_lookup) { + err = -ENOMEM ; + goto err_lookup_alloc; + } + +list_for_each_entry (attr, &onie->attrs, head) { +struct nvmem_cell_lookup *lookup; +struct nvmem_cell_info *cell; + + cell = &cells[ncells]; + + lookup = &onie->cell_lookup[ncells]; + lookup->con_id =NULL ; + + cell->offset = attr->offset; + cell->name = attr->name; + cell->bytes = attr->len; + cell->bit_offset =0 ; + cell->nbits =0 ; + + lookup->nvmem_name =nvmem_dev_name (onie->nvmem); + lookup->dev_id =dev_name (dev); + lookup->cell_name = cell->name; + lookup->con_id = cell->name; + + ncells++; + } + + onie->cell_tbl.nvmem_name =nvmem_dev_name (onie->nvmem); + onie->cell_tbl.ncells = ncells; + onie->cell_tbl.cells = cells; + +nvmem_add_cell_table (&onie->cell_tbl); +nvmem_add_cell_lookups (onie->cell_lookup, ncells); + +dev_set_drvdata (dev, onie); + +onie_nvmem_attrs_free (onie); + +nvmem_device_put (nvmem); + +return 0 ; + +err_lookup_alloc: +kfree (onie->cell_tbl.cells); +err_cells_alloc: +onie_nvmem_attrs_free (onie); +err_no_attrs: +err_nvmem_decode: +kfree (onie); +err_nvmem_alloc: +nvmem_device_put (nvmem); + +return err; +} +
Re: [PATCH v2 2/2] nvmem: add ONIE NVMEM cells support
Quoted 11 lines · Vadym Kochan
Quoted 11 lines
drivers/nvmem/onie-cells.c line 209
Quoted 5 lines
drivers/nvmem/onie-cells.c new file +5
-0+ + nvmem =of_nvmem_device_get (np,NULL ); +if (IS_ERR (nvmem)) +return PTR_ERR (nvmem); +TBH, this looks completely incorrect way to do this and misuse of nvmem consumer interface.
Ideally nvmem provider driver should populate "cells" in struct
nvmem_configafter decoding them and then register nvmem provider.
Quoted 8 lines
Quoted 4 lines
That should just work!
--srini
But this is not nvmem provider but just describes the cells for any nvmem device, because ONIE uses special TLV structure on the nvmem device. So from the nvmem device point it is a consumer but provides the cells for the given device.
That still falls under nvmem providers responsibility to parse these cells before registering it.
BTW, where is the provider driver for this in kernel?
--srini
Quoted 1 line
Re: [PATCH v2 2/2] nvmem: add ONIE NVMEM cells support
Quoted 17 lines · Srinivas Kandagatla
Quoted 14 lines · Vadym Kochan
Quoted 14 lines
drivers/nvmem/onie-cells.c line 209
Quoted 5 lines
drivers/nvmem/onie-cells.c new file +5
-0+ + nvmem =of_nvmem_device_get (np,NULL ); +if (IS_ERR (nvmem)) +return PTR_ERR (nvmem); +TBH, this looks completely incorrect way to do this and misuse of nvmem consumer interface.
Ideally nvmem provider driver should populate "cells" in struct
nvmem_configafter decoding them and then register nvmem provider.That should just work!
Quoted 8 lines
Quoted 5 lines
Quoted 1 line
--srini
But this is not nvmem provider but just describes the cells for any nvmem device, because ONIE uses special TLV structure on the nvmem device. So from the nvmem device point it is a consumer but provides the cells for the given device.
That still falls under nvmem providers responsibility to parse these cells before registering it.
OK, I thought that it is legal to have separate nvmem driver which provides access to the device itself, and other driver which describes the layout of the cells which might be applicable to any nvmem.
Quoted 7 lines
BTW, where is the provider driver for this in kernel ?
--srini
Quoted 1 line
One of the example is atmel eeprom (at24), but there might be different devices.
But can you please explain what is the technical/conceptual issue with this approach ?
Thanks,
Re: [PATCH v2 2/2] nvmem: add ONIE NVMEM cells support
Hi Srinivas,
Quoted 37 lines · Vadym Kochan
Quoted 17 lines · Srinivas Kandagatla
Quoted 14 lines · Vadym Kochan
Quoted 14 lines
drivers/nvmem/onie-cells.c line 209
Quoted 5 lines
drivers/nvmem/onie-cells.c new file +5
-0+ + nvmem =of_nvmem_device_get (np,NULL ); +if (IS_ERR (nvmem)) +return PTR_ERR (nvmem); +TBH, this looks completely incorrect way to do this and misuse of nvmem consumer interface.
Ideally nvmem provider driver should populate "cells" in struct
nvmem_configafter decoding them and then register nvmem provider.That should just work!
Quoted 8 lines
Quoted 5 lines
Quoted 1 line
--srini
But this is not nvmem provider but just describes the cells for any nvmem device, because ONIE uses special TLV structure on the nvmem device. So from the nvmem device point it is a consumer but provides the cells for the given device.
That still falls under nvmem providers responsibility to parse these cells before registering it.
OK, I thought that it is legal to have separate nvmem driver which provides access to the device itself, and other driver which describes the layout of the cells which might be applicable to any nvmem.
Quoted 7 lines
BTW, where is the provider driver for this in kernel ?
--srini
Quoted 1 line
Quoted 7 lines
One of the example is atmel eeprom (at24), but there might be different devices.
But can you please explain what is the technical/conceptual issue with this approach ?
Thanks,
I just I'd like to clarify if there is a way it can be acceptable. The problem is that there is TLV format which might be used on any nvmem device which contains for example mac address which needs to be exposed as nvmem cell. If to populate cells via nvmem_config then anyway I need to parse these cells from the "target" nvmem device.
Thanks,
Re: [PATCH v2 2/2] nvmem: add ONIE NVMEM cells support
Quoted 6 lines · Vadym Kochan
Quoted 6 lines
One of the example is atmel eeprom (at24), but there might be different devices.
But can you please explain what is the technical/conceptual issue with this approach ?
Quoted 6 lines
Quoted 1 line
Thanks,
I just I'd like to clarify if there is a way it can be acceptable. The problem is that there is TLV format which might be used on any nvmem device which contains for example mac address which needs to be exposed as nvmem cell. If to populate cells via
nvmem_configthen anyway I need to parse these cells from the "target" nvmem device.
As a first step this need to be part of the provider logic to parse this before nvmem provider is registered. If there are more users for such parsing, we can think of adding some level of parsing to nvmem core itself.
Hope this answers your query.
Thanks,
srini
Re: [PATCH v2 2/2] nvmem: add ONIE NVMEM cells support
Hi Srinivas,
Quoted 18 lines · Srinivas Kandagatla
Quoted 6 lines · Vadym Kochan
Quoted 6 lines
One of the example is atmel eeprom (at24), but there might be different devices.
But can you please explain what is the technical/conceptual issue with this approach ?
Quoted 6 lines
Quoted 1 line
Thanks,
I just I'd like to clarify if there is a way it can be acceptable. The problem is that there is TLV format which might be used on any nvmem device which contains for example mac address which needs to be exposed as nvmem cell. If to populate cells via
nvmem_configthen anyway I need to parse these cells from the "target" nvmem device.
Quoted 8 lines
As a first step this need to be part of the provider logic to parse this before nvmem provider is registered. If there are more users for such parsing, we can think of adding some level of parsing to nvmem core itself.
Hope this answers your query.
Thanks,
srini
Thank you for suggestion, I did not answered because I was not sure about the way how to provide this cell parser registering, still I am not sure about the preferred way. What about the following way:
1) nvmem provides API for registering cell-parser.
Looks like it might be similar to the API for adding the cell-table by using device's name.
2) cell-parser driver registers itself using API from above (I am not sure on which initcall stage better to perform registration to be registered before the nvmem drivers probe)
3) during nvmem_register() (before adding cells from table) core tries to find parser by matching on device's name.
If parser is found - then core calls the callback with passing the pointer to nvmem device.
4) cell-driver is called via on-parse callback.
During this callback the cell-parser driver can parse the nvmem device and register cell table.
5) core adds cells from registered tables.
Thank you,