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

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

File:
1 edited

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 
Note: See TracChangeset for help on using the changeset viewer.