Changeset 20548


Ignore:
Timestamp:
2010-03-28T20:11:06+02:00 (7 years ago)
Author:
florian
Message:

[brcm63xx] move bcm_tag.h out of the flashmap patch so that user-land tools can re-use it

Location:
trunk
Files:
1 added
3 edited
1 copied

Legend:

Unmodified
Added
Removed
  • trunk/target/linux/brcm63xx/patches-2.6.32/040-bcm963xx_flashmap.patch

    r20204 r20548  
    474474+MODULE_AUTHOR("Florian Fainelli <florian@openwrt.org>"); 
    475475+MODULE_AUTHOR("Mike Albon <malbon@openwrt.org>"); 
    476 --- /dev/null 
    477 +++ b/arch/mips/include/asm/mach-bcm63xx/bcm_tag.h 
    478 @@ -0,0 +1,178 @@ 
    479 +#ifndef __BCM63XX_TAG_H 
    480 +#define __BCM63XX_TAG_H 
    481 + 
    482 +#define IMAGE_LEN 10                   /* Length of Length Field */ 
    483 +#define ADDRESS_LEN 12                 /* Length of Address field */ 
    484 +#define TAGID_LEN  6                   /* Length of tag ID */ 
    485 +#define TAGINFO_LEN 20                 /* Length of vendor information field in tag */ 
    486 +#define TAGVER_LEN 4                   /* Length of Tag Version */ 
    487 +#define TAGLAYOUT_LEN 4                /* Length of FlashLayoutVer */ 
    488 + 
    489 +#define NUM_TAGID 5 
    490 +#define IMAGETAG_CRC_START             0xFFFFFFFF 
    491 + 
    492 +struct tagiddesc_t { 
    493 +  char tagid[TAGID_LEN + 1]; 
    494 +  char tagiddesc[80]; 
    495 +}; 
    496 + 
    497 + // bc221 is used by BT Voyager and should be right 
    498 + // bc310 should be right, and may apply to 3.08 code as well 
    499 +#define TAGID_DEFINITIONS { \ 
    500 +  { "bccfe", "Broadcom CFE flash image" }, \ 
    501 +  { "bc300", "Broadcom code version 3.00-3.06 and all ftp/tftp flash" }, \ 
    502 +  { "ag306", "Alice Gate (Pirelli, based on Broadcom 3.06)" }, \ 
    503 +  { "bc221", "Broadcom code version 2.21" }, \ 
    504 +  { "bc310", "Broadcom code version 3.10-3.12" }, \ 
    505 +} 
    506 + 
    507 +struct bcm_tag_bccfe { 
    508 +       unsigned char tagVersion[TAGVER_LEN];           // 0-3: Version of the image tag 
    509 +       unsigned char sig_1[20];                        // 4-23: Company Line 1 
    510 +       unsigned char sig_2[14];                        // 24-37: Company Line 2 
    511 +       unsigned char chipid[6];                        // 38-43: Chip this image is for 
    512 +       unsigned char boardid[16];                      // 44-59: Board name 
    513 +       unsigned char big_endian[2];                    // 60-61: Map endianness -- 1 BE 0 LE 
    514 +       unsigned char totalLength[IMAGE_LEN];           // 62-71: Total length of image 
    515 +       unsigned char cfeAddress[ADDRESS_LEN];          // 72-83: Address in memory of CFE 
    516 +       unsigned char cfeLength[IMAGE_LEN];             // 84-93: Size of CFE 
    517 +       unsigned char rootAddress[ADDRESS_LEN];         // 94-105: Address in memory of rootfs 
    518 +       unsigned char rootLength[IMAGE_LEN];            // 106-115: Size of rootfs 
    519 +       unsigned char kernelAddress[ADDRESS_LEN];       // 116-127: Address in memory of kernel 
    520 +       unsigned char kernelLength[IMAGE_LEN];          // 128-137: Size of kernel 
    521 +       unsigned char dualImage[2];                     // 138-139: Unused at present 
    522 +       unsigned char inactiveFlag[2];                  // 140-141: Unused at present 
    523 +        unsigned char information1[TAGINFO_LEN];        // 142-161: Unused at present 
    524 +        unsigned char tagId[TAGID_LEN];                 // 162-167: Identifies which type of tag this is, currently two-letter company code, and then three digits for version of broadcom code in which this tag was first introduced 
    525 +        unsigned char tagIdCRC[4];                      // 168-171: CRC32 of tagId 
    526 +       unsigned char reserved1[44];                    // 172-215: Reserved area not in use 
    527 +       unsigned char imageCRC[4];                      // 216-219: CRC32 of images 
    528 +        unsigned char reserved2[16];                    // 220-235: Unused at present 
    529 +        unsigned char headerCRC[4];                     // 236-239: CRC32 of header excluding tagVersion 
    530 +        unsigned char reserved3[16];                    // 240-255: Unused at present 
    531 +}; 
    532 + 
    533 +struct bcm_tag_bc300 { 
    534 +       unsigned char tagVersion[TAGVER_LEN];           // 0-3: Version of the image tag 
    535 +       unsigned char sig_1[20];                        // 4-23: Company Line 1 
    536 +       unsigned char sig_2[14];                        // 24-37: Company Line 2 
    537 +       unsigned char chipid[6];                        // 38-43: Chip this image is for 
    538 +       unsigned char boardid[16];                      // 44-59: Board name 
    539 +       unsigned char big_endian[2];                    // 60-61: Map endianness -- 1 BE 0 LE 
    540 +       unsigned char totalLength[IMAGE_LEN];           // 62-71: Total length of image 
    541 +       unsigned char cfeAddress[ADDRESS_LEN];          // 72-83: Address in memory of CFE 
    542 +       unsigned char cfeLength[IMAGE_LEN];             // 84-93: Size of CFE 
    543 +       unsigned char flashImageStart[ADDRESS_LEN];     // 94-105: Address in memory of kernel (start of image) 
    544 +       unsigned char flashRootLength[IMAGE_LEN];       // 106-115: Size of rootfs + deadcode (web flash uses this + kernelLength to determine the size of the kernel+rootfs flash image) 
    545 +       unsigned char kernelAddress[ADDRESS_LEN];       // 116-127: Address in memory of kernel 
    546 +       unsigned char kernelLength[IMAGE_LEN];          // 128-137: Size of kernel 
    547 +       unsigned char dualImage[2];                     // 138-139: Unused at present 
    548 +       unsigned char inactiveFlag[2];                  // 140-141: Unused at present 
    549 +        unsigned char information1[TAGINFO_LEN];        // 142-161: Unused at present 
    550 +        unsigned char tagId[TAGID_LEN];                 // 162-167: Identifies which type of tag this is, currently two-letter company code, and then three digits for version of broadcom code in which this tag was first introduced 
    551 +        unsigned char tagIdCRC[4];                      // 168-173: CRC32 to ensure validity of tagId 
    552 +        unsigned char rootAddress[ADDRESS_LEN];         // 174-183: Address in memory of rootfs partition 
    553 +        unsigned char rootLength[IMAGE_LEN];            // 184-193: Size of rootfs partition 
    554 +       unsigned char reserved1[22];                    // 194-215: Reserved area not in use 
    555 +       unsigned char imageCRC[4];                      // 216-219: CRC32 of images 
    556 +        unsigned char reserved2[16];                    // 220-235: Unused at present 
    557 +        unsigned char headerCRC[4];                     // 236-239: CRC32 of header excluding tagVersion 
    558 +        unsigned char reserved3[16];                    // 240-255: Unused at present 
    559 +}; 
    560 + 
    561 +struct bcm_tag_ag306 { 
    562 +       unsigned char tagVersion[TAGVER_LEN];           // 0-3: Version of the image tag 
    563 +       unsigned char sig_1[20];                        // 4-23: Company Line 1 
    564 +       unsigned char sig_2[14];                        // 24-37: Company Line 2 
    565 +       unsigned char chipid[6];                        // 38-43: Chip this image is for 
    566 +       unsigned char boardid[16];                      // 44-59: Board name 
    567 +       unsigned char big_endian[2];                    // 60-61: Map endianness -- 1 BE 0 LE 
    568 +       unsigned char totalLength[IMAGE_LEN];           // 62-71: Total length of image 
    569 +       unsigned char cfeAddress[ADDRESS_LEN];          // 72-83: Address in memory of CFE 
    570 +       unsigned char cfeLength[IMAGE_LEN];             // 84-93: Size of CFE 
    571 +       unsigned char flashImageStart[ADDRESS_LEN];     // 94-105: Address in memory of kernel (start of image) 
    572 +       unsigned char flashRootLength[IMAGE_LEN];       // 106-115: Size of rootfs + deadcode (web flash uses this + kernelLength to determine the size of the kernel+rootfs flash image) 
    573 +       unsigned char kernelAddress[ADDRESS_LEN];       // 116-127: Address in memory of kernel 
    574 +       unsigned char kernelLength[IMAGE_LEN];          // 128-137: Size of kernel 
    575 +       unsigned char dualImage[2];                     // 138-139: Unused at present 
    576 +       unsigned char inactiveFlag[2];                  // 140-141: Unused at present 
    577 +        unsigned char information1[TAGINFO_LEN];        // 142-161: Unused at present 
    578 +       unsigned char information2[54];                 // 162-215: Compilation and related information (not generated/used by OpenWRT) 
    579 +       unsigned char kernelCRC[4] ;                    // 216-219: CRC32 of images 
    580 +        unsigned char rootAddress[ADDRESS_LEN];         // 220-231: Address in memory of rootfs partition 
    581 +        unsigned char tagIdCRC[4];                      // 232-235: Checksum to ensure validity of tagId 
    582 +        unsigned char headerCRC[4];                     // 236-239: CRC32 of header excluding tagVersion 
    583 +       unsigned char rootLength[IMAGE_LEN];            // 240-249: Size of rootfs 
    584 +        unsigned char tagId[TAGID_LEN];                 // 250-255: Identifies which type of tag this is, currently two-letter company code, and then three digits for version of broadcom code in which this tag was first introduced 
    585 +}; 
    586 + 
    587 +struct bcm_tag_bc221 { 
    588 +       unsigned char tagVersion[TAGVER_LEN];           // 0-3: Version of the image tag 
    589 +       unsigned char sig_1[20];                        // 4-23: Company Line 1 
    590 +       unsigned char sig_2[14];                        // 24-37: Company Line 2 
    591 +       unsigned char chipid[6];                        // 38-43: Chip this image is for 
    592 +       unsigned char boardid[16];                      // 44-59: Board name 
    593 +       unsigned char big_endian[2];                    // 60-61: Map endianness -- 1 BE 0 LE 
    594 +       unsigned char totalLength[IMAGE_LEN];           // 62-71: Total length of image 
    595 +       unsigned char cfeAddress[ADDRESS_LEN];          // 72-83: Address in memory of CFE 
    596 +       unsigned char cfeLength[IMAGE_LEN];             // 84-93: Size of CFE 
    597 +       unsigned char flashImageStart[ADDRESS_LEN];     // 94-105: Address in memory of kernel (start of image) 
    598 +       unsigned char flashRootLength[IMAGE_LEN];       // 106-115: Size of rootfs + deadcode (web flash uses this + kernelLength to determine the size of the kernel+rootfs flash image) 
    599 +       unsigned char kernelAddress[ADDRESS_LEN];       // 116-127: Address in memory of kernel 
    600 +       unsigned char kernelLength[IMAGE_LEN];          // 128-137: Size of kernel 
    601 +       unsigned char dualImage[2];                     // 138-139: Unused at present 
    602 +       unsigned char inactiveFlag[2];                  // 140-141: Unused at present 
    603 +        unsigned char rsa_signature[TAGINFO_LEN];       // 142-161: RSA Signature (unused at present; some vendors may use this) 
    604 +        unsigned char reserved5[2];                     // 162-163: Unused at present 
    605 +        unsigned char tagId[TAGID_LEN];                 // 164-169: Identifies which type of tag this is, currently two-letter company code, and then three digits for version of broadcom code in which this tag was first introduced 
    606 +        unsigned char rootAddress[ADDRESS_LEN];         // 170-181: Address in memory of rootfs partition 
    607 +        unsigned char rootLength[IMAGE_LEN];            // 182-191: Size of rootfs partition 
    608 +        unsigned char flashLayoutVer[4];                // 192-195: Version flash layout 
    609 +        unsigned char fskernelCRC[4];                   // 196-199: Guessed to be kernel CRC 
    610 +        unsigned char reserved4[16];                    // 200-215: Reserved area; unused at present 
    611 +       unsigned char imageCRC[4];                      // 216-219: CRC32 of images 
    612 +        unsigned char reserved2[12];                    // 220-231: Unused at present 
    613 +        unsigned char tagIdCRC[4];                      // 232-235: CRC32 to ensure validity of tagId 
    614 +        unsigned char headerCRC[4];                     // 236-239: CRC32 of header excluding tagVersion 
    615 +        unsigned char reserved3[16];                    // 240-255: Unused at present 
    616 +}; 
    617 + 
    618 +struct bcm_tag_bc310 { 
    619 +       unsigned char tagVersion[4];                    // 0-3: Version of the image tag 
    620 +       unsigned char sig_1[20];                        // 4-23: Company Line 1 
    621 +       unsigned char sig_2[14];                        // 24-37: Company Line 2 
    622 +       unsigned char chipid[6];                        // 38-43: Chip this image is for 
    623 +       unsigned char boardid[16];                      // 44-59: Board name 
    624 +       unsigned char big_endian[2];                    // 60-61: Map endianness -- 1 BE 0 LE 
    625 +       unsigned char totalLength[IMAGE_LEN];           // 62-71: Total length of image 
    626 +       unsigned char cfeAddress[ADDRESS_LEN];          // 72-83: Address in memory of CFE 
    627 +       unsigned char cfeLength[IMAGE_LEN];             // 84-93: Size of CFE 
    628 +       unsigned char flashImageStart[ADDRESS_LEN];     // 94-105: Address in memory of kernel (start of image) 
    629 +       unsigned char flashRootLength[IMAGE_LEN];       // 106-115: Size of rootfs + deadcode (web flash uses this + kernelLength to determine the size of the kernel+rootfs flash image) 
    630 +       unsigned char kernelAddress[ADDRESS_LEN];       // 116-127: Address in memory of kernel 
    631 +       unsigned char kernelLength[IMAGE_LEN];          // 128-137: Size of kernel 
    632 +       unsigned char dualImage[2];                     // 138-139: Unused at present 
    633 +       unsigned char inactiveFlag[2];                  // 140-141: Unused at present 
    634 +        unsigned char information1[TAGINFO_LEN];        // 142-161: Unused at present; Some vendors use this for optional information 
    635 +        unsigned char tagId[6];                         // 162-167: Identifies which type of tag this is, currently two-letter company code, and then three digits for version of broadcom code in which this tag was first introduced 
    636 +        unsigned char tagIdCRC[4];                      // 168-171: CRC32 to ensure validity of tagId 
    637 +        unsigned char rootAddress[ADDRESS_LEN];         // 172-183: Address in memory of rootfs partition 
    638 +        unsigned char rootLength[IMAGE_LEN];            // 184-193: Size of rootfs partition 
    639 +       unsigned char reserved1[22];                    // 193-215: Reserved area not in use 
    640 +       unsigned char imageCRC[4];                      // 216-219: CRC32 of images 
    641 +        unsigned char rootfsCRC[4];                     // 220-227: CRC32 of rootfs partition 
    642 +        unsigned char kernelCRC[4];                     // 224-227: CRC32 of kernel partition 
    643 +        unsigned char reserved2[8];                     // 228-235: Unused at present 
    644 +        unsigned char headerCRC[4];                     // 235-239: CRC32 of header excluding tagVersion 
    645 +        unsigned char reserved3[16];                    // 240-255: Unused at present 
    646 +}; 
    647 + 
    648 +union bcm_tag { 
    649 +  struct bcm_tag_bccfe bccfe; 
    650 +  struct bcm_tag_bc300 bc300; 
    651 +  struct bcm_tag_ag306 ag306; 
    652 +  struct bcm_tag_bc221 bc221; 
    653 +  struct bcm_tag_bc310 bc310; 
    654 +}; 
    655 + 
    656 +#endif /* __BCM63XX_TAG_H */ 
    657476--- a/arch/mips/bcm63xx/boards/board_bcm963xx.c 
    658477+++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c 
  • trunk/target/linux/brcm63xx/patches-2.6.33/040-bcm963xx_flashmap.patch

    r19921 r20548  
    474474+MODULE_AUTHOR("Florian Fainelli <florian@openwrt.org>"); 
    475475+MODULE_AUTHOR("Mike Albon <malbon@openwrt.org>"); 
    476 --- /dev/null 
    477 +++ b/arch/mips/include/asm/mach-bcm63xx/bcm_tag.h 
    478 @@ -0,0 +1,178 @@ 
    479 +#ifndef __BCM63XX_TAG_H 
    480 +#define __BCM63XX_TAG_H 
    481 + 
    482 +#define IMAGE_LEN 10                   /* Length of Length Field */ 
    483 +#define ADDRESS_LEN 12                 /* Length of Address field */ 
    484 +#define TAGID_LEN  6                   /* Length of tag ID */ 
    485 +#define TAGINFO_LEN 20                 /* Length of vendor information field in tag */ 
    486 +#define TAGVER_LEN 4                   /* Length of Tag Version */ 
    487 +#define TAGLAYOUT_LEN 4                /* Length of FlashLayoutVer */ 
    488 + 
    489 +#define NUM_TAGID 5 
    490 +#define IMAGETAG_CRC_START             0xFFFFFFFF 
    491 + 
    492 +struct tagiddesc_t { 
    493 +  char tagid[TAGID_LEN + 1]; 
    494 +  char tagiddesc[80]; 
    495 +}; 
    496 + 
    497 + // bc221 is used by BT Voyager and should be right 
    498 + // bc310 should be right, and may apply to 3.08 code as well 
    499 +#define TAGID_DEFINITIONS { \ 
    500 +  { "bccfe", "Broadcom CFE flash image" }, \ 
    501 +  { "bc300", "Broadcom code version 3.00-3.06 and all ftp/tftp flash" }, \ 
    502 +  { "ag306", "Alice Gate (Pirelli, based on Broadcom 3.06)" }, \ 
    503 +  { "bc221", "Broadcom code version 2.21" }, \ 
    504 +  { "bc310", "Broadcom code version 3.10-3.12" }, \ 
    505 +} 
    506 + 
    507 +struct bcm_tag_bccfe { 
    508 +       unsigned char tagVersion[TAGVER_LEN];           // 0-3: Version of the image tag 
    509 +       unsigned char sig_1[20];                        // 4-23: Company Line 1 
    510 +       unsigned char sig_2[14];                        // 24-37: Company Line 2 
    511 +       unsigned char chipid[6];                        // 38-43: Chip this image is for 
    512 +       unsigned char boardid[16];                      // 44-59: Board name 
    513 +       unsigned char big_endian[2];                    // 60-61: Map endianness -- 1 BE 0 LE 
    514 +       unsigned char totalLength[IMAGE_LEN];           // 62-71: Total length of image 
    515 +       unsigned char cfeAddress[ADDRESS_LEN];          // 72-83: Address in memory of CFE 
    516 +       unsigned char cfeLength[IMAGE_LEN];             // 84-93: Size of CFE 
    517 +       unsigned char rootAddress[ADDRESS_LEN];         // 94-105: Address in memory of rootfs 
    518 +       unsigned char rootLength[IMAGE_LEN];            // 106-115: Size of rootfs 
    519 +       unsigned char kernelAddress[ADDRESS_LEN];       // 116-127: Address in memory of kernel 
    520 +       unsigned char kernelLength[IMAGE_LEN];          // 128-137: Size of kernel 
    521 +       unsigned char dualImage[2];                     // 138-139: Unused at present 
    522 +       unsigned char inactiveFlag[2];                  // 140-141: Unused at present 
    523 +        unsigned char information1[TAGINFO_LEN];        // 142-161: Unused at present 
    524 +        unsigned char tagId[TAGID_LEN];                 // 162-167: Identifies which type of tag this is, currently two-letter company code, and then three digits for version of broadcom code in which this tag was first introduced 
    525 +        unsigned char tagIdCRC[4];                      // 168-171: CRC32 of tagId 
    526 +       unsigned char reserved1[44];                    // 172-215: Reserved area not in use 
    527 +       unsigned char imageCRC[4];                      // 216-219: CRC32 of images 
    528 +        unsigned char reserved2[16];                    // 220-235: Unused at present 
    529 +        unsigned char headerCRC[4];                     // 236-239: CRC32 of header excluding tagVersion 
    530 +        unsigned char reserved3[16];                    // 240-255: Unused at present 
    531 +}; 
    532 + 
    533 +struct bcm_tag_bc300 { 
    534 +       unsigned char tagVersion[TAGVER_LEN];           // 0-3: Version of the image tag 
    535 +       unsigned char sig_1[20];                        // 4-23: Company Line 1 
    536 +       unsigned char sig_2[14];                        // 24-37: Company Line 2 
    537 +       unsigned char chipid[6];                        // 38-43: Chip this image is for 
    538 +       unsigned char boardid[16];                      // 44-59: Board name 
    539 +       unsigned char big_endian[2];                    // 60-61: Map endianness -- 1 BE 0 LE 
    540 +       unsigned char totalLength[IMAGE_LEN];           // 62-71: Total length of image 
    541 +       unsigned char cfeAddress[ADDRESS_LEN];          // 72-83: Address in memory of CFE 
    542 +       unsigned char cfeLength[IMAGE_LEN];             // 84-93: Size of CFE 
    543 +       unsigned char flashImageStart[ADDRESS_LEN];     // 94-105: Address in memory of kernel (start of image) 
    544 +       unsigned char flashRootLength[IMAGE_LEN];       // 106-115: Size of rootfs + deadcode (web flash uses this + kernelLength to determine the size of the kernel+rootfs flash image) 
    545 +       unsigned char kernelAddress[ADDRESS_LEN];       // 116-127: Address in memory of kernel 
    546 +       unsigned char kernelLength[IMAGE_LEN];          // 128-137: Size of kernel 
    547 +       unsigned char dualImage[2];                     // 138-139: Unused at present 
    548 +       unsigned char inactiveFlag[2];                  // 140-141: Unused at present 
    549 +        unsigned char information1[TAGINFO_LEN];        // 142-161: Unused at present 
    550 +        unsigned char tagId[TAGID_LEN];                 // 162-167: Identifies which type of tag this is, currently two-letter company code, and then three digits for version of broadcom code in which this tag was first introduced 
    551 +        unsigned char tagIdCRC[4];                      // 168-173: CRC32 to ensure validity of tagId 
    552 +        unsigned char rootAddress[ADDRESS_LEN];         // 174-183: Address in memory of rootfs partition 
    553 +        unsigned char rootLength[IMAGE_LEN];            // 184-193: Size of rootfs partition 
    554 +       unsigned char reserved1[22];                    // 194-215: Reserved area not in use 
    555 +       unsigned char imageCRC[4];                      // 216-219: CRC32 of images 
    556 +        unsigned char reserved2[16];                    // 220-235: Unused at present 
    557 +        unsigned char headerCRC[4];                     // 236-239: CRC32 of header excluding tagVersion 
    558 +        unsigned char reserved3[16];                    // 240-255: Unused at present 
    559 +}; 
    560 + 
    561 +struct bcm_tag_ag306 { 
    562 +       unsigned char tagVersion[TAGVER_LEN];           // 0-3: Version of the image tag 
    563 +       unsigned char sig_1[20];                        // 4-23: Company Line 1 
    564 +       unsigned char sig_2[14];                        // 24-37: Company Line 2 
    565 +       unsigned char chipid[6];                        // 38-43: Chip this image is for 
    566 +       unsigned char boardid[16];                      // 44-59: Board name 
    567 +       unsigned char big_endian[2];                    // 60-61: Map endianness -- 1 BE 0 LE 
    568 +       unsigned char totalLength[IMAGE_LEN];           // 62-71: Total length of image 
    569 +       unsigned char cfeAddress[ADDRESS_LEN];          // 72-83: Address in memory of CFE 
    570 +       unsigned char cfeLength[IMAGE_LEN];             // 84-93: Size of CFE 
    571 +       unsigned char flashImageStart[ADDRESS_LEN];     // 94-105: Address in memory of kernel (start of image) 
    572 +       unsigned char flashRootLength[IMAGE_LEN];       // 106-115: Size of rootfs + deadcode (web flash uses this + kernelLength to determine the size of the kernel+rootfs flash image) 
    573 +       unsigned char kernelAddress[ADDRESS_LEN];       // 116-127: Address in memory of kernel 
    574 +       unsigned char kernelLength[IMAGE_LEN];          // 128-137: Size of kernel 
    575 +       unsigned char dualImage[2];                     // 138-139: Unused at present 
    576 +       unsigned char inactiveFlag[2];                  // 140-141: Unused at present 
    577 +        unsigned char information1[TAGINFO_LEN];        // 142-161: Unused at present 
    578 +       unsigned char information2[54];                 // 162-215: Compilation and related information (not generated/used by OpenWRT) 
    579 +       unsigned char kernelCRC[4] ;                    // 216-219: CRC32 of images 
    580 +        unsigned char rootAddress[ADDRESS_LEN];         // 220-231: Address in memory of rootfs partition 
    581 +        unsigned char tagIdCRC[4];                      // 232-235: Checksum to ensure validity of tagId 
    582 +        unsigned char headerCRC[4];                     // 236-239: CRC32 of header excluding tagVersion 
    583 +       unsigned char rootLength[IMAGE_LEN];            // 240-249: Size of rootfs 
    584 +        unsigned char tagId[TAGID_LEN];                 // 250-255: Identifies which type of tag this is, currently two-letter company code, and then three digits for version of broadcom code in which this tag was first introduced 
    585 +}; 
    586 + 
    587 +struct bcm_tag_bc221 { 
    588 +       unsigned char tagVersion[TAGVER_LEN];           // 0-3: Version of the image tag 
    589 +       unsigned char sig_1[20];                        // 4-23: Company Line 1 
    590 +       unsigned char sig_2[14];                        // 24-37: Company Line 2 
    591 +       unsigned char chipid[6];                        // 38-43: Chip this image is for 
    592 +       unsigned char boardid[16];                      // 44-59: Board name 
    593 +       unsigned char big_endian[2];                    // 60-61: Map endianness -- 1 BE 0 LE 
    594 +       unsigned char totalLength[IMAGE_LEN];           // 62-71: Total length of image 
    595 +       unsigned char cfeAddress[ADDRESS_LEN];          // 72-83: Address in memory of CFE 
    596 +       unsigned char cfeLength[IMAGE_LEN];             // 84-93: Size of CFE 
    597 +       unsigned char flashImageStart[ADDRESS_LEN];     // 94-105: Address in memory of kernel (start of image) 
    598 +       unsigned char flashRootLength[IMAGE_LEN];       // 106-115: Size of rootfs + deadcode (web flash uses this + kernelLength to determine the size of the kernel+rootfs flash image) 
    599 +       unsigned char kernelAddress[ADDRESS_LEN];       // 116-127: Address in memory of kernel 
    600 +       unsigned char kernelLength[IMAGE_LEN];          // 128-137: Size of kernel 
    601 +       unsigned char dualImage[2];                     // 138-139: Unused at present 
    602 +       unsigned char inactiveFlag[2];                  // 140-141: Unused at present 
    603 +        unsigned char rsa_signature[TAGINFO_LEN];       // 142-161: RSA Signature (unused at present; some vendors may use this) 
    604 +        unsigned char reserved5[2];                     // 162-163: Unused at present 
    605 +        unsigned char tagId[TAGID_LEN];                 // 164-169: Identifies which type of tag this is, currently two-letter company code, and then three digits for version of broadcom code in which this tag was first introduced 
    606 +        unsigned char rootAddress[ADDRESS_LEN];         // 170-181: Address in memory of rootfs partition 
    607 +        unsigned char rootLength[IMAGE_LEN];            // 182-191: Size of rootfs partition 
    608 +        unsigned char flashLayoutVer[4];                // 192-195: Version flash layout 
    609 +        unsigned char fskernelCRC[4];                   // 196-199: Guessed to be kernel CRC 
    610 +        unsigned char reserved4[16];                    // 200-215: Reserved area; unused at present 
    611 +       unsigned char imageCRC[4];                      // 216-219: CRC32 of images 
    612 +        unsigned char reserved2[12];                    // 220-231: Unused at present 
    613 +        unsigned char tagIdCRC[4];                      // 232-235: CRC32 to ensure validity of tagId 
    614 +        unsigned char headerCRC[4];                     // 236-239: CRC32 of header excluding tagVersion 
    615 +        unsigned char reserved3[16];                    // 240-255: Unused at present 
    616 +}; 
    617 + 
    618 +struct bcm_tag_bc310 { 
    619 +       unsigned char tagVersion[4];                    // 0-3: Version of the image tag 
    620 +       unsigned char sig_1[20];                        // 4-23: Company Line 1 
    621 +       unsigned char sig_2[14];                        // 24-37: Company Line 2 
    622 +       unsigned char chipid[6];                        // 38-43: Chip this image is for 
    623 +       unsigned char boardid[16];                      // 44-59: Board name 
    624 +       unsigned char big_endian[2];                    // 60-61: Map endianness -- 1 BE 0 LE 
    625 +       unsigned char totalLength[IMAGE_LEN];           // 62-71: Total length of image 
    626 +       unsigned char cfeAddress[ADDRESS_LEN];          // 72-83: Address in memory of CFE 
    627 +       unsigned char cfeLength[IMAGE_LEN];             // 84-93: Size of CFE 
    628 +       unsigned char flashImageStart[ADDRESS_LEN];     // 94-105: Address in memory of kernel (start of image) 
    629 +       unsigned char flashRootLength[IMAGE_LEN];       // 106-115: Size of rootfs + deadcode (web flash uses this + kernelLength to determine the size of the kernel+rootfs flash image) 
    630 +       unsigned char kernelAddress[ADDRESS_LEN];       // 116-127: Address in memory of kernel 
    631 +       unsigned char kernelLength[IMAGE_LEN];          // 128-137: Size of kernel 
    632 +       unsigned char dualImage[2];                     // 138-139: Unused at present 
    633 +       unsigned char inactiveFlag[2];                  // 140-141: Unused at present 
    634 +        unsigned char information1[TAGINFO_LEN];        // 142-161: Unused at present; Some vendors use this for optional information 
    635 +        unsigned char tagId[6];                         // 162-167: Identifies which type of tag this is, currently two-letter company code, and then three digits for version of broadcom code in which this tag was first introduced 
    636 +        unsigned char tagIdCRC[4];                      // 168-171: CRC32 to ensure validity of tagId 
    637 +        unsigned char rootAddress[ADDRESS_LEN];         // 172-183: Address in memory of rootfs partition 
    638 +        unsigned char rootLength[IMAGE_LEN];            // 184-193: Size of rootfs partition 
    639 +       unsigned char reserved1[22];                    // 193-215: Reserved area not in use 
    640 +       unsigned char imageCRC[4];                      // 216-219: CRC32 of images 
    641 +        unsigned char rootfsCRC[4];                     // 220-227: CRC32 of rootfs partition 
    642 +        unsigned char kernelCRC[4];                     // 224-227: CRC32 of kernel partition 
    643 +        unsigned char reserved2[8];                     // 228-235: Unused at present 
    644 +        unsigned char headerCRC[4];                     // 235-239: CRC32 of header excluding tagVersion 
    645 +        unsigned char reserved3[16];                    // 240-255: Unused at present 
    646 +}; 
    647 + 
    648 +union bcm_tag { 
    649 +  struct bcm_tag_bccfe bccfe; 
    650 +  struct bcm_tag_bc300 bc300; 
    651 +  struct bcm_tag_ag306 ag306; 
    652 +  struct bcm_tag_bc221 bc221; 
    653 +  struct bcm_tag_bc310 bc310; 
    654 +}; 
    655 + 
    656 +#endif /* __BCM63XX_TAG_H */ 
    657476--- a/arch/mips/bcm63xx/boards/board_bcm963xx.c 
    658477+++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c 
  • trunk/tools/firmware-utils/src/bcm_tag.h

    • Property svn:special set to *
    r19485 r20548  
    1 #ifndef __BCM63XX_TAG_H 
    2 #define __BCM63XX_TAG_H 
    3  
    4 #define IMAGE_LEN 10                   /* Length of Length Field */ 
    5 #define ADDRESS_LEN 12                 /* Length of Address field */ 
    6 #define TAGID_LEN  6                   /* Length of tag ID */ 
    7 #define TAGINFO_LEN 20                 /* Length of vendor information field in tag */ 
    8 #define TAGVER_LEN 4                   /* Length of Tag Version */ 
    9 #define TAGLAYOUT_LEN 4                /* Length of FlashLayoutVer */ 
    10  
    11 #define NUM_TAGID 5 
    12 #define IMAGETAG_CRC_START              0xFFFFFFFF 
    13  
    14 struct tagiddesc_t { 
    15   char tagid[TAGID_LEN + 1]; 
    16   char tagiddesc[80]; 
    17 }; 
    18  
    19  // bc221 is used by BT Voyager and should be right 
    20  // bc310 should be right, and may apply to 3.08 code as well 
    21 #define TAGID_DEFINITIONS { \ 
    22   { "bccfe", "Broadcom CFE flash image" }, \ 
    23   { "bc300", "Broadcom code version 3.00-3.06 and all ftp/tftp flash" }, \ 
    24   { "ag306", "Alice Gate (Pirelli, based on Broadcom 3.06)" }, \ 
    25   { "bc221", "Broadcom code version 2.21" }, \ 
    26   { "bc310", "Broadcom code version 3.10-3.12" }, \ 
    27 } 
    28  
    29 struct bcm_tag_bccfe { 
    30         unsigned char tagVersion[TAGVER_LEN];           // 0-3: Version of the image tag 
    31         unsigned char sig_1[20];                        // 4-23: Company Line 1 
    32         unsigned char sig_2[14];                        // 24-37: Company Line 2 
    33         unsigned char chipid[6];                        // 38-43: Chip this image is for 
    34         unsigned char boardid[16];                      // 44-59: Board name 
    35         unsigned char big_endian[2];                    // 60-61: Map endianness -- 1 BE 0 LE 
    36         unsigned char totalLength[IMAGE_LEN];           // 62-71: Total length of image 
    37         unsigned char cfeAddress[ADDRESS_LEN];          // 72-83: Address in memory of CFE 
    38         unsigned char cfeLength[IMAGE_LEN];             // 84-93: Size of CFE 
    39         unsigned char rootAddress[ADDRESS_LEN];         // 94-105: Address in memory of rootfs 
    40         unsigned char rootLength[IMAGE_LEN];            // 106-115: Size of rootfs 
    41         unsigned char kernelAddress[ADDRESS_LEN];       // 116-127: Address in memory of kernel 
    42         unsigned char kernelLength[IMAGE_LEN];          // 128-137: Size of kernel 
    43         unsigned char dualImage[2];                     // 138-139: Unused at present 
    44         unsigned char inactiveFlag[2];                  // 140-141: Unused at present 
    45         unsigned char information1[TAGINFO_LEN];        // 142-161: Unused at present 
    46         unsigned char tagId[TAGID_LEN];                 // 162-167: Identifies which type of tag this is, currently two-letter company code, and then three digits for version of broadcom code in which this tag was first introduced 
    47         unsigned char tagIdCRC[4];                      // 168-171: CRC32 of tagId 
    48         unsigned char reserved1[44];                    // 172-215: Reserved area not in use 
    49         unsigned char imageCRC[4];                      // 216-219: CRC32 of images 
    50         unsigned char reserved2[16];                    // 220-235: Unused at present 
    51         unsigned char headerCRC[4];                     // 236-239: CRC32 of header excluding tagVersion 
    52         unsigned char reserved3[16];                    // 240-255: Unused at present 
    53 }; 
    54  
    55 struct bcm_tag_bc300 { 
    56         unsigned char tagVersion[TAGVER_LEN];           // 0-3: Version of the image tag 
    57         unsigned char sig_1[20];                        // 4-23: Company Line 1 
    58         unsigned char sig_2[14];                        // 24-37: Company Line 2 
    59         unsigned char chipid[6];                        // 38-43: Chip this image is for 
    60         unsigned char boardid[16];                      // 44-59: Board name 
    61         unsigned char big_endian[2];                    // 60-61: Map endianness -- 1 BE 0 LE 
    62         unsigned char totalLength[IMAGE_LEN];           // 62-71: Total length of image 
    63         unsigned char cfeAddress[ADDRESS_LEN];          // 72-83: Address in memory of CFE 
    64         unsigned char cfeLength[IMAGE_LEN];             // 84-93: Size of CFE 
    65         unsigned char flashImageStart[ADDRESS_LEN];     // 94-105: Address in memory of kernel (start of image) 
    66         unsigned char flashRootLength[IMAGE_LEN];       // 106-115: Size of rootfs + deadcode (web flash uses this + kernelLength to determine the size of the kernel+rootfs flash image) 
    67         unsigned char kernelAddress[ADDRESS_LEN];       // 116-127: Address in memory of kernel 
    68         unsigned char kernelLength[IMAGE_LEN];          // 128-137: Size of kernel 
    69         unsigned char dualImage[2];                     // 138-139: Unused at present 
    70         unsigned char inactiveFlag[2];                  // 140-141: Unused at present 
    71         unsigned char information1[TAGINFO_LEN];        // 142-161: Unused at present 
    72         unsigned char tagId[TAGID_LEN];                 // 162-167: Identifies which type of tag this is, currently two-letter company code, and then three digits for version of broadcom code in which this tag was first introduced 
    73         unsigned char tagIdCRC[4];                      // 168-173: CRC32 to ensure validity of tagId 
    74         unsigned char rootAddress[ADDRESS_LEN];         // 174-183: Address in memory of rootfs partition 
    75         unsigned char rootLength[IMAGE_LEN];            // 184-193: Size of rootfs partition 
    76         unsigned char reserved1[22];                    // 194-215: Reserved area not in use 
    77         unsigned char imageCRC[4];                      // 216-219: CRC32 of images 
    78         unsigned char reserved2[16];                    // 220-235: Unused at present 
    79         unsigned char headerCRC[4];                     // 236-239: CRC32 of header excluding tagVersion 
    80         unsigned char reserved3[16];                    // 240-255: Unused at present 
    81 }; 
    82  
    83 struct bcm_tag_ag306 { 
    84         unsigned char tagVersion[TAGVER_LEN];           // 0-3: Version of the image tag 
    85         unsigned char sig_1[20];                        // 4-23: Company Line 1 
    86         unsigned char sig_2[14];                        // 24-37: Company Line 2 
    87         unsigned char chipid[6];                        // 38-43: Chip this image is for 
    88         unsigned char boardid[16];                      // 44-59: Board name 
    89         unsigned char big_endian[2];                    // 60-61: Map endianness -- 1 BE 0 LE 
    90         unsigned char totalLength[IMAGE_LEN];           // 62-71: Total length of image 
    91         unsigned char cfeAddress[ADDRESS_LEN];          // 72-83: Address in memory of CFE 
    92         unsigned char cfeLength[IMAGE_LEN];             // 84-93: Size of CFE 
    93         unsigned char flashImageStart[ADDRESS_LEN];     // 94-105: Address in memory of kernel (start of image) 
    94         unsigned char flashRootLength[IMAGE_LEN];       // 106-115: Size of rootfs + deadcode (web flash uses this + kernelLength to determine the size of the kernel+rootfs flash image) 
    95         unsigned char kernelAddress[ADDRESS_LEN];       // 116-127: Address in memory of kernel 
    96         unsigned char kernelLength[IMAGE_LEN];          // 128-137: Size of kernel 
    97         unsigned char dualImage[2];                     // 138-139: Unused at present 
    98         unsigned char inactiveFlag[2];                  // 140-141: Unused at present 
    99         unsigned char information1[TAGINFO_LEN];        // 142-161: Unused at present 
    100         unsigned char information2[54];                 // 162-215: Compilation and related information (not generated/used by OpenWRT) 
    101         unsigned char kernelCRC[4] ;                    // 216-219: CRC32 of images 
    102         unsigned char rootAddress[ADDRESS_LEN];         // 220-231: Address in memory of rootfs partition 
    103         unsigned char tagIdCRC[4];                      // 232-235: Checksum to ensure validity of tagId 
    104         unsigned char headerCRC[4];                     // 236-239: CRC32 of header excluding tagVersion 
    105         unsigned char rootLength[IMAGE_LEN];            // 240-249: Size of rootfs 
    106         unsigned char tagId[TAGID_LEN];                 // 250-255: Identifies which type of tag this is, currently two-letter company code, and then three digits for version of broadcom code in which this tag was first introduced 
    107 }; 
    108  
    109 struct bcm_tag_bc221 { 
    110         unsigned char tagVersion[TAGVER_LEN];           // 0-3: Version of the image tag 
    111         unsigned char sig_1[20];                        // 4-23: Company Line 1 
    112         unsigned char sig_2[14];                        // 24-37: Company Line 2 
    113         unsigned char chipid[6];                        // 38-43: Chip this image is for 
    114         unsigned char boardid[16];                      // 44-59: Board name 
    115         unsigned char big_endian[2];                    // 60-61: Map endianness -- 1 BE 0 LE 
    116         unsigned char totalLength[IMAGE_LEN];           // 62-71: Total length of image 
    117         unsigned char cfeAddress[ADDRESS_LEN];          // 72-83: Address in memory of CFE 
    118         unsigned char cfeLength[IMAGE_LEN];             // 84-93: Size of CFE 
    119         unsigned char flashImageStart[ADDRESS_LEN];     // 94-105: Address in memory of kernel (start of image) 
    120         unsigned char flashRootLength[IMAGE_LEN];       // 106-115: Size of rootfs + deadcode (web flash uses this + kernelLength to determine the size of the kernel+rootfs flash image) 
    121         unsigned char kernelAddress[ADDRESS_LEN];       // 116-127: Address in memory of kernel 
    122         unsigned char kernelLength[IMAGE_LEN];          // 128-137: Size of kernel 
    123         unsigned char dualImage[2];                     // 138-139: Unused at present 
    124         unsigned char inactiveFlag[2];                  // 140-141: Unused at present 
    125         unsigned char rsa_signature[TAGINFO_LEN];       // 142-161: RSA Signature (unused at present; some vendors may use this) 
    126         unsigned char reserved5[2];                     // 162-163: Unused at present 
    127         unsigned char tagId[TAGID_LEN];                 // 164-169: Identifies which type of tag this is, currently two-letter company code, and then three digits for version of broadcom code in which this tag was first introduced 
    128         unsigned char rootAddress[ADDRESS_LEN];         // 170-181: Address in memory of rootfs partition 
    129         unsigned char rootLength[IMAGE_LEN];            // 182-191: Size of rootfs partition 
    130         unsigned char flashLayoutVer[4];                // 192-195: Version flash layout 
    131         unsigned char fskernelCRC[4];                   // 196-199: Guessed to be kernel CRC 
    132         unsigned char reserved4[16];                    // 200-215: Reserved area; unused at present 
    133         unsigned char imageCRC[4];                      // 216-219: CRC32 of images 
    134         unsigned char reserved2[12];                    // 220-231: Unused at present 
    135         unsigned char tagIdCRC[4];                      // 232-235: CRC32 to ensure validity of tagId 
    136         unsigned char headerCRC[4];                     // 236-239: CRC32 of header excluding tagVersion 
    137         unsigned char reserved3[16];                    // 240-255: Unused at present 
    138 }; 
    139  
    140 struct bcm_tag_bc310 { 
    141         unsigned char tagVersion[4];                    // 0-3: Version of the image tag 
    142         unsigned char sig_1[20];                        // 4-23: Company Line 1 
    143         unsigned char sig_2[14];                        // 24-37: Company Line 2 
    144         unsigned char chipid[6];                        // 38-43: Chip this image is for 
    145         unsigned char boardid[16];                      // 44-59: Board name 
    146         unsigned char big_endian[2];                    // 60-61: Map endianness -- 1 BE 0 LE 
    147         unsigned char totalLength[IMAGE_LEN];           // 62-71: Total length of image 
    148         unsigned char cfeAddress[ADDRESS_LEN];          // 72-83: Address in memory of CFE 
    149         unsigned char cfeLength[IMAGE_LEN];             // 84-93: Size of CFE 
    150         unsigned char flashImageStart[ADDRESS_LEN];     // 94-105: Address in memory of kernel (start of image) 
    151         unsigned char flashRootLength[IMAGE_LEN];       // 106-115: Size of rootfs + deadcode (web flash uses this + kernelLength to determine the size of the kernel+rootfs flash image) 
    152         unsigned char kernelAddress[ADDRESS_LEN];       // 116-127: Address in memory of kernel 
    153         unsigned char kernelLength[IMAGE_LEN];          // 128-137: Size of kernel 
    154         unsigned char dualImage[2];                     // 138-139: Unused at present 
    155         unsigned char inactiveFlag[2];                  // 140-141: Unused at present 
    156         unsigned char information1[TAGINFO_LEN];        // 142-161: Unused at present; Some vendors use this for optional information 
    157         unsigned char tagId[6];                         // 162-167: Identifies which type of tag this is, currently two-letter company code, and then three digits for version of broadcom code in which this tag was first introduced 
    158         unsigned char tagIdCRC[4];                      // 168-171: CRC32 to ensure validity of tagId 
    159         unsigned char rootAddress[ADDRESS_LEN];         // 172-183: Address in memory of rootfs partition 
    160         unsigned char rootLength[IMAGE_LEN];            // 184-193: Size of rootfs partition 
    161         unsigned char reserved1[22];                    // 193-215: Reserved area not in use 
    162         unsigned char imageCRC[4];                      // 216-219: CRC32 of images 
    163         unsigned char rootfsCRC[4];                     // 220-227: CRC32 of rootfs partition 
    164         unsigned char kernelCRC[4];                     // 224-227: CRC32 of kernel partition 
    165         unsigned char reserved2[8];                     // 228-235: Unused at present 
    166         unsigned char headerCRC[4];                     // 235-239: CRC32 of header excluding tagVersion 
    167         unsigned char reserved3[16];                    // 240-255: Unused at present 
    168 }; 
    169  
    170 union bcm_tag { 
    171   struct bcm_tag_bccfe bccfe; 
    172   struct bcm_tag_bc300 bc300; 
    173   struct bcm_tag_ag306 ag306; 
    174   struct bcm_tag_bc221 bc221; 
    175   struct bcm_tag_bc310 bc310; 
    176 }; 
    177  
    178 #endif /* __BCM63XX_TAG_H */ 
     1link ../../../target/linux/brcm63xx/files/arch/mips/include/asm/mach-bcm63xx/bcm_tag.h 
Note: See TracChangeset for help on using the changeset viewer.