* [PATCH 1/2] dt-bindings: nvmem: add binding doc for i.MX OCOTP/ELE
@ 2023-05-05 9:17 Peng Fan (OSS)
2023-05-05 9:17 ` [PATCH 2/2] nvmem: imx: support i.MX93 OCOTP Peng Fan (OSS)
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: Peng Fan (OSS) @ 2023-05-05 9:17 UTC (permalink / raw)
To: srinivas.kandagatla, robh+dt, krzysztof.kozlowski+dt
Cc: shawnguo, s.hauer, kernel, festevam, linux-imx, devicetree,
linux-arm-kernel, linux-kernel, Peng Fan
From: Peng Fan <peng.fan@nxp.com>
There are two parts of i.MX93 OCOTP, with 1st part Fuse shadow block(fsb),
2nd part managed by ELE firmware. This binding doc supports both.
Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
.../bindings/nvmem/imx-ocotp-ele.yaml | 65 +++++++++++++++++++
1 file changed, 65 insertions(+)
create mode 100644 Documentation/devicetree/bindings/nvmem/imx-ocotp-ele.yaml
diff --git a/Documentation/devicetree/bindings/nvmem/imx-ocotp-ele.yaml b/Documentation/devicetree/bindings/nvmem/imx-ocotp-ele.yaml
new file mode 100644
index 000000000000..024594a2bcb4
--- /dev/null
+++ b/Documentation/devicetree/bindings/nvmem/imx-ocotp-ele.yaml
@@ -0,0 +1,65 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/nvmem/imx-ocotp-ele.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: NXP i.MX9 On-Chip OTP Controller (OCOTP)
+
+maintainers:
+ - Peng Fan <peng.fan@nxp.com>
+
+allOf:
+ - $ref: nvmem.yaml#
+
+properties:
+ compatible:
+ oneOf:
+ - items:
+ - const: fsl,imx93-ocotp-fsb
+ - const: syscon
+ - items:
+ - const: fsl,imx93-ocotp-ele
+
+ reg:
+ maxItems: 1
+
+ "#address-cells":
+ const: 1
+
+ "#size-cells":
+ const: 1
+
+ clocks:
+ maxItems: 1
+
+required:
+ - compatible
+
+unevaluatedProperties: false
+
+examples:
+ - |
+ #include <dt-bindings/clock/imx6sx-clock.h>
+
+ ocotp: efuse@21bc000 {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ compatible = "fsl,imx6sx-ocotp", "syscon";
+ reg = <0x021bc000 0x4000>;
+ clocks = <&clks IMX6SX_CLK_OCOTP>;
+
+ cpu_speed_grade: speed-grade@10 {
+ reg = <0x10 4>;
+ };
+
+ tempmon_calib: calib@38 {
+ reg = <0x38 4>;
+ };
+
+ tempmon_temp_grade: temp-grade@20 {
+ reg = <0x20 4>;
+ };
+ };
+
+...
--
2.37.1
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 2/2] nvmem: imx: support i.MX93 OCOTP
2023-05-05 9:17 [PATCH 1/2] dt-bindings: nvmem: add binding doc for i.MX OCOTP/ELE Peng Fan (OSS)
@ 2023-05-05 9:17 ` Peng Fan (OSS)
2023-05-05 10:24 ` [PATCH 1/2] dt-bindings: nvmem: add binding doc for i.MX OCOTP/ELE Marco Felsch
2023-05-05 12:01 ` Krzysztof Kozlowski
2 siblings, 0 replies; 7+ messages in thread
From: Peng Fan (OSS) @ 2023-05-05 9:17 UTC (permalink / raw)
To: srinivas.kandagatla, robh+dt, krzysztof.kozlowski+dt
Cc: shawnguo, s.hauer, kernel, festevam, linux-imx, devicetree,
linux-arm-kernel, linux-kernel, Peng Fan
From: Peng Fan <peng.fan@nxp.com>
Add i.MX93 OCOTP support. i.MX93 OCOTP has two parts: Fuse shadow
block(fsb) and fuse managed by ELE. The FSB part could be directly
accessed with MMIO, the ELE could only be accessed with ELE API.
Currently the ELE API is not ready, so NULL function callback is used,
but it was tested with downstream ELE API.
Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
drivers/nvmem/Kconfig | 9 ++
drivers/nvmem/Makefile | 2 +
drivers/nvmem/imx-ocotp-ele.c | 183 ++++++++++++++++++++++++++++++++++
3 files changed, 194 insertions(+)
create mode 100644 drivers/nvmem/imx-ocotp-ele.c
diff --git a/drivers/nvmem/Kconfig b/drivers/nvmem/Kconfig
index b291b27048c7..e7093726b28e 100644
--- a/drivers/nvmem/Kconfig
+++ b/drivers/nvmem/Kconfig
@@ -82,6 +82,15 @@ config NVMEM_IMX_OCOTP
This driver can also be built as a module. If so, the module
will be called nvmem-imx-ocotp.
+config NVMEM_IMX_OCOTP_ELE
+ tristate "i.MX On-Chip OTP Controller support"
+ depends on ARCH_MXC || COMPILE_TEST
+ depends on HAS_IOMEM
+ depends on OF
+ help
+ This is a driver for the On-Chip OTP Controller (OCOTP)
+ available on i.MX SoCs which has ELE.
+
config NVMEM_IMX_OCOTP_SCU
tristate "i.MX8 SCU On-Chip OTP Controller support"
depends on IMX_SCU
diff --git a/drivers/nvmem/Makefile b/drivers/nvmem/Makefile
index f82431ec8aef..cc23ce4ffb1f 100644
--- a/drivers/nvmem/Makefile
+++ b/drivers/nvmem/Makefile
@@ -18,6 +18,8 @@ obj-$(CONFIG_NVMEM_IMX_IIM) += nvmem-imx-iim.o
nvmem-imx-iim-y := imx-iim.o
obj-$(CONFIG_NVMEM_IMX_OCOTP) += nvmem-imx-ocotp.o
nvmem-imx-ocotp-y := imx-ocotp.o
+obj-$(CONFIG_NVMEM_IMX_OCOTP_ELE) += nvmem-imx-ocotp-ele.o
+nvmem-imx-ocotp-ele-y := imx-ocotp-ele.o
obj-$(CONFIG_NVMEM_IMX_OCOTP_SCU) += nvmem-imx-ocotp-scu.o
nvmem-imx-ocotp-scu-y := imx-ocotp-scu.o
obj-$(CONFIG_NVMEM_JZ4780_EFUSE) += nvmem_jz4780_efuse.o
diff --git a/drivers/nvmem/imx-ocotp-ele.c b/drivers/nvmem/imx-ocotp-ele.c
new file mode 100644
index 000000000000..a8d2aa7488de
--- /dev/null
+++ b/drivers/nvmem/imx-ocotp-ele.c
@@ -0,0 +1,183 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * i.MX9 OCOTP fusebox driver
+ *
+ * Copyright 2023 NXP
+ */
+
+#include <linux/device.h>
+#include <linux/io.h>
+#include <linux/module.h>
+#include <linux/nvmem-provider.h>
+#include <linux/of_device.h>
+#include <linux/platform_device.h>
+#include <linux/slab.h>
+
+#define FSB_FUSE BIT(0)
+#define ELE_FUSE BIT(1)
+
+struct ocotp_map_entry {
+ u32 start; /* start word */
+ u32 num; /* num words */
+};
+
+struct ocotp_devtype_data {
+ u32 reg_off;
+ char *name;
+ u32 size;
+ u32 num_entry;
+ u32 flag;
+ nvmem_reg_read_t reg_read;
+ struct ocotp_map_entry entry[];
+};
+
+struct imx_ocotp_priv {
+ struct device *dev;
+ void __iomem *base;
+ struct nvmem_config config;
+ struct mutex lock;
+ const struct ocotp_devtype_data *data;
+};
+
+static bool in_hole(void *context, u32 index)
+{
+ struct imx_ocotp_priv *priv = context;
+ const struct ocotp_devtype_data *data = priv->data;
+ u32 start, end;
+ int i;
+
+ for (i = 0; i < data->num_entry; i++) {
+ start = data->entry[i].start;
+ end = data->entry[i].start + data->entry[i].num;
+
+ if (index >= start && index < end)
+ return false;
+ }
+
+ return true;
+}
+
+static int imx_ocotp_fsb_read(void *context, unsigned int offset, void *val, size_t bytes)
+{
+ struct imx_ocotp_priv *priv = context;
+ void __iomem *reg = priv->base + priv->data->reg_off;
+ u32 count, index, num_bytes;
+ u32 *buf;
+ void *p;
+ int i;
+
+ index = offset;
+ num_bytes = round_up(bytes, 4);
+ count = num_bytes >> 2;
+
+ if (count > ((priv->data->size >> 2) - index))
+ count = (priv->data->size >> 2) - index;
+
+ p = kzalloc(num_bytes, GFP_KERNEL);
+ if (!p)
+ return -ENOMEM;
+
+ mutex_lock(&priv->lock);
+
+ buf = p;
+
+ for (i = index; i < (index + count); i++) {
+ if (in_hole(context, i)) {
+ *buf++ = 0;
+ continue;
+ }
+
+ *buf++ = readl_relaxed(reg + (i << 2));
+ }
+
+ memcpy(val, (u8 *)p, bytes);
+
+ mutex_unlock(&priv->lock);
+
+ kfree(p);
+
+ return 0;
+};
+
+static int imx_ele_ocotp_probe(struct platform_device *pdev)
+{
+ struct device *dev = &pdev->dev;
+ struct imx_ocotp_priv *priv;
+ struct nvmem_device *nvmem;
+
+ priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
+ if (!priv)
+ return -ENOMEM;
+
+ priv->data = of_device_get_match_data(dev);
+ if (priv->data && (priv->data->flag & FSB_FUSE)) {
+ priv->base = devm_platform_ioremap_resource(pdev, 0);
+ if (IS_ERR(priv->base))
+ return PTR_ERR(priv->base);
+ }
+
+ priv->config.dev = dev;
+ priv->config.name = priv->data->name;
+ priv->config.id = NVMEM_DEVID_AUTO;
+ priv->config.owner = THIS_MODULE;
+ priv->config.size = priv->data->size;
+ priv->config.reg_read = priv->data->reg_read;
+ priv->config.word_size = 4;
+ priv->config.stride = 1;
+ priv->config.priv = priv;
+ priv->config.read_only = true;
+ mutex_init(&priv->lock);
+
+ nvmem = devm_nvmem_register(dev, &priv->config);
+ if (IS_ERR(nvmem))
+ return PTR_ERR(nvmem);
+
+ return devm_of_platform_populate(dev);
+}
+
+static const struct ocotp_devtype_data imx93_fsb_data = {
+ .flag = FSB_FUSE,
+ .reg_off = 0x8000,
+ .name = "FSB_FUSE",
+ .reg_read = imx_ocotp_fsb_read,
+ .size = 2048,
+ .num_entry = 2,
+ .entry = {
+ { 0, 52 },
+ { 312, 200 },
+ },
+};
+
+static const struct ocotp_devtype_data imx93_ele_data = {
+ .flag = ELE_FUSE,
+ .name = "ELE_FUSE",
+ .reg_read = NULL,
+ .size = 2048,
+ .num_entry = 4,
+ .entry = {
+ { 63, 1 },
+ { 128, 16 },
+ { 182, 1 },
+ { 188, 1 },
+ },
+};
+
+static const struct of_device_id imx_ele_ocotp_dt_ids[] = {
+ { .compatible = "fsl,imx93-ocotp-fsb", .data = &imx93_fsb_data, },
+ { .compatible = "fsl,imx93-ocotp-ele", .data = &imx93_ele_data, },
+ {},
+};
+MODULE_DEVICE_TABLE(of, imx_ele_ocotp_dt_ids);
+
+static struct platform_driver imx_ele_ocotp_driver = {
+ .driver = {
+ .name = "imx_ele_ocotp",
+ .of_match_table = imx_ele_ocotp_dt_ids,
+ },
+ .probe = imx_ele_ocotp_probe,
+};
+module_platform_driver(imx_ele_ocotp_driver);
+
+MODULE_DESCRIPTION("i.MX OCOTP/ELE driver");
+MODULE_AUTHOR("Peng Fan <peng.fan@nxp.com>");
+MODULE_LICENSE("GPL");
--
2.37.1
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 1/2] dt-bindings: nvmem: add binding doc for i.MX OCOTP/ELE
2023-05-05 9:17 [PATCH 1/2] dt-bindings: nvmem: add binding doc for i.MX OCOTP/ELE Peng Fan (OSS)
2023-05-05 9:17 ` [PATCH 2/2] nvmem: imx: support i.MX93 OCOTP Peng Fan (OSS)
@ 2023-05-05 10:24 ` Marco Felsch
2023-05-05 12:01 ` Krzysztof Kozlowski
2 siblings, 0 replies; 7+ messages in thread
From: Marco Felsch @ 2023-05-05 10:24 UTC (permalink / raw)
To: Peng Fan (OSS)
Cc: srinivas.kandagatla, robh+dt, krzysztof.kozlowski+dt, devicetree,
Peng Fan, shawnguo, s.hauer, linux-kernel, linux-imx, kernel,
festevam, linux-arm-kernel
Hi,
On 23-05-05, Peng Fan (OSS) wrote:
> From: Peng Fan <peng.fan@nxp.com>
...
> +examples:
> + - |
> + #include <dt-bindings/clock/imx6sx-clock.h>
> +
> + ocotp: efuse@21bc000 {
> + #address-cells = <1>;
> + #size-cells = <1>;
> + compatible = "fsl,imx6sx-ocotp", "syscon";
> + reg = <0x021bc000 0x4000>;
> + clocks = <&clks IMX6SX_CLK_OCOTP>;
Nit: the "compatible" should be the first property followed by the "reg"
property.
Regards,
Marco
> +
> + cpu_speed_grade: speed-grade@10 {
> + reg = <0x10 4>;
> + };
> +
> + tempmon_calib: calib@38 {
> + reg = <0x38 4>;
> + };
> +
> + tempmon_temp_grade: temp-grade@20 {
> + reg = <0x20 4>;
> + };
> + };
> +
> +...
> --
> 2.37.1
>
>
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 1/2] dt-bindings: nvmem: add binding doc for i.MX OCOTP/ELE
2023-05-05 9:17 [PATCH 1/2] dt-bindings: nvmem: add binding doc for i.MX OCOTP/ELE Peng Fan (OSS)
2023-05-05 9:17 ` [PATCH 2/2] nvmem: imx: support i.MX93 OCOTP Peng Fan (OSS)
2023-05-05 10:24 ` [PATCH 1/2] dt-bindings: nvmem: add binding doc for i.MX OCOTP/ELE Marco Felsch
@ 2023-05-05 12:01 ` Krzysztof Kozlowski
2023-05-05 12:09 ` Krzysztof Kozlowski
2 siblings, 1 reply; 7+ messages in thread
From: Krzysztof Kozlowski @ 2023-05-05 12:01 UTC (permalink / raw)
To: Peng Fan (OSS), srinivas.kandagatla, robh+dt, krzysztof.kozlowski+dt
Cc: shawnguo, s.hauer, kernel, festevam, linux-imx, devicetree,
linux-arm-kernel, linux-kernel, Peng Fan
On 05/05/2023 11:17, Peng Fan (OSS) wrote:
> From: Peng Fan <peng.fan@nxp.com>
>
> There are two parts of i.MX93 OCOTP, with 1st part Fuse shadow block(fsb),
> 2nd part managed by ELE firmware. This binding doc supports both.
Subject: drop second/last, redundant "binding doc for". The
"dt-bindings" prefix is already stating that these are bindings and
documentation.
>
> Signed-off-by: Peng Fan <peng.fan@nxp.com>
> ---
> .../bindings/nvmem/imx-ocotp-ele.yaml | 65 +++++++++++++++++++
> 1 file changed, 65 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/nvmem/imx-ocotp-ele.yaml
>
> diff --git a/Documentation/devicetree/bindings/nvmem/imx-ocotp-ele.yaml b/Documentation/devicetree/bindings/nvmem/imx-ocotp-ele.yaml
> new file mode 100644
> index 000000000000..024594a2bcb4
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/nvmem/imx-ocotp-ele.yaml
Filename matching compatible style. fsl,imx93-ocotp.yaml
> @@ -0,0 +1,65 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/nvmem/imx-ocotp-ele.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: NXP i.MX9 On-Chip OTP Controller (OCOTP)
> +
> +maintainers:
> + - Peng Fan <peng.fan@nxp.com>
> +
> +allOf:
> + - $ref: nvmem.yaml#
> +
> +properties:
> + compatible:
> + oneOf:
> + - items:
> + - const: fsl,imx93-ocotp-fsb
> + - const: syscon
> + - items:
> + - const: fsl,imx93-ocotp-ele
> +
> + reg:
> + maxItems: 1
> +
> + "#address-cells":
> + const: 1
Drop
> +
> + "#size-cells":
> + const: 1
Drop
> +
> + clocks:
> + maxItems: 1
> +
> +required:
> + - compatible
Also: reg and clocks
> +
> +unevaluatedProperties: false
> +
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 1/2] dt-bindings: nvmem: add binding doc for i.MX OCOTP/ELE
2023-05-05 12:01 ` Krzysztof Kozlowski
@ 2023-05-05 12:09 ` Krzysztof Kozlowski
2023-05-06 2:58 ` Peng Fan
0 siblings, 1 reply; 7+ messages in thread
From: Krzysztof Kozlowski @ 2023-05-05 12:09 UTC (permalink / raw)
To: Peng Fan (OSS), srinivas.kandagatla, robh+dt, krzysztof.kozlowski+dt
Cc: shawnguo, s.hauer, kernel, festevam, linux-imx, devicetree,
linux-arm-kernel, linux-kernel, Peng Fan
On 05/05/2023 14:01, Krzysztof Kozlowski wrote:
> On 05/05/2023 11:17, Peng Fan (OSS) wrote:
>> From: Peng Fan <peng.fan@nxp.com>
>>
>> There are two parts of i.MX93 OCOTP, with 1st part Fuse shadow block(fsb),
>> 2nd part managed by ELE firmware. This binding doc supports both.
>
> Subject: drop second/last, redundant "binding doc for". The
> "dt-bindings" prefix is already stating that these are bindings and
> documentation.
>
>>
>> Signed-off-by: Peng Fan <peng.fan@nxp.com>
>> ---
>> .../bindings/nvmem/imx-ocotp-ele.yaml | 65 +++++++++++++++++++
>> 1 file changed, 65 insertions(+)
>> create mode 100644 Documentation/devicetree/bindings/nvmem/imx-ocotp-ele.yaml
>>
>> diff --git a/Documentation/devicetree/bindings/nvmem/imx-ocotp-ele.yaml b/Documentation/devicetree/bindings/nvmem/imx-ocotp-ele.yaml
>> new file mode 100644
>> index 000000000000..024594a2bcb4
>> --- /dev/null
>> +++ b/Documentation/devicetree/bindings/nvmem/imx-ocotp-ele.yaml
>
> Filename matching compatible style. fsl,imx93-ocotp.yaml
>
>
>> @@ -0,0 +1,65 @@
>> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
>> +%YAML 1.2
>> +---
>> +$id: http://devicetree.org/schemas/nvmem/imx-ocotp-ele.yaml#
>> +$schema: http://devicetree.org/meta-schemas/core.yaml#
>> +
>> +title: NXP i.MX9 On-Chip OTP Controller (OCOTP)
>> +
>> +maintainers:
>> + - Peng Fan <peng.fan@nxp.com>
>> +
>> +allOf:
>> + - $ref: nvmem.yaml#
>> +
>> +properties:
>> + compatible:
>> + oneOf:
>> + - items:
>> + - const: fsl,imx93-ocotp-fsb
>> + - const: syscon
>> + - items:
>> + - const: fsl,imx93-ocotp-ele
>> +
Actually this is the same as existing bindings. Just squash it.
However I wonder - why this is syscon?
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 7+ messages in thread
* RE: [PATCH 1/2] dt-bindings: nvmem: add binding doc for i.MX OCOTP/ELE
2023-05-05 12:09 ` Krzysztof Kozlowski
@ 2023-05-06 2:58 ` Peng Fan
2023-05-06 6:34 ` Krzysztof Kozlowski
0 siblings, 1 reply; 7+ messages in thread
From: Peng Fan @ 2023-05-06 2:58 UTC (permalink / raw)
To: Krzysztof Kozlowski, Peng Fan (OSS),
srinivas.kandagatla, robh+dt, krzysztof.kozlowski+dt
Cc: shawnguo, s.hauer, kernel, festevam, dl-linux-imx, devicetree,
linux-arm-kernel, linux-kernel
> Subject: Re: [PATCH 1/2] dt-bindings: nvmem: add binding doc for i.MX
> OCOTP/ELE
>
> On 05/05/2023 14:01, Krzysztof Kozlowski wrote:
> > On 05/05/2023 11:17, Peng Fan (OSS) wrote:
> >> From: Peng Fan <peng.fan@nxp.com>
> >>
> >> There are two parts of i.MX93 OCOTP, with 1st part Fuse shadow
> >> block(fsb), 2nd part managed by ELE firmware. This binding doc supports
> both.
> >
> > Subject: drop second/last, redundant "binding doc for". The
> > "dt-bindings" prefix is already stating that these are bindings and
> > documentation.
> >
> >>
> >> Signed-off-by: Peng Fan <peng.fan@nxp.com>
> >> ---
> >> .../bindings/nvmem/imx-ocotp-ele.yaml | 65 +++++++++++++++++++
> >> 1 file changed, 65 insertions(+)
> >> create mode 100644
> >> Documentation/devicetree/bindings/nvmem/imx-ocotp-ele.yaml
> >>
> >> diff --git
> >> a/Documentation/devicetree/bindings/nvmem/imx-ocotp-ele.yaml
> >> b/Documentation/devicetree/bindings/nvmem/imx-ocotp-ele.yaml
> >> new file mode 100644
> >> index 000000000000..024594a2bcb4
> >> --- /dev/null
> >> +++ b/Documentation/devicetree/bindings/nvmem/imx-ocotp-ele.yaml
> >
> > Filename matching compatible style. fsl,imx93-ocotp.yaml
> >
> >
> >> @@ -0,0 +1,65 @@
> >> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) %YAML 1.2
> >> +---
> >> +$id:
> >>
> +https://eur01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fdev
> >> +icetree.org%2Fschemas%2Fnvmem%2Fimx-ocotp-
> ele.yaml%23&data=05%7C01%7
> >>
> +Cpeng.fan%40nxp.com%7Cd779f2b1abe94a0d493208db4d618fd9%7C686e
> a1d3bc2
> >>
> +b4c6fa92cd99c5c301635%7C0%7C0%7C638188853636582816%7CUnknown
> %7CTWFpb
> >>
> +GZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXV
> CI6M
> >>
> +n0%3D%7C3000%7C%7C%7C&sdata=2uIFOmUqlbgPIRasl%2FyO0CdZAFPhV
> 2qpHnhwKB
> >> +OZ008%3D&reserved=0
> >> +$schema:
> >>
> +https://eur01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fdev
> >> +icetree.org%2Fmeta-
> schemas%2Fcore.yaml%23&data=05%7C01%7Cpeng.fan%40
> >>
> +nxp.com%7Cd779f2b1abe94a0d493208db4d618fd9%7C686ea1d3bc2b4c6f
> a92cd99
> >>
> +c5c301635%7C0%7C0%7C638188853636582816%7CUnknown%7CTWFpbG
> Zsb3d8eyJWI
> >>
> +joiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7
> C3000
> >>
> +%7C%7C%7C&sdata=iKJpzjsi7TuqxDim7sUjHmwFR1eK9hFNp2ygMap9bq8%
> 3D&reser
> >> +ved=0
> >> +
> >> +title: NXP i.MX9 On-Chip OTP Controller (OCOTP)
> >> +
> >> +maintainers:
> >> + - Peng Fan <peng.fan@nxp.com>
> >> +
> >> +allOf:
> >> + - $ref: nvmem.yaml#
> >> +
> >> +properties:
> >> + compatible:
> >> + oneOf:
> >> + - items:
> >> + - const: fsl,imx93-ocotp-fsb
> >> + - const: syscon
> >> + - items:
> >> + - const: fsl,imx93-ocotp-ele
> >> +
>
> Actually this is the same as existing bindings. Just squash it.
You mean add the compatible to imx-ocotp.yaml?
>
> However I wonder - why this is syscon?
Someone may wanna to use syscon_to_regmap?
I just follow imx-ocotp.yaml.
Regards,
Peng.
>
> Best regards,
> Krzysztof
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 1/2] dt-bindings: nvmem: add binding doc for i.MX OCOTP/ELE
2023-05-06 2:58 ` Peng Fan
@ 2023-05-06 6:34 ` Krzysztof Kozlowski
0 siblings, 0 replies; 7+ messages in thread
From: Krzysztof Kozlowski @ 2023-05-06 6:34 UTC (permalink / raw)
To: Peng Fan, Peng Fan (OSS),
srinivas.kandagatla, robh+dt, krzysztof.kozlowski+dt
Cc: shawnguo, s.hauer, kernel, festevam, dl-linux-imx, devicetree,
linux-arm-kernel, linux-kernel
On 06/05/2023 04:58, Peng Fan wrote:
>> Subject: Re: [PATCH 1/2] dt-bindings: nvmem: add binding doc for i.MX
>> OCOTP/ELE
>>
>> On 05/05/2023 14:01, Krzysztof Kozlowski wrote:
>>> On 05/05/2023 11:17, Peng Fan (OSS) wrote:
>>>> From: Peng Fan <peng.fan@nxp.com>
>>>>
>>>> There are two parts of i.MX93 OCOTP, with 1st part Fuse shadow
>>>> block(fsb), 2nd part managed by ELE firmware. This binding doc supports
>> both.
>>>
>>> Subject: drop second/last, redundant "binding doc for". The
>>> "dt-bindings" prefix is already stating that these are bindings and
>>> documentation.
>>>
>>>>
>>>> Signed-off-by: Peng Fan <peng.fan@nxp.com>
>>>> ---
>>>> .../bindings/nvmem/imx-ocotp-ele.yaml | 65 +++++++++++++++++++
>>>> 1 file changed, 65 insertions(+)
>>>> create mode 100644
>>>> Documentation/devicetree/bindings/nvmem/imx-ocotp-ele.yaml
>>>>
>>>> diff --git
>>>> a/Documentation/devicetree/bindings/nvmem/imx-ocotp-ele.yaml
>>>> b/Documentation/devicetree/bindings/nvmem/imx-ocotp-ele.yaml
>>>> new file mode 100644
>>>> index 000000000000..024594a2bcb4
>>>> --- /dev/null
>>>> +++ b/Documentation/devicetree/bindings/nvmem/imx-ocotp-ele.yaml
>>>
>>> Filename matching compatible style. fsl,imx93-ocotp.yaml
>>>
>>>
>>>> @@ -0,0 +1,65 @@
>>>> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) %YAML 1.2
>>>> +---
>>>> +$id:
>>>>
>> +https://eur01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fdev
>>>> +icetree.org%2Fschemas%2Fnvmem%2Fimx-ocotp-
>> ele.yaml%23&data=05%7C01%7
>>>>
>> +Cpeng.fan%40nxp.com%7Cd779f2b1abe94a0d493208db4d618fd9%7C686e
>> a1d3bc2
>>>>
>> +b4c6fa92cd99c5c301635%7C0%7C0%7C638188853636582816%7CUnknown
>> %7CTWFpb
>>>>
>> +GZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXV
>> CI6M
>>>>
>> +n0%3D%7C3000%7C%7C%7C&sdata=2uIFOmUqlbgPIRasl%2FyO0CdZAFPhV
>> 2qpHnhwKB
>>>> +OZ008%3D&reserved=0
>>>> +$schema:
>>>>
>> +https://eur01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fdev
>>>> +icetree.org%2Fmeta-
>> schemas%2Fcore.yaml%23&data=05%7C01%7Cpeng.fan%40
>>>>
>> +nxp.com%7Cd779f2b1abe94a0d493208db4d618fd9%7C686ea1d3bc2b4c6f
>> a92cd99
>>>>
>> +c5c301635%7C0%7C0%7C638188853636582816%7CUnknown%7CTWFpbG
>> Zsb3d8eyJWI
>>>>
>> +joiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7
>> C3000
>>>>
>> +%7C%7C%7C&sdata=iKJpzjsi7TuqxDim7sUjHmwFR1eK9hFNp2ygMap9bq8%
>> 3D&reser
>>>> +ved=0
>>>> +
>>>> +title: NXP i.MX9 On-Chip OTP Controller (OCOTP)
>>>> +
>>>> +maintainers:
>>>> + - Peng Fan <peng.fan@nxp.com>
>>>> +
>>>> +allOf:
>>>> + - $ref: nvmem.yaml#
>>>> +
>>>> +properties:
>>>> + compatible:
>>>> + oneOf:
>>>> + - items:
>>>> + - const: fsl,imx93-ocotp-fsb
>>>> + - const: syscon
>>>> + - items:
>>>> + - const: fsl,imx93-ocotp-ele
>>>> +
>>
>> Actually this is the same as existing bindings. Just squash it.
>
> You mean add the compatible to imx-ocotp.yaml?
I missed this file, I was thinking about mxs, but sure, can go to imx.
All of them are the same...
>
>>
>> However I wonder - why this is syscon?
>
> Someone may wanna to use syscon_to_regmap?
> I just follow imx-ocotp.yaml.
That's not a good reason to add syscon. Drop it.
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2023-05-06 6:34 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-05 9:17 [PATCH 1/2] dt-bindings: nvmem: add binding doc for i.MX OCOTP/ELE Peng Fan (OSS)
2023-05-05 9:17 ` [PATCH 2/2] nvmem: imx: support i.MX93 OCOTP Peng Fan (OSS)
2023-05-05 10:24 ` [PATCH 1/2] dt-bindings: nvmem: add binding doc for i.MX OCOTP/ELE Marco Felsch
2023-05-05 12:01 ` Krzysztof Kozlowski
2023-05-05 12:09 ` Krzysztof Kozlowski
2023-05-06 2:58 ` Peng Fan
2023-05-06 6:34 ` Krzysztof Kozlowski
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®