&nand {
status = "okay";
- partitions {
- compatible = "fixed-partitions";
- #address-cells = <1>;
- #size-cells = <1>;
-
- partition@0 {
- label = "u-boot";
- reg = <0x0 0xe0000>;
- read-only;
- };
-
- partition@e0000 {
- label = "u-boot-env";
- reg = <0xe0000 0x100000>;
- read-only;
- };
-
- factory: partition@1e0000 {
- label = "factory";
- reg = <0x1e0000 0x100000>;
- read-only;
- };
-
- factory2: partition@2e0000 {
- label = "factory2";
- reg = <0x2e0000 0x100000>;
- read-only;
- };
-
- partition@3e0000 {
- label = "kernel";
- reg = <0x3e0000 0x400000>;
- };
-
- partition@7e0000 {
- label = "ubi";
- reg = <0x7e0000 0x2e00000>;
- };
-
- partition@35e0000 {
- label = "firmware2";
- reg = <0x35e0000 0x3200000>;
+ nand@0 {
+ reg = <0>;
+ partitions {
+ compatible = "fixed-partitions";
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ partition@0 {
+ label = "u-boot";
+ reg = <0x0 0xe0000>;
+ read-only;
+ };
+
+ partition@e0000 {
+ label = "u-boot-env";
+ reg = <0xe0000 0x100000>;
+ read-only;
+ };
+
+ factory: partition@1e0000 {
+ label = "factory";
+ reg = <0x1e0000 0x100000>;
+ read-only;
+ };
+
+ factory2: partition@2e0000 {
+ label = "factory2";
+ reg = <0x2e0000 0x100000>;
+ read-only;
+ };
+
+ partition@3e0000 {
+ label = "kernel";
+ reg = <0x3e0000 0x400000>;
+ };
+
+ partition@7e0000 {
+ label = "ubi";
+ reg = <0x7e0000 0x2e00000>;
+ };
+
+ partition@35e0000 {
+ label = "firmware2";
+ reg = <0x35e0000 0x3200000>;
+ };
};
};
};
&nand {
status = "okay";
- partitions {
- compatible = "fixed-partitions";
- #address-cells = <1>;
- #size-cells = <1>;
-
- partition@0 {
- label = "u-boot";
- reg = <0x0 0x80000>;
- read-only;
- };
-
- partition@80000 {
- label = "debug";
- reg = <0x80000 0x80000>;
- read-only;
- };
-
- factory: partition@100000 {
- label = "factory";
- reg = <0x100000 0x40000>;
- read-only;
- };
-
- partition@140000 {
- label = "kernel";
- reg = <0x140000 0x200000>;
- };
-
- partition@340000 {
- label = "ubi";
- reg = <0x340000 0x1E00000>;
- };
-
- partition@2140000 {
- label = "hw_panic";
- reg = <0x2140000 0x80000>;
- read-only;
- };
-
- partition@21c0000 {
- label = "bdinfo";
- reg = <0x21c0000 0x80000>;
- read-only;
- };
-
- partition@2240000 {
- label = "backup";
- reg = <0x2240000 0x80000>;
- read-only;
- };
-
- partition@22c0000 {
- label = "overly";
- reg = <0x22c0000 0x1000000>;
- };
-
- partition@32c0000 {
- label = "firmware_backup";
- reg = <0x32c0000 0x2000000>;
- };
-
- partition@52c0000 {
- label = "oem";
- reg = <0x52c0000 0x200000>;
- };
-
- partition@54c0000 {
- label = "opt";
- reg = <0x54c0000 0x2ac0000>;
+ nand@0 {
+ reg = <0>;
+ partitions {
+ compatible = "fixed-partitions";
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ partition@0 {
+ label = "u-boot";
+ reg = <0x0 0x80000>;
+ read-only;
+ };
+
+ partition@80000 {
+ label = "debug";
+ reg = <0x80000 0x80000>;
+ read-only;
+ };
+
+ factory: partition@100000 {
+ label = "factory";
+ reg = <0x100000 0x40000>;
+ read-only;
+ };
+
+ partition@140000 {
+ label = "kernel";
+ reg = <0x140000 0x200000>;
+ };
+
+ partition@340000 {
+ label = "ubi";
+ reg = <0x340000 0x1E00000>;
+ };
+
+ partition@2140000 {
+ label = "hw_panic";
+ reg = <0x2140000 0x80000>;
+ read-only;
+ };
+
+ partition@21c0000 {
+ label = "bdinfo";
+ reg = <0x21c0000 0x80000>;
+ read-only;
+ };
+
+ partition@2240000 {
+ label = "backup";
+ reg = <0x2240000 0x80000>;
+ read-only;
+ };
+
+ partition@22c0000 {
+ label = "overly";
+ reg = <0x22c0000 0x1000000>;
+ };
+
+ partition@32c0000 {
+ label = "firmware_backup";
+ reg = <0x32c0000 0x2000000>;
+ };
+
+ partition@52c0000 {
+ label = "oem";
+ reg = <0x52c0000 0x200000>;
+ };
+
+ partition@54c0000 {
+ label = "opt";
+ reg = <0x54c0000 0x2ac0000>;
+ };
};
};
};
&nand {
status = "okay";
- partitions {
- compatible = "fixed-partitions";
- #address-cells = <1>;
- #size-cells = <1>;
-
- partition@0 {
- label = "uboot";
- reg = <0x00000 0x80000>; /* 64 KB */
- };
-
- partition@80000 {
- label = "uboot_env";
- reg = <0x80000 0x80000>; /* 64 KB */
- };
-
- partition@100000 {
- label = "factory";
- reg = <0x100000 0x40000>;
- };
-
- partition@140000 {
- label = "rootfs";
- reg = <0x140000 0xec0000>;
+ nand@0 {
+ reg = <0>;
+ partitions {
+ compatible = "fixed-partitions";
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ partition@0 {
+ label = "uboot";
+ reg = <0x00000 0x80000>; /* 64 KB */
+ };
+
+ partition@80000 {
+ label = "uboot_env";
+ reg = <0x80000 0x80000>; /* 64 KB */
+ };
+
+ partition@100000 {
+ label = "factory";
+ reg = <0x100000 0x40000>;
+ };
+
+ partition@140000 {
+ label = "rootfs";
+ reg = <0x140000 0xec0000>;
+ };
};
};
};
&nand {
status = "okay";
- partitions {
- compatible = "fixed-partitions";
- #address-cells = <1>;
- #size-cells = <1>;
-
- partition@0 {
- label = "u-boot";
- reg = <0x0 0x100000>;
- read-only;
- };
-
- partition@100000 {
- label = "SC PID";
- reg = <0x100000 0x100000>;
- read-only;
- };
-
- partition@200000 {
- label = "kernel";
- reg = <0x200000 0x400000>;
- };
-
- partition@600000 {
- label = "ubi";
- reg = <0x600000 0x1c00000>;
- };
-
- factory: partition@2e00000 {
- label = "factory";
- reg = <0x2e00000 0x100000>;
- read-only;
- };
-
- partition@4200000 {
- label = "reserved";
- reg = <0x4200000 0x3c00000>;
- read-only;
+ nand@0 {
+ reg = <0>;
+ partitions {
+ compatible = "fixed-partitions";
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ partition@0 {
+ label = "u-boot";
+ reg = <0x0 0x100000>;
+ read-only;
+ };
+
+ partition@100000 {
+ label = "SC PID";
+ reg = <0x100000 0x100000>;
+ read-only;
+ };
+
+ partition@200000 {
+ label = "kernel";
+ reg = <0x200000 0x400000>;
+ };
+
+ partition@600000 {
+ label = "ubi";
+ reg = <0x600000 0x1c00000>;
+ };
+
+ factory: partition@2e00000 {
+ label = "factory";
+ reg = <0x2e00000 0x100000>;
+ read-only;
+ };
+
+ partition@4200000 {
+ label = "reserved";
+ reg = <0x4200000 0x3c00000>;
+ read-only;
+ };
};
};
};
&nand {
status = "okay";
- partitions {
- compatible = "fixed-partitions";
- #address-cells = <1>;
- #size-cells = <1>;
-
- partition@0 {
- label = "u-boot";
- reg = <0x0 0x100000>;
- read-only;
- };
-
- partition@100000 {
- label = "SC PART_MAP";
- reg = <0x100000 0x100000>;
- read-only;
- };
-
- partition@200000 {
- label = "kernel";
- reg = <0x200000 0x400000>;
- };
-
- partition@600000 {
- label = "ubi";
- reg = <0x600000 0x2800000>;
- };
-
- partition@2e00000 {
- label = "reserved0";
- reg = <0x2e00000 0x1800000>;
- read-only;
- };
-
- factory: partition@4600000 {
- label = "factory";
- reg = <0x4600000 0x200000>;
- read-only;
- };
-
- partition@4800000 {
- label = "reserved1";
- reg = <0x4800000 0x3800000>;
- read-only;
+ nand@0 {
+ reg = <0>;
+ partitions {
+ compatible = "fixed-partitions";
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ partition@0 {
+ label = "u-boot";
+ reg = <0x0 0x100000>;
+ read-only;
+ };
+
+ partition@100000 {
+ label = "SC PART_MAP";
+ reg = <0x100000 0x100000>;
+ read-only;
+ };
+
+ partition@200000 {
+ label = "kernel";
+ reg = <0x200000 0x400000>;
+ };
+
+ partition@600000 {
+ label = "ubi";
+ reg = <0x600000 0x2800000>;
+ };
+
+ partition@2e00000 {
+ label = "reserved0";
+ reg = <0x2e00000 0x1800000>;
+ read-only;
+ };
+
+ factory: partition@4600000 {
+ label = "factory";
+ reg = <0x4600000 0x200000>;
+ read-only;
+ };
+
+ partition@4800000 {
+ label = "reserved1";
+ reg = <0x4800000 0x3800000>;
+ read-only;
+ };
};
};
};
&nand {
status = "okay";
- partitions {
- compatible = "fixed-partitions";
- #address-cells = <1>;
- #size-cells = <1>;
-
- partition@0 {
- label = "u-boot";
- reg = <0x0 0x80000>;
- read-only;
- };
-
- partition@80000 {
- label = "config";
- reg = <0x80000 0x80000>;
- read-only;
- };
-
- factory: partition@100000 {
- label = "factory";
- reg = <0x100000 0x40000>;
- read-only;
- };
-
- partition@140000 {
- compatible = "denx,uimage";
- label = "firmware";
- reg = <0x140000 0x7e40000>;
+ nand@0 {
+ reg = <0>;
+ partitions {
+ compatible = "fixed-partitions";
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ partition@0 {
+ label = "u-boot";
+ reg = <0x0 0x80000>;
+ read-only;
+ };
+
+ partition@80000 {
+ label = "config";
+ reg = <0x80000 0x80000>;
+ read-only;
+ };
+
+ factory: partition@100000 {
+ label = "factory";
+ reg = <0x100000 0x40000>;
+ read-only;
+ };
+
+ partition@140000 {
+ compatible = "denx,uimage";
+ label = "firmware";
+ reg = <0x140000 0x7e40000>;
+ };
};
};
};
&nand {
status = "okay";
- partitions {
- compatible = "fixed-partitions";
- #address-cells = <1>;
- #size-cells = <1>;
-
- partition@0 {
- label = "u-boot";
- reg = <0x0 0x80000>;
- read-only;
- };
+ nand@0 {
+ reg = <0>;
+ partitions {
+ compatible = "fixed-partitions";
+ #address-cells = <1>;
+ #size-cells = <1>;
- partition@80000 {
- label = "u-boot-env";
- reg = <0x80000 0x60000>;
- read-only;
- };
+ partition@0 {
+ label = "u-boot";
+ reg = <0x0 0x80000>;
+ read-only;
+ };
- factory: partition@e0000 {
- label = "factory";
- reg = <0xe0000 0x60000>;
- };
+ partition@80000 {
+ label = "u-boot-env";
+ reg = <0x80000 0x60000>;
+ read-only;
+ };
- partition@140000 {
- label = "kernel1";
- reg = <0x140000 0x300000>;
- };
+ factory: partition@e0000 {
+ label = "factory";
+ reg = <0xe0000 0x60000>;
+ };
- partition@440000 {
- label = "kernel2";
- reg = <0x440000 0x300000>;
- };
+ partition@140000 {
+ label = "kernel1";
+ reg = <0x140000 0x300000>;
+ };
+
+ partition@440000 {
+ label = "kernel2";
+ reg = <0x440000 0x300000>;
+ };
- partition@740000 {
- label = "ubi";
- reg = <0x740000 0xf7c0000>;
+ partition@740000 {
+ label = "ubi";
+ reg = <0x740000 0xf7c0000>;
+ };
};
};
};
&nand {
status = "okay";
- partitions {
- compatible = "fixed-partitions";
- #address-cells = <1>;
- #size-cells = <1>;
-
- partition@0 {
- label = "Bootloader";
- reg = <0x0 0x80000>;
- read-only;
- };
-
- partition@80000 {
- label = "Config";
- reg = <0x80000 0x40000>;
- };
-
- partition@c0000 {
- label = "Bdata";
- reg = <0xc0000 0x40000>;
- read-only;
- };
-
- factory: partition@100000 {
- label = "factory";
- reg = <0x100000 0x40000>;
- read-only;
- };
-
- partition@140000 {
- label = "crash";
- reg = <0x140000 0x40000>;
- };
-
- partition@180000 {
- label = "crash_syslog";
- reg = <0x180000 0x40000>;
- };
-
- partition@1c0000 {
- label = "reserved0";
- reg = <0x1c0000 0x40000>;
- read-only;
- };
-
- /* uboot expects to find kernels at 0x200000 & 0x600000
- * referred to as system 1 & system 2 respectively.
- * a kernel is considered suitable for handing control over
- * if its linux magic number exists & uImage CRC are correct.
- * If either of those conditions fail, a matching sys'n'_fail flag
- * is set in uboot env & a restart performed in the hope that the
- * alternate kernel is okay.
- * if neither kernel checksums ok and both are marked failed, system 2
- * is booted anyway.
- *
- * Note uboot's tftp flash install writes the transferred
- * image to both kernel partitions.
- */
-
- partition@200000 {
- label = "kernel_stock";
- reg = <0x200000 0x400000>;
- };
-
- partition@600000 {
- label = "kernel";
- reg = <0x600000 0x400000>;
- };
-
- /* ubi partition is the result of squashing
- * next consecutive stock partitions:
- * - rootfs0 (rootfs partition for stock kernel0),
- * - rootfs1 (rootfs partition for stock failsafe kernel1),
- * - overlay (used as ubi overlay in stock fw)
- * resulting 117,5MiB space for packages.
- */
-
- partition@a00000 {
- label = "ubi";
- reg = <0xa00000 0x7580000>;
+ nand@0 {
+ reg = <0>;
+ partitions {
+ compatible = "fixed-partitions";
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ partition@0 {
+ label = "Bootloader";
+ reg = <0x0 0x80000>;
+ read-only;
+ };
+
+ partition@80000 {
+ label = "Config";
+ reg = <0x80000 0x40000>;
+ };
+
+ partition@c0000 {
+ label = "Bdata";
+ reg = <0xc0000 0x40000>;
+ read-only;
+ };
+
+ factory: partition@100000 {
+ label = "factory";
+ reg = <0x100000 0x40000>;
+ read-only;
+ };
+
+ partition@140000 {
+ label = "crash";
+ reg = <0x140000 0x40000>;
+ };
+
+ partition@180000 {
+ label = "crash_syslog";
+ reg = <0x180000 0x40000>;
+ };
+
+ partition@1c0000 {
+ label = "reserved0";
+ reg = <0x1c0000 0x40000>;
+ read-only;
+ };
+
+ /* uboot expects to find kernels at 0x200000 & 0x600000
+ * referred to as system 1 & system 2 respectively.
+ * a kernel is considered suitable for handing control over
+ * if its linux magic number exists & uImage CRC are correct.
+ * If either of those conditions fail, a matching sys'n'_fail flag
+ * is set in uboot env & a restart performed in the hope that the
+ * alternate kernel is okay.
+ * if neither kernel checksums ok and both are marked failed, system 2
+ * is booted anyway.
+ *
+ * Note uboot's tftp flash install writes the transferred
+ * image to both kernel partitions.
+ */
+
+ partition@200000 {
+ label = "kernel_stock";
+ reg = <0x200000 0x400000>;
+ };
+
+ partition@600000 {
+ label = "kernel";
+ reg = <0x600000 0x400000>;
+ };
+
+ /* ubi partition is the result of squashing
+ * next consecutive stock partitions:
+ * - rootfs0 (rootfs partition for stock kernel0),
+ * - rootfs1 (rootfs partition for stock failsafe kernel1),
+ * - overlay (used as ubi overlay in stock fw)
+ * resulting 117,5MiB space for packages.
+ */
+
+ partition@a00000 {
+ label = "ubi";
+ reg = <0xa00000 0x7580000>;
+ };
};
};
};
&nand {
status = "okay";
- partitions {
- compatible = "fixed-partitions";
- #address-cells = <1>;
- #size-cells = <1>;
-
- partition@0 {
- label = "Bootloader";
- reg = <0x0 0x40000>;
- read-only;
- };
-
- partition@40000 {
- label = "Config";
- reg = <0x40000 0x40000>;
- };
-
- partition@80000 {
- label = "Bdata";
- reg = <0x80000 0x40000>;
- read-only;
- };
-
- factory: partition@c0000 {
- label = "factory";
- reg = <0x0c0000 0x40000>;
- read-only;
- };
-
- partition@100000 {
- label = "crash";
- reg = <0x100000 0x40000>;
- };
-
- partition@140000 {
- label = "crash_syslog";
- reg = <0x140000 0x80000>;
- };
-
- partition@1c0000 {
- label = "reserved0";
- reg = <0x1c0000 0x40000>;
- read-only;
- };
-
- /* We keep stock xiaomi firmware (kernel0) here */
- partition@200000 {
- label = "kernel_stock";
- reg = <0x200000 0x400000>;
- };
-
- partition@600000 {
- label = "kernel";
- reg = <0x600000 0x400000>;
- };
-
- partition@a00000 {
- label = "ubi";
- reg = <0xa00000 0xf580000>;
+ nand@0 {
+ reg = <0>;
+ partitions {
+ compatible = "fixed-partitions";
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ partition@0 {
+ label = "Bootloader";
+ reg = <0x0 0x40000>;
+ read-only;
+ };
+
+ partition@40000 {
+ label = "Config";
+ reg = <0x40000 0x40000>;
+ };
+
+ partition@80000 {
+ label = "Bdata";
+ reg = <0x80000 0x40000>;
+ read-only;
+ };
+
+ factory: partition@c0000 {
+ label = "factory";
+ reg = <0x0c0000 0x40000>;
+ read-only;
+ };
+
+ partition@100000 {
+ label = "crash";
+ reg = <0x100000 0x40000>;
+ };
+
+ partition@140000 {
+ label = "crash_syslog";
+ reg = <0x140000 0x80000>;
+ };
+
+ partition@1c0000 {
+ label = "reserved0";
+ reg = <0x1c0000 0x40000>;
+ read-only;
+ };
+
+ /* We keep stock xiaomi firmware (kernel0) here */
+ partition@200000 {
+ label = "kernel_stock";
+ reg = <0x200000 0x400000>;
+ };
+
+ partition@600000 {
+ label = "kernel";
+ reg = <0x600000 0x400000>;
+ };
+
+ partition@a00000 {
+ label = "ubi";
+ reg = <0xa00000 0xf580000>;
+ };
};
};
};
+ }
+#endif
+
-+ nand_set_flash_node(nand_chip, pdev->dev.of_node);
++ nand_set_flash_node(nand_chip, of_get_next_available_child(pdev->dev.of_node, NULL));
+ err = mtd_device_parse_register(mtd, probe_types, &ppdata,
+ NULL, 0);
+ if (!err) {