Changeset 44557


Ignore:
Timestamp:
2015-02-27T18:38:25+01:00 (3 years ago)
Author:
jogo
Message:

package: mtd: move bcm963xx_tag definition into source code

Remove the need for the header file to be exported - we don't need most
of it anyway; all we care about are the offset of the rootfs length and
header crc fields.

Signed-off-by: Jonas Gorski <jogo@…>

Location:
trunk
Files:
7 deleted
16 edited

Legend:

Unmodified
Added
Removed
  • trunk/package/system/mtd/src/imagetag.c

    r37007 r44557  
    3333#include <sys/ioctl.h> 
    3434#include <mtd/mtd-user.h> 
    35 #include <linux/bcm963xx_tag.h> 
    3635 
    3736#include "mtd.h" 
    3837#include "crc32.h" 
    3938 
     39#define TAGVER_LEN              4       /* Length of Tag Version */ 
     40#define TAGLAYOUT_LEN           4       /* Length of FlashLayoutVer */ 
     41#define SIG1_LEN                20      /* Company Signature 1 Length */ 
     42#define SIG2_LEN                14      /* Company Signature 2 Length */ 
     43#define BOARDID_LEN             16      /* Length of BoardId */ 
     44#define ENDIANFLAG_LEN          2       /* Endian Flag Length */ 
     45#define CHIPID_LEN              6       /* Chip Id Length */ 
     46#define IMAGE_LEN               10      /* Length of Length Field */ 
     47#define ADDRESS_LEN             12      /* Length of Address field */ 
     48#define DUALFLAG_LEN            2       /* Dual Image flag Length */ 
     49#define INACTIVEFLAG_LEN        2       /* Inactie Flag Length */ 
     50#define RSASIG_LEN              20      /* Length of RSA Signature in tag */ 
     51#define TAGINFO1_LEN            30      /* Length of vendor information field1 in tag */ 
     52#define FLASHLAYOUTVER_LEN      4       /* Length of Flash Layout Version String tag */ 
     53#define TAGINFO2_LEN            16      /* Length of vendor information field2 in tag */ 
     54#define ALTTAGINFO_LEN          54      /* Alternate length for vendor information; Pirelli */ 
     55 
     56#define NUM_PIRELLI             2 
     57#define IMAGETAG_CRC_START      0xFFFFFFFF 
     58 
     59#define PIRELLI_BOARDS { \ 
     60        "AGPF-S0", \ 
     61        "DWV-S0", \ 
     62} 
     63/* 
     64 * The broadcom firmware assumes the rootfs starts the image, 
     65 * therefore uses the rootfs start (flash_image_address) 
     66 * to determine where to flash the image.  Since we have the kernel first 
     67 * we have to give it the kernel address, but the crc uses the length 
     68 * associated with this address (root_length), which is added to the kernel 
     69 * length (kernel_length) to determine the length of image to flash and thus 
     70 * needs to be rootfs + deadcode (jffs2 EOF marker) 
     71*/ 
     72 
     73struct bcm_tag { 
     74        /* 0-3: Version of the image tag */ 
     75        char tag_version[TAGVER_LEN]; 
     76        /* 4-23: Company Line 1 */ 
     77        char sig_1[SIG1_LEN]; 
     78        /*  24-37: Company Line 2 */ 
     79        char sig_2[SIG2_LEN]; 
     80        /* 38-43: Chip this image is for */ 
     81        char chip_id[CHIPID_LEN]; 
     82        /* 44-59: Board name */ 
     83        char board_id[BOARDID_LEN]; 
     84        /* 60-61: Map endianness -- 1 BE 0 LE */ 
     85        char big_endian[ENDIANFLAG_LEN]; 
     86        /* 62-71: Total length of image */ 
     87        char total_length[IMAGE_LEN]; 
     88        /* 72-83: Address in memory of CFE */ 
     89        char cfe__address[ADDRESS_LEN]; 
     90        /* 84-93: Size of CFE */ 
     91        char cfe_length[IMAGE_LEN]; 
     92        /* 94-105: Address in memory of image start 
     93         * (kernel for OpenWRT, rootfs for stock firmware) 
     94         */ 
     95        char flash_image_start[ADDRESS_LEN]; 
     96        /* 106-115: Size of rootfs */ 
     97        char root_length[IMAGE_LEN]; 
     98        /* 116-127: Address in memory of kernel */ 
     99        char kernel_address[ADDRESS_LEN]; 
     100        /* 128-137: Size of kernel */ 
     101        char kernel_length[IMAGE_LEN]; 
     102        /* 138-139: Unused at the moment */ 
     103        char dual_image[DUALFLAG_LEN]; 
     104        /* 140-141: Unused at the moment */ 
     105        char inactive_flag[INACTIVEFLAG_LEN]; 
     106        /* 142-161: RSA Signature (not used; some vendors may use this) */ 
     107        char rsa_signature[RSASIG_LEN]; 
     108        /* 162-191: Compilation and related information (not used in OpenWrt) */ 
     109        char information1[TAGINFO1_LEN]; 
     110        /* 192-195: Version flash layout */ 
     111        char flash_layout_ver[FLASHLAYOUTVER_LEN]; 
     112        /* 196-199: kernel+rootfs CRC32 */ 
     113        __u32 fskernel_crc; 
     114        /* 200-215: Unused except on Alice Gate where is is information */ 
     115        char information2[TAGINFO2_LEN]; 
     116        /* 216-219: CRC32 of image less imagetag (kernel for Alice Gate) */ 
     117        __u32 image_crc; 
     118        /* 220-223: CRC32 of rootfs partition */ 
     119        __u32 rootfs_crc; 
     120        /* 224-227: CRC32 of kernel partition */ 
     121        __u32 kernel_crc; 
     122        /* 228-231: Image sequence number */ 
     123        char image_sequence[4]; 
     124        /* 222-235: Openwrt: real rootfs length */ 
     125        __u32 real_rootfs_length; 
     126        /* 236-239: CRC32 of header excluding last 20 bytes */ 
     127        __u32 header_crc; 
     128        /* 240-255: Unused at present */ 
     129        char reserved2[16]; 
     130}; 
    40131ssize_t pread(int fd, void *buf, size_t count, off_t offset); 
    41132ssize_t pwrite(int fd, const void *buf, size_t count, off_t offset); 
  • trunk/target/linux/brcm63xx/patches-3.14/030-MIPS-Always-use-IRQ-domains-for-CPU-IRQs.patch

    r43454 r44557  
    3030--- a/arch/mips/Kconfig 
    3131+++ b/arch/mips/Kconfig 
    32 @@ -1025,6 +1025,7 @@ config MIPS_HUGE_TLB_SUPPORT 
     32@@ -1026,6 +1026,7 @@ config MIPS_HUGE_TLB_SUPPORT 
    3333  
    3434 config IRQ_CPU 
     
    4040--- a/arch/mips/kernel/irq_cpu.c 
    4141+++ b/arch/mips/kernel/irq_cpu.c 
    42 @@ -94,28 +94,6 @@ static struct irq_chip mips_mt_cpu_irq_c 
    43         .irq_eoi        = unmask_mips_irq, 
     42@@ -98,28 +98,6 @@ static struct irq_chip mips_mt_cpu_irq_c 
     43        .irq_enable     = unmask_mips_irq, 
    4444 }; 
    4545  
     
    6969                             irq_hw_number_t hw) 
    7070 { 
    71 @@ -138,8 +116,7 @@ static const struct irq_domain_ops mips_ 
     71@@ -142,8 +120,7 @@ static const struct irq_domain_ops mips_ 
    7272        .xlate = irq_domain_xlate_onecell, 
    7373 }; 
     
    7979        struct irq_domain *domain; 
    8080  
    81 @@ -151,7 +128,16 @@ int __init mips_cpu_intc_init(struct dev 
     81@@ -155,7 +132,16 @@ int __init mips_cpu_intc_init(struct dev 
    8282                                       &mips_cpu_intc_irq_domain_ops, NULL); 
    8383        if (!domain) 
  • trunk/target/linux/brcm63xx/patches-3.14/031-MIPS-Rename-mips_cpu_intc_init-mips_cpu_irq_of_init.patch

    r43454 r44557  
    6666--- a/arch/mips/kernel/irq_cpu.c 
    6767+++ b/arch/mips/kernel/irq_cpu.c 
    68 @@ -135,8 +135,8 @@ void __init mips_cpu_irq_init(void) 
     68@@ -139,8 +139,8 @@ void __init mips_cpu_irq_init(void) 
    6969        __mips_cpu_irq_init(NULL); 
    7070 } 
  • trunk/target/linux/brcm63xx/patches-3.14/032-MIPS-Provide-a-generic-plat_irq_dispatch.patch

    r43454 r44557  
    3232--- a/arch/mips/kernel/irq_cpu.c 
    3333+++ b/arch/mips/kernel/irq_cpu.c 
    34 @@ -94,6 +94,24 @@ static struct irq_chip mips_mt_cpu_irq_c 
    35         .irq_eoi        = unmask_mips_irq, 
     34@@ -98,6 +98,24 @@ static struct irq_chip mips_mt_cpu_irq_c 
     35        .irq_enable     = unmask_mips_irq, 
    3636 }; 
    3737  
  • trunk/target/linux/brcm63xx/patches-3.14/311-bcm63xxpart_use_cfedetection.patch

    r43454 r44557  
    44  
    55 #include <asm/mach-bcm63xx/bcm63xx_nvram.h> 
    6  #include <linux/bcm963xx_tag.h> 
     6 #include <asm/mach-bcm63xx/bcm963xx_tag.h> 
    77-#include <asm/mach-bcm63xx/board_bcm963xx.h> 
    88+#include <asm/mach-bcm63xx/bcm63xx_board.h> 
  • trunk/target/linux/brcm63xx/patches-3.14/320-irqchip-add-support-for-bcm6345-style-periphery-irq-.patch

    r43578 r44557  
    9595--- /dev/null 
    9696+++ b/drivers/irqchip/irq-bcm6345-periph.c 
    97 @@ -0,0 +1,340 @@ 
     97@@ -0,0 +1,341 @@ 
    9898+/* 
    9999+ * This file is subject to the terms and conditions of the GNU General Public 
     
    247247+       struct intc_data *priv = data->domain->host_data; 
    248248+       unsigned int i, reg, bit; 
     249+       unsigned long flags; 
    249250+       bool enabled; 
    250251+       int cpu; 
     
    266267+               return -EINVAL; 
    267268+ 
    268 +       raw_spin_lock(&priv->lock); 
     269+       raw_spin_lock_irqsave(&priv->lock, flags); 
    269270+       enabled = !irqd_irq_masked(data); 
    270271+       for (i = 0; i < MAX_PARENT_IRQS; i++) { 
     
    282283+               } 
    283284+       } 
    284 +       raw_spin_unlock(&priv->lock); 
     285+       raw_spin_unlock_irqrestore(&priv->lock, flags); 
    285286+ 
    286287+       return 0; 
     
    455456+ 
    456457+#endif /* __INCLUDE_LINUX_IRQCHIP_IRQ_BCM6345_PERIPH_H */ 
    457 diff --git a/drivers/irqchip/irq-bcm6345-periph.c b/drivers/irqchip/irq-bcm6345-periph.c 
    458 index dfab88e..b280164 100644 
    459 --- a/drivers/irqchip/irq-bcm6345-periph.c 
    460 +++ b/drivers/irqchip/irq-bcm6345-periph.c 
    461 @@ -149,6 +149,7 @@ static int bcm6345_periph_set_affinity(struct irq_data *data, 
    462         irq_hw_number_t hwirq = irqd_to_hwirq(data); 
    463         struct intc_data *priv = data->domain->host_data; 
    464         unsigned int i, reg, bit; 
    465 +       unsigned long flags; 
    466         bool enabled; 
    467         int cpu; 
    468   
    469 @@ -168,7 +169,7 @@ static int bcm6345_periph_set_affinity(struct irq_data *data, 
    470         if (!priv->block[cpu].parent_irq) 
    471                 return -EINVAL; 
    472   
    473 -       raw_spin_lock(&priv->lock); 
    474 +       raw_spin_lock_irqsave(&priv->lock, flags); 
    475         enabled = !irqd_irq_masked(data); 
    476         for (i = 0; i < MAX_PARENT_IRQS; i++) { 
    477                 struct intc_block *block = &priv->block[i]; 
    478 @@ -184,7 +185,7 @@ static int bcm6345_periph_set_affinity(struct irq_data *data, 
    479                         __bcm6345_periph_enable(block, reg, bit, false); 
    480                 } 
    481         } 
    482 -       raw_spin_unlock(&priv->lock); 
    483 +       raw_spin_unlock_irqrestore(&priv->lock, flags); 
    484   
    485         return 0; 
    486  } 
  • trunk/target/linux/brcm63xx/patches-3.14/401-bcm963xx_real_rootfs_length.patch

    r40380 r44557  
    1 --- a/include/uapi/linux/bcm963xx_tag.h 
    2 +++ b/include/uapi/linux/bcm963xx_tag.h 
     1--- a/arch/mips/include/asm/mach-bcm63xx/bcm963xx_tag.h 
     2+++ b/arch/mips/include/asm/mach-bcm63xx/bcm963xx_tag.h 
    33@@ -85,8 +85,10 @@ struct bcm_tag { 
    44        __u32 rootfs_crc; 
  • trunk/target/linux/brcm63xx/patches-3.14/425-bcm63xxpart_parse_paritions_from_dt.patch

    r42123 r44557  
    88  
    99 #include <asm/mach-bcm63xx/bcm63xx_nvram.h> 
    10  #include <linux/bcm963xx_tag.h> 
     10 #include <asm/mach-bcm63xx/bcm963xx_tag.h> 
    1111@@ -43,66 +44,35 @@ 
    1212  
  • trunk/target/linux/brcm63xx/patches-3.18/030-MIPS-Always-use-IRQ-domains-for-CPU-IRQs.patch

    r43461 r44557  
    4040--- a/arch/mips/kernel/irq_cpu.c 
    4141+++ b/arch/mips/kernel/irq_cpu.c 
    42 @@ -94,28 +94,6 @@ static struct irq_chip mips_mt_cpu_irq_c 
    43         .irq_eoi        = unmask_mips_irq, 
     42@@ -98,28 +98,6 @@ static struct irq_chip mips_mt_cpu_irq_c 
     43        .irq_enable     = unmask_mips_irq, 
    4444 }; 
    4545  
     
    6969                             irq_hw_number_t hw) 
    7070 { 
    71 @@ -138,8 +116,7 @@ static const struct irq_domain_ops mips_ 
     71@@ -142,8 +120,7 @@ static const struct irq_domain_ops mips_ 
    7272        .xlate = irq_domain_xlate_onecell, 
    7373 }; 
     
    7979        struct irq_domain *domain; 
    8080  
    81 @@ -151,7 +128,16 @@ int __init mips_cpu_intc_init(struct dev 
     81@@ -155,7 +132,16 @@ int __init mips_cpu_intc_init(struct dev 
    8282                                       &mips_cpu_intc_irq_domain_ops, NULL); 
    8383        if (!domain) 
  • trunk/target/linux/brcm63xx/patches-3.18/031-MIPS-Rename-mips_cpu_intc_init-mips_cpu_irq_of_init.patch

    r43461 r44557  
    6666--- a/arch/mips/kernel/irq_cpu.c 
    6767+++ b/arch/mips/kernel/irq_cpu.c 
    68 @@ -135,8 +135,8 @@ void __init mips_cpu_irq_init(void) 
     68@@ -139,8 +139,8 @@ void __init mips_cpu_irq_init(void) 
    6969        __mips_cpu_irq_init(NULL); 
    7070 } 
  • trunk/target/linux/brcm63xx/patches-3.18/032-MIPS-Provide-a-generic-plat_irq_dispatch.patch

    r43461 r44557  
    3232--- a/arch/mips/kernel/irq_cpu.c 
    3333+++ b/arch/mips/kernel/irq_cpu.c 
    34 @@ -94,6 +94,24 @@ static struct irq_chip mips_mt_cpu_irq_c 
    35         .irq_eoi        = unmask_mips_irq, 
     34@@ -98,6 +98,24 @@ static struct irq_chip mips_mt_cpu_irq_c 
     35        .irq_enable     = unmask_mips_irq, 
    3636 }; 
    3737  
  • trunk/target/linux/brcm63xx/patches-3.18/311-bcm63xxpart_use_cfedetection.patch

    r43461 r44557  
    44  
    55 #include <asm/mach-bcm63xx/bcm63xx_nvram.h> 
    6  #include <linux/bcm963xx_tag.h> 
     6 #include <asm/mach-bcm63xx/bcm963xx_tag.h> 
    77-#include <asm/mach-bcm63xx/board_bcm963xx.h> 
    88+#include <asm/mach-bcm63xx/bcm63xx_board.h> 
  • trunk/target/linux/brcm63xx/patches-3.18/401-bcm963xx_real_rootfs_length.patch

    r43461 r44557  
    1 --- a/include/uapi/linux/bcm963xx_tag.h 
    2 +++ b/include/uapi/linux/bcm963xx_tag.h 
     1--- a/arch/mips/include/asm/mach-bcm63xx/bcm963xx_tag.h 
     2+++ b/arch/mips/include/asm/mach-bcm63xx/bcm963xx_tag.h 
    33@@ -85,8 +85,10 @@ struct bcm_tag { 
    44        __u32 rootfs_crc; 
  • trunk/target/linux/brcm63xx/patches-3.18/425-bcm63xxpart_parse_paritions_from_dt.patch

    r43461 r44557  
    88  
    99 #include <asm/mach-bcm63xx/bcm63xx_nvram.h> 
    10  #include <linux/bcm963xx_tag.h> 
     10 #include <asm/mach-bcm63xx/bcm963xx_tag.h> 
    1111@@ -43,66 +44,35 @@ 
    1212  
  • trunk/target/linux/generic/patches-3.14/700-swconfig.patch

    r39348 r44557  
    3030--- a/include/uapi/linux/Kbuild 
    3131+++ b/include/uapi/linux/Kbuild 
    32 @@ -366,6 +366,7 @@ header-y += stddef.h 
     32@@ -365,6 +365,7 @@ header-y += stddef.h 
    3333 header-y += string.h 
    3434 header-y += suspend_ioctls.h 
  • trunk/target/linux/generic/patches-3.18/700-swconfig.patch

    r43357 r44557  
    3030--- a/include/uapi/linux/Kbuild 
    3131+++ b/include/uapi/linux/Kbuild 
    32 @@ -375,6 +375,7 @@ header-y += stddef.h 
     32@@ -374,6 +374,7 @@ header-y += stddef.h 
    3333 header-y += string.h 
    3434 header-y += suspend_ioctls.h 
Note: See TracChangeset for help on using the changeset viewer.