Changeset 38002


Ignore:
Timestamp:
2013-09-15T19:03:29+02:00 (4 years ago)
Author:
juhosg
Message:

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@…>

Location:
trunk/target/linux
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/target/linux/ar71xx/config-3.10

    r37703 r38002  
    208208CONFIG_MTD_REDBOOT_DIRECTORY_BLOCK=-2 
    209209CONFIG_MTD_REDBOOT_PARTS=y 
     210CONFIG_MTD_SPLIT_FIRMWARE=y 
    210211CONFIG_MTD_TPLINK_PARTS=y 
    211212CONFIG_MTD_UIMAGE_SPLIT=y 
  • trunk/target/linux/generic/config-3.10

    r37897 r38002  
    19321932CONFIG_MTD_ROOTFS_SPLIT=y 
    19331933# CONFIG_MTD_SLRAM is not set 
     1934# CONFIG_MTD_SPLIT_FIRMWARE is not set 
     1935CONFIG_MTD_SPLIT_FIRMWARE_NAME="firmware" 
    19341936# CONFIG_MTD_SST25L is not set 
    19351937# CONFIG_MTD_SWAP is not set 
     
    19371939# CONFIG_MTD_UBI is not set 
    19381940# CONFIG_MTD_UIMAGE_SPLIT is not set 
    1939 CONFIG_MTD_UIMAGE_SPLIT_NAME="firmware" 
    19401941# CONFIG_MUTEX_SPIN_ON_OWNER is not set 
    19411942# CONFIG_MV643XX_ETH is not set 
  • trunk/target/linux/generic/patches-3.10/400-mtd-add-rootfs-split-support.patch

    r37997 r38002  
    11--- a/drivers/mtd/Kconfig 
    22+++ b/drivers/mtd/Kconfig 
    3 @@ -12,6 +12,27 @@ menuconfig MTD 
     3@@ -12,6 +12,32 @@ menuconfig MTD 
    44  
    55 if MTD 
     
    1515+       default y 
    1616+ 
     17+config MTD_SPLIT_FIRMWARE 
     18+       bool "Automatically split firmware partition for kernel+rootfs" 
     19+       default y 
     20+ 
     21+config MTD_SPLIT_FIRMWARE_NAME 
     22+       string "Firmware partition name" 
     23+       depends on MTD_SPLIT_FIRMWARE 
     24+       default "firmware" 
     25+ 
    1726+config MTD_UIMAGE_SPLIT 
    18 +       bool "Automatically split off rootfs from a kernel partition containing a uImage" 
    19 +       default y 
    20 + 
    21 +config MTD_UIMAGE_SPLIT_NAME 
    22 +       string "uImage partition name" 
    23 +       depends on MTD_UIMAGE_SPLIT 
    24 +       default "firmware" 
     27+       bool "Enable split support for firmware partitions containing a uImage" 
     28+       depends on MTD_SPLIT_FIRMWARE 
     29+       default y 
    2530+ 
    2631+endmenu 
     
    117122 { 
    118123        struct mtd_part *slave, *next; 
    119 @@ -613,6 +627,148 @@ int mtd_del_partition(struct mtd_info *m 
     124@@ -613,6 +627,151 @@ int mtd_del_partition(struct mtd_info *m 
    120125 } 
    121126 EXPORT_SYMBOL_GPL(mtd_del_partition); 
     
    196201+ 
    197202+#define UBOOT_MAGIC    0x27051956 
    198 + 
    199 +#ifdef CONFIG_MTD_UIMAGE_SPLIT_NAME 
    200 +#define UIMAGE_SPLIT_NAME      CONFIG_MTD_UIMAGE_SPLIT_NAME 
    201 +#else 
    202 +#define UIMAGE_SPLIT_NAME      "unused" 
    203 +#endif 
    204203+ 
    205204+static void split_uimage(struct mtd_info *master, struct mtd_part *part) 
     
    212211+       size_t len; 
    213212+ 
    214 +       if (strcmp(part->mtd.name, UIMAGE_SPLIT_NAME) != 0) 
    215 +               return; 
    216 + 
    217213+       if (mtd_read(master, part->offset, sizeof(hdr), &len, (void *) &hdr)) 
    218214+               return; 
     
    230226+} 
    231227+ 
     228+#ifdef CONFIG_MTD_SPLIT_FIRMWARE_NAME 
     229+#define SPLIT_FIRMWARE_NAME    CONFIG_MTD_SPLIT_FIRMWARE_NAME 
     230+#else 
     231+#define SPLIT_FIRMWARE_NAME    "unused" 
     232+#endif 
     233+ 
     234+static void split_firmware(struct mtd_info *master, struct mtd_part *part) 
     235+{ 
     236+       if (config_enabled(CONFIG_MTD_UIMAGE_SPLIT)) 
     237+               split_uimage(master, part); 
     238+} 
     239+ 
    232240+void __weak arch_split_mtd_part(struct mtd_info *master, const char *name, 
    233241+                                int offset, int size) 
    234242+{ 
    235243+} 
    236 + 
    237244+ 
    238245+static void mtd_partition_split(struct mtd_info *master, struct mtd_part *part) 
     
    257264+       } 
    258265+ 
    259 +       if (config_enabled(CONFIG_MTD_UIMAGE_SPLIT)) 
    260 +               split_uimage(master, part); 
     266+       if (!strcmp(part->mtd.name, SPLIT_FIRMWARE_NAME) && 
     267+           config_enabled(CONFIG_MTD_SPLIT_FIRMWARE)) 
     268+               split_firmware(master, part); 
    261269+ 
    262270+       arch_split_mtd_part(master, part->mtd.name, part->offset, 
     
    266274  * This function, given a master MTD object and a partition table, creates 
    267275  * and registers slave MTD objects which are bound to the master according to 
    268 @@ -642,6 +798,7 @@ int add_mtd_partitions(struct mtd_info * 
     276@@ -642,6 +801,7 @@ int add_mtd_partitions(struct mtd_info * 
    269277                mutex_unlock(&mtd_partitions_mutex); 
    270278  
  • trunk/target/linux/generic/patches-3.10/430-mtd-add-myloader-partition-parser.patch

    r38000 r38002  
    11--- a/drivers/mtd/Kconfig 
    22+++ b/drivers/mtd/Kconfig 
    3 @@ -176,6 +176,22 @@ config MTD_BCM47XX_PARTS 
     3@@ -181,6 +181,22 @@ config MTD_BCM47XX_PARTS 
    44          This provides partitions parser for devices based on BCM47xx 
    55          boards. 
  • trunk/target/linux/lantiq/config-default

    r37086 r38002  
    106106CONFIG_MTD_OF_PARTS=y 
    107107CONFIG_MTD_PHYSMAP_OF=y 
     108CONFIG_MTD_SPLIT_FIRMWARE=y 
    108109CONFIG_MTD_UIMAGE_SPLIT=y 
    109110CONFIG_NEED_DMA_MAP_STATE=y 
  • trunk/target/linux/ramips/mt7620a/config-3.10

    r37778 r38002  
    110110CONFIG_MTD_PHYSMAP=y 
    111111CONFIG_MTD_PHYSMAP_OF=y 
     112CONFIG_MTD_SPLIT_FIRMWARE=y 
    112113CONFIG_MTD_UIMAGE_SPLIT=y 
    113114CONFIG_NEED_DMA_MAP_STATE=y 
  • trunk/target/linux/ramips/rt288x/config-3.10

    r37778 r38002  
    9898CONFIG_MTD_PHYSMAP=y 
    9999CONFIG_MTD_PHYSMAP_OF=y 
     100CONFIG_MTD_SPLIT_FIRMWARE=y 
    100101CONFIG_MTD_UIMAGE_SPLIT=y 
    101102CONFIG_NEED_DMA_MAP_STATE=y 
  • trunk/target/linux/ramips/rt305x/config-3.10

    r37778 r38002  
    101101CONFIG_MTD_PHYSMAP=y 
    102102CONFIG_MTD_PHYSMAP_OF=y 
     103CONFIG_MTD_SPLIT_FIRMWARE=y 
    103104CONFIG_MTD_UIMAGE_SPLIT=y 
    104105CONFIG_NEED_DMA_MAP_STATE=y 
  • trunk/target/linux/ramips/rt3883/config-3.10

    r37778 r38002  
    101101CONFIG_MTD_PHYSMAP=y 
    102102CONFIG_MTD_PHYSMAP_OF=y 
     103CONFIG_MTD_SPLIT_FIRMWARE=y 
    103104CONFIG_MTD_UIMAGE_SPLIT=y 
    104105CONFIG_NEED_DMA_MAP_STATE=y 
Note: See TracChangeset for help on using the changeset viewer.