* [PATCH v5 1/3] dt-bindings: Add Sercomm (Suzhou) Corporation vendor prefix
2022-05-16 15:12 [PATCH v5 0/3] Add support for Sercomm partitions Mikhail Zhilkin
@ 2022-05-16 15:16 ` Mikhail Zhilkin
2022-05-16 15:17 ` [PATCH v5 2/3] dt-bindings: mtd: partitions: Extend fixed-partitions binding Mikhail Zhilkin
2022-05-16 16:42 ` [PATCH v5 0/3] Add support for Sercomm partitions Miquel Raynal
2 siblings, 0 replies; 5+ messages in thread
From: Mikhail Zhilkin @ 2022-05-16 15:16 UTC (permalink / raw)
To: Rob Herring, Miquel Raynal
Cc: Krzysztof Kozlowski, linux-mtd, devicetree, linux-kernel, Karim,
M, Mikhail Zhilkin, Krzysztof Kozlowski
Add "sercomm" vendor prefix for "Sercomm (Suzhou) Corporation".
Company website:
Link: https://www.sercomm.com/
Signed-off-by: Mikhail Zhilkin <csharper2005@gmail.com>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
Documentation/devicetree/bindings/vendor-prefixes.yaml | 2 ++
1 file changed, 2 insertions(+)
diff --git a/Documentation/devicetree/bindings/vendor-prefixes.yaml b/Documentation/devicetree/bindings/vendor-prefixes.yaml
index 01430973ecec..65ff22364fb3 100644
--- a/Documentation/devicetree/bindings/vendor-prefixes.yaml
+++ b/Documentation/devicetree/bindings/vendor-prefixes.yaml
@@ -1082,6 +1082,8 @@ patternProperties:
description: Sensirion AG
"^sensortek,.*":
description: Sensortek Technology Corporation
+ "^sercomm,.*":
+ description: Sercomm (Suzhou) Corporation
"^sff,.*":
description: Small Form Factor Committee
"^sgd,.*":
--
2.25.1
^ permalink raw reply related [flat|nested] 5+ messages in thread* [PATCH v5 2/3] dt-bindings: mtd: partitions: Extend fixed-partitions binding
2022-05-16 15:12 [PATCH v5 0/3] Add support for Sercomm partitions Mikhail Zhilkin
2022-05-16 15:16 ` [PATCH v5 1/3] dt-bindings: Add Sercomm (Suzhou) Corporation vendor prefix Mikhail Zhilkin
@ 2022-05-16 15:17 ` Mikhail Zhilkin
2022-05-16 16:42 ` [PATCH v5 0/3] Add support for Sercomm partitions Miquel Raynal
2 siblings, 0 replies; 5+ messages in thread
From: Mikhail Zhilkin @ 2022-05-16 15:17 UTC (permalink / raw)
To: Miquel Raynal, Richard Weinberger, Vignesh Raghavendra,
Rob Herring
Cc: Krzysztof Kozlowski, Rafał Miłecki, linux-mtd,
devicetree, linux-kernel, Karim, M, Mikhail Zhilkin,
Krzysztof Kozlowski
Extend fixed-partitions binding for support of Sercomm partition parser
(add "sercomm,sc-partitions" compatible).
Signed-off-by: Mikhail Zhilkin <csharper2005@gmail.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
.../mtd/partitions/fixed-partitions.yaml | 55 ++++++++++++++++++-
1 file changed, 53 insertions(+), 2 deletions(-)
diff --git a/Documentation/devicetree/bindings/mtd/partitions/fixed-partitions.yaml b/Documentation/devicetree/bindings/mtd/partitions/fixed-partitions.yaml
index ea4cace6a955..ad3ccd250802 100644
--- a/Documentation/devicetree/bindings/mtd/partitions/fixed-partitions.yaml
+++ b/Documentation/devicetree/bindings/mtd/partitions/fixed-partitions.yaml
@@ -19,7 +19,11 @@ maintainers:
properties:
compatible:
- const: fixed-partitions
+ oneOf:
+ - const: fixed-partitions
+ - items:
+ - const: sercomm,sc-partitions
+ - const: fixed-partitions
"#address-cells": true
@@ -27,7 +31,24 @@ properties:
patternProperties:
"@[0-9a-f]+$":
- $ref: "partition.yaml#"
+ allOf:
+ - $ref: "partition.yaml#"
+ - if:
+ properties:
+ compatible:
+ contains:
+ const: sercomm,sc-partitions
+ then:
+ properties:
+ sercomm,scpart-id:
+ description: Partition id in Sercomm partition map. Mtd
+ parser uses this id to find a record in the partition map
+ containing offset and size of the current partition. The
+ values from partition map overrides partition offset and
+ size defined in reg property of the dts. Frequently these
+ values are the same, but may differ if device has bad
+ eraseblocks on a flash.
+ $ref: /schemas/types.yaml#/definitions/uint32
required:
- "#address-cells"
@@ -52,6 +73,7 @@ examples:
reg = <0x0100000 0x200000>;
};
};
+
- |
partitions {
compatible = "fixed-partitions";
@@ -64,6 +86,7 @@ examples:
reg = <0x00000000 0x1 0x00000000>;
};
};
+
- |
partitions {
compatible = "fixed-partitions";
@@ -82,6 +105,7 @@ examples:
reg = <0x2 0x00000000 0x1 0x00000000>;
};
};
+
- |
partitions {
compatible = "fixed-partitions";
@@ -119,3 +143,30 @@ examples:
};
};
};
+
+ - |
+ partitions {
+ compatible = "sercomm,sc-partitions", "fixed-partitions";
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ partition@0 {
+ label = "u-boot";
+ reg = <0x0 0x100000>;
+ sercomm,scpart-id = <0>;
+ read-only;
+ };
+
+ partition@100000 {
+ label = "dynamic partition map";
+ reg = <0x100000 0x100000>;
+ sercomm,scpart-id = <1>;
+ };
+
+ partition@200000 {
+ label = "Factory";
+ reg = <0x200000 0x100000>;
+ sercomm,scpart-id = <2>;
+ read-only;
+ };
+ };
--
2.25.1
^ permalink raw reply related [flat|nested] 5+ messages in thread* Re: [PATCH v5 0/3] Add support for Sercomm partitions
2022-05-16 15:12 [PATCH v5 0/3] Add support for Sercomm partitions Mikhail Zhilkin
2022-05-16 15:16 ` [PATCH v5 1/3] dt-bindings: Add Sercomm (Suzhou) Corporation vendor prefix Mikhail Zhilkin
2022-05-16 15:17 ` [PATCH v5 2/3] dt-bindings: mtd: partitions: Extend fixed-partitions binding Mikhail Zhilkin
@ 2022-05-16 16:42 ` Miquel Raynal
2022-05-17 16:39 ` Miquel Raynal
2 siblings, 1 reply; 5+ messages in thread
From: Miquel Raynal @ 2022-05-16 16:42 UTC (permalink / raw)
To: Mikhail Zhilkin
Cc: Rob Herring, Richard Weinberger, Vignesh Raghavendra,
Krzysztof Kozlowski, devicetree, linux-kernel, linux-mtd, Karim,
M
Hi Mikhail,
csharper2005@gmail.com wrote on Mon, 16 May 2022 15:12:28 +0000:
> This patch series add support for Sercomm mtd partition table parser. It's
> used in some Beeline, Netgear and Sercomm routers. The Sercomm partition
> map table contains real partition offsets, which may differ from device to
> device depending on the number and location of bad blocks on NAND.
Series applied in place of the previous version on mtd/next.
>
> Changes since:
> v4:
> - Add Acked-by to the first patch
>
> v3:
> - Fix commit message of the first patch
> - Add Reviewed-by to the second patch
>
> v2:
> - Fix mistakes in dt-binding
> - Add patch for new vendor prefix
> - Add vendor prefix to scpart-id property
>
> v1:
> - Add dt-binding in a separate patch
> - Remove redundant braces and logical NOT operator
> - Define pr_fmt
> - Replace kcalloc by kzalloc
> - Use of_get_child_count() and alloc big enough array before the
> for_each_child_of_node()
>
> Mikhail Zhilkin (3):
> dt-bindings: Add Sercomm (Suzhou) Corporation vendor prefix
> dt-bindings: mtd: partitions: Extend fixed-partitions binding
> mtd: parsers: add support for Sercomm partitions
>
> .../mtd/partitions/fixed-partitions.yaml | 55 +++-
> .../devicetree/bindings/vendor-prefixes.yaml | 2 +
> drivers/mtd/parsers/Kconfig | 9 +
> drivers/mtd/parsers/Makefile | 1 +
> drivers/mtd/parsers/scpart.c | 240 ++++++++++++++++++
> 5 files changed, 305 insertions(+), 2 deletions(-)
> create mode 100644 drivers/mtd/parsers/scpart.c
>
Thanks,
Miquèl
^ permalink raw reply [flat|nested] 5+ messages in thread