summaryrefslogtreecommitdiff
path: root/target/linux/generic/patches-3.10
diff options
context:
space:
mode:
authorGabor Juhos <juhosg@openwrt.org>2013-09-15 17:03:29 +0000
committerGabor Juhos <juhosg@openwrt.org>2013-09-15 17:03:29 +0000
commita0d6cd4f492541290bfbe22092cead7ab7babdbf (patch)
tree1bcb7bf28948ae44bbea70694332736b3ce35540 /target/linux/generic/patches-3.10
parent86405f2c4c4697171c0d8627a979889d03043aee (diff)
downloadmtk-20170518-a0d6cd4f492541290bfbe22092cead7ab7babdbf.zip
mtk-20170518-a0d6cd4f492541290bfbe22092cead7ab7babdbf.tar.gz
mtk-20170518-a0d6cd4f492541290bfbe22092cead7ab7babdbf.tar.bz2
kernel/3.10: add new Kconfig option for firmware partition split
Add a new kernel config option for generic firmware partition split support and change the uImage split support to depend on the new option. Aslo rename the MTD_UIMAGE_SPLIT_NAME option to MTD_SPLIT_FIRMWARE_NAME to make it more generic. The patch is in preparation for multiple firmware format support. Signed-off-by: Gabor Juhos <juhosg@openwrt.org> SVN-Revision: 38002
Diffstat (limited to 'target/linux/generic/patches-3.10')
-rw-r--r--target/linux/generic/patches-3.10/400-mtd-add-rootfs-split-support.patch48
-rw-r--r--target/linux/generic/patches-3.10/430-mtd-add-myloader-partition-parser.patch2
2 files changed, 29 insertions, 21 deletions
diff --git a/target/linux/generic/patches-3.10/400-mtd-add-rootfs-split-support.patch b/target/linux/generic/patches-3.10/400-mtd-add-rootfs-split-support.patch
index edbb704..6a4c161 100644
--- a/target/linux/generic/patches-3.10/400-mtd-add-rootfs-split-support.patch
+++ b/target/linux/generic/patches-3.10/400-mtd-add-rootfs-split-support.patch
@@ -1,6 +1,6 @@
--- a/drivers/mtd/Kconfig
+++ b/drivers/mtd/Kconfig
-@@ -12,6 +12,27 @@ menuconfig MTD
+@@ -12,6 +12,32 @@ menuconfig MTD
if MTD
@@ -14,15 +14,20 @@
+ bool "Automatically split 'rootfs' partition for squashfs"
+ default y
+
-+config MTD_UIMAGE_SPLIT
-+ bool "Automatically split off rootfs from a kernel partition containing a uImage"
++config MTD_SPLIT_FIRMWARE
++ bool "Automatically split firmware partition for kernel+rootfs"
+ default y
+
-+config MTD_UIMAGE_SPLIT_NAME
-+ string "uImage partition name"
-+ depends on MTD_UIMAGE_SPLIT
++config MTD_SPLIT_FIRMWARE_NAME
++ string "Firmware partition name"
++ depends on MTD_SPLIT_FIRMWARE
+ default "firmware"
+
++config MTD_UIMAGE_SPLIT
++ bool "Enable split support for firmware partitions containing a uImage"
++ depends on MTD_SPLIT_FIRMWARE
++ default y
++
+endmenu
+
config MTD_TESTS
@@ -116,7 +121,7 @@
int mtd_del_partition(struct mtd_info *master, int partno)
{
struct mtd_part *slave, *next;
-@@ -613,6 +627,148 @@ int mtd_del_partition(struct mtd_info *m
+@@ -613,6 +627,151 @@ int mtd_del_partition(struct mtd_info *m
}
EXPORT_SYMBOL_GPL(mtd_del_partition);
@@ -196,12 +201,6 @@
+
+#define UBOOT_MAGIC 0x27051956
+
-+#ifdef CONFIG_MTD_UIMAGE_SPLIT_NAME
-+#define UIMAGE_SPLIT_NAME CONFIG_MTD_UIMAGE_SPLIT_NAME
-+#else
-+#define UIMAGE_SPLIT_NAME "unused"
-+#endif
-+
+static void split_uimage(struct mtd_info *master, struct mtd_part *part)
+{
+ struct {
@@ -211,9 +210,6 @@
+ } hdr;
+ size_t len;
+
-+ if (strcmp(part->mtd.name, UIMAGE_SPLIT_NAME) != 0)
-+ return;
-+
+ if (mtd_read(master, part->offset, sizeof(hdr), &len, (void *) &hdr))
+ return;
+
@@ -229,12 +225,23 @@
+ part->mtd.size - len, false);
+}
+
++#ifdef CONFIG_MTD_SPLIT_FIRMWARE_NAME
++#define SPLIT_FIRMWARE_NAME CONFIG_MTD_SPLIT_FIRMWARE_NAME
++#else
++#define SPLIT_FIRMWARE_NAME "unused"
++#endif
++
++static void split_firmware(struct mtd_info *master, struct mtd_part *part)
++{
++ if (config_enabled(CONFIG_MTD_UIMAGE_SPLIT))
++ split_uimage(master, part);
++}
++
+void __weak arch_split_mtd_part(struct mtd_info *master, const char *name,
+ int offset, int size)
+{
+}
+
-+
+static void mtd_partition_split(struct mtd_info *master, struct mtd_part *part)
+{
+ static int rootfs_found = 0;
@@ -256,8 +263,9 @@
+ split_rootfs_data(master, part);
+ }
+
-+ if (config_enabled(CONFIG_MTD_UIMAGE_SPLIT))
-+ split_uimage(master, part);
++ if (!strcmp(part->mtd.name, SPLIT_FIRMWARE_NAME) &&
++ config_enabled(CONFIG_MTD_SPLIT_FIRMWARE))
++ split_firmware(master, part);
+
+ arch_split_mtd_part(master, part->mtd.name, part->offset,
+ part->mtd.size);
@@ -265,7 +273,7 @@
/*
* This function, given a master MTD object and a partition table, creates
* and registers slave MTD objects which are bound to the master according to
-@@ -642,6 +798,7 @@ int add_mtd_partitions(struct mtd_info *
+@@ -642,6 +801,7 @@ int add_mtd_partitions(struct mtd_info *
mutex_unlock(&mtd_partitions_mutex);
add_mtd_device(&slave->mtd);
diff --git a/target/linux/generic/patches-3.10/430-mtd-add-myloader-partition-parser.patch b/target/linux/generic/patches-3.10/430-mtd-add-myloader-partition-parser.patch
index 4b61307..bca0023 100644
--- a/target/linux/generic/patches-3.10/430-mtd-add-myloader-partition-parser.patch
+++ b/target/linux/generic/patches-3.10/430-mtd-add-myloader-partition-parser.patch
@@ -1,6 +1,6 @@
--- a/drivers/mtd/Kconfig
+++ b/drivers/mtd/Kconfig
-@@ -176,6 +176,22 @@ config MTD_BCM47XX_PARTS
+@@ -181,6 +181,22 @@ config MTD_BCM47XX_PARTS
This provides partitions parser for devices based on BCM47xx
boards.