From 3370e104954191eeab97df7cd07146d7c48e180d Mon Sep 17 00:00:00 2001 From: Bernhard Frauendienst Date: Sat, 25 Aug 2018 12:48:54 +0200 Subject: kernel: add driver for virtual mtd_concat devices Some systems require multiple flash chips to be concatenated and read as a single mtd device. The ar71xx target provides custom code to create such mtdconcat devices. When porting devices to ath79, however, there is no way to create such devices from within the device tree. This commit adds a driver for creating virtual mtd-concat devices to the ath79 target. Nodes must have a compatible = "virtual,mtd-concat" line, and define a list of devices to concat in the 'devices' property, for example: flash { compatible = "virtual,mtd-concat"; devices = <&flash0 &flash1>; }; The driver is added to the very end of the mtd Makefile to increase the likelyhood of all child devices already being loaded at the time of probing, preventing unnecessary deferred probes which might in turn cause other problems (like failure to load MAC addresses from art because the partitions are not loaded yet). Signed-off-by: Bernhard Frauendienst --- ...dings-add-bindings-for-mtd-concat-devices.patch | 58 ++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 target/linux/generic/pending-4.14/496-dt-bindings-add-bindings-for-mtd-concat-devices.patch (limited to 'target/linux/generic/pending-4.14/496-dt-bindings-add-bindings-for-mtd-concat-devices.patch') diff --git a/target/linux/generic/pending-4.14/496-dt-bindings-add-bindings-for-mtd-concat-devices.patch b/target/linux/generic/pending-4.14/496-dt-bindings-add-bindings-for-mtd-concat-devices.patch new file mode 100644 index 0000000000..99fdb0dc0f --- /dev/null +++ b/target/linux/generic/pending-4.14/496-dt-bindings-add-bindings-for-mtd-concat-devices.patch @@ -0,0 +1,58 @@ +From 5734c6669fba7ddb5ef491ccff7159d15dba0b59 Mon Sep 17 00:00:00 2001 +From: Bernhard Frauendienst +Date: Wed, 5 Sep 2018 01:32:51 +0200 +Subject: [PATCH 496/497] dt-bindings: add bindings for mtd-concat devices + +Document virtual mtd-concat device bindings. + +Signed-off-by: Bernhard Frauendienst +--- + .../devicetree/bindings/mtd/mtd-concat.txt | 36 +++++++++++++++++++ + 1 file changed, 36 insertions(+) + create mode 100644 Documentation/devicetree/bindings/mtd/mtd-concat.txt + +diff --git a/Documentation/devicetree/bindings/mtd/mtd-concat.txt b/Documentation/devicetree/bindings/mtd/mtd-concat.txt +new file mode 100644 +index 000000000000..2daf3157b163 +--- /dev/null ++++ b/Documentation/devicetree/bindings/mtd/mtd-concat.txt +@@ -0,0 +1,36 @@ ++Virtual MTD concat device ++ ++Requires properties: ++- devices: list of phandles to mtd nodes that should be concatenated ++ ++Example: ++ ++&spi { ++ flash0: flash@0 { ++ ... ++ }; ++ flash1: flash@1 { ++ ... ++ }; ++}; ++ ++flash { ++ compatible = "mtd-concat"; ++ ++ devices = <&flash0 &flash1>; ++ ++ partitions { ++ compatible = "fixed-partitions"; ++ ++ partition@0 { ++ label = "boot"; ++ reg = <0x0000000 0x0040000>; ++ read-only; ++ }; ++ ++ partition@40000 { ++ label = "firmware"; ++ reg = <0x0040000 0x1fc0000>; ++ }; ++ } ++} +-- +2.18.0 + -- cgit v1.2.3