From ae8fb3ba68b1d5b01668f3a6d5c54efea44ea689 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= Date: Sun, 26 Mar 2017 12:45:51 +0200 Subject: [PATCH] brcm63xx: backport bcm963xx_tag.h upstream changes MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit bcm963xx_tag.h was moved to include/linux so that drivers outside of mach-bcm63xx can use it. Signed-off-by: Álvaro Fernández Rojas --- .../311-bcm63xxpart_use_cfedetection.patch | 10 +- .../401-bcm963xx_real_rootfs_length.patch | 14 +- ...-bcm63xxpart_parse_paritions_from_dt.patch | 20 +- ...ve-Broadcom-BCM963xx-image-tag-data-.patch | 246 ++++++++++++++++++ ...ve-extended-flash-address-to-bcm_tag.patch | 66 +++++ ...-Update-bcm_tag-field-image_sequence.patch | 50 ++++ 6 files changed, 383 insertions(+), 23 deletions(-) create mode 100644 target/linux/generic/patches-4.4/044-0001-MIPS-bcm963xx-Move-Broadcom-BCM963xx-image-tag-data-.patch create mode 100644 target/linux/generic/patches-4.4/044-0002-MIPS-bcm963xx-Move-extended-flash-address-to-bcm_tag.patch create mode 100644 target/linux/generic/patches-4.4/044-0003-MIPS-bcm963xx-Update-bcm_tag-field-image_sequence.patch diff --git a/target/linux/brcm63xx/patches-4.4/311-bcm63xxpart_use_cfedetection.patch b/target/linux/brcm63xx/patches-4.4/311-bcm63xxpart_use_cfedetection.patch index 46d9b47cdf..7d820a5217 100644 --- a/target/linux/brcm63xx/patches-4.4/311-bcm63xxpart_use_cfedetection.patch +++ b/target/linux/brcm63xx/patches-4.4/311-bcm63xxpart_use_cfedetection.patch @@ -1,15 +1,13 @@ --- a/drivers/mtd/bcm63xxpart.c +++ b/drivers/mtd/bcm63xxpart.c -@@ -35,7 +35,7 @@ +@@ -35,36 +35,12 @@ + #include #include - #include -#include +#include - #define BCM63XX_EXTENDED_SIZE 0xBFC00000 /* Extended flash address */ - -@@ -43,30 +43,6 @@ + #define BCM63XX_CFE_BLOCK_SIZE SZ_64K /* always at least 64KiB */ #define BCM63XX_CFE_MAGIC_OFFSET 0x4e0 @@ -40,7 +38,7 @@ static int bcm63xx_parse_cfe_partitions(struct mtd_info *master, struct mtd_partition **pparts, struct mtd_part_parser_data *data) -@@ -85,7 +61,7 @@ static int bcm63xx_parse_cfe_partitions( +@@ -83,7 +59,7 @@ static int bcm63xx_parse_cfe_partitions( u32 computed_crc; bool rootfs_first = false; diff --git a/target/linux/brcm63xx/patches-4.4/401-bcm963xx_real_rootfs_length.patch b/target/linux/brcm63xx/patches-4.4/401-bcm963xx_real_rootfs_length.patch index 92c264bd76..40cca94249 100644 --- a/target/linux/brcm63xx/patches-4.4/401-bcm963xx_real_rootfs_length.patch +++ b/target/linux/brcm63xx/patches-4.4/401-bcm963xx_real_rootfs_length.patch @@ -1,21 +1,21 @@ ---- a/arch/mips/include/asm/mach-bcm63xx/bcm963xx_tag.h -+++ b/arch/mips/include/asm/mach-bcm63xx/bcm963xx_tag.h -@@ -85,8 +85,10 @@ struct bcm_tag { +--- a/include/linux/bcm963xx_tag.h ++++ b/include/linux/bcm963xx_tag.h +@@ -91,8 +91,10 @@ struct bcm_tag { __u32 rootfs_crc; /* 224-227: CRC32 of kernel partition */ __u32 kernel_crc; - /* 228-235: Unused at present */ - char reserved1[8]; -+ /* 228-231: Image sequence number */ -+ char image_sequence[4]; -+ /* 222-235: Openwrt: real rootfs length */ ++ /* 228-231: Unused at present */ ++ char reserved1[4]; ++ /* 232-235: Openwrt: real rootfs length */ + __u32 real_rootfs_length; /* 236-239: CRC32 of header excluding last 20 bytes */ __u32 header_crc; /* 240-255: Unused at present */ --- a/drivers/mtd/bcm63xxpart.c +++ b/drivers/mtd/bcm63xxpart.c -@@ -110,7 +110,8 @@ static int bcm63xx_parse_cfe_partitions( +@@ -108,7 +108,8 @@ static int bcm63xx_parse_cfe_partitions( } else { /* OpenWrt layout */ rootfsaddr = kerneladdr + kernellen; diff --git a/target/linux/brcm63xx/patches-4.4/425-bcm63xxpart_parse_paritions_from_dt.patch b/target/linux/brcm63xx/patches-4.4/425-bcm63xxpart_parse_paritions_from_dt.patch index d64d42c9dc..15baa13153 100644 --- a/target/linux/brcm63xx/patches-4.4/425-bcm63xxpart_parse_paritions_from_dt.patch +++ b/target/linux/brcm63xx/patches-4.4/425-bcm63xxpart_parse_paritions_from_dt.patch @@ -1,14 +1,14 @@ --- a/drivers/mtd/bcm63xxpart.c +++ b/drivers/mtd/bcm63xxpart.c -@@ -32,6 +32,7 @@ +@@ -33,6 +33,7 @@ #include #include #include +#include #include - #include -@@ -43,46 +44,35 @@ + #include +@@ -41,46 +42,35 @@ #define BCM63XX_CFE_MAGIC_OFFSET 0x4e0 @@ -70,15 +70,15 @@ } computed_crc = crc32_le(IMAGETAG_CRC_START, (u8 *)buf, -@@ -101,7 +91,6 @@ static int bcm63xx_parse_cfe_partitions( +@@ -99,7 +89,6 @@ static int bcm63xx_parse_cfe_partitions( - kerneladdr = kerneladdr - BCM63XX_EXTENDED_SIZE; - rootfsaddr = rootfsaddr - BCM63XX_EXTENDED_SIZE; + kerneladdr = kerneladdr - BCM963XX_EXTENDED_SIZE; + rootfsaddr = rootfsaddr - BCM963XX_EXTENDED_SIZE; - spareaddr = roundup(totallen, master->erasesize) + cfelen; if (rootfsaddr < kerneladdr) { /* default Broadcom layout */ -@@ -110,8 +99,8 @@ static int bcm63xx_parse_cfe_partitions( +@@ -108,8 +97,8 @@ static int bcm63xx_parse_cfe_partitions( } else { /* OpenWrt layout */ rootfsaddr = kerneladdr + kernellen; @@ -89,7 +89,7 @@ } } else { pr_warn("CFE boot tag CRC invalid (expected %08x, actual %08x)\n", -@@ -119,23 +108,139 @@ static int bcm63xx_parse_cfe_partitions( +@@ -117,23 +106,139 @@ static int bcm63xx_parse_cfe_partitions( kernellen = 0; rootfslen = 0; rootfsaddr = 0; @@ -239,7 +239,7 @@ /* Start building partition list */ parts[curpart].name = "CFE"; -@@ -143,29 +248,7 @@ static int bcm63xx_parse_cfe_partitions( +@@ -141,29 +246,7 @@ static int bcm63xx_parse_cfe_partitions( parts[curpart].size = cfelen; curpart++; @@ -270,7 +270,7 @@ parts[curpart].name = "nvram"; parts[curpart].offset = master->size - nvramlen; -@@ -174,25 +257,33 @@ static int bcm63xx_parse_cfe_partitions( +@@ -172,25 +255,33 @@ static int bcm63xx_parse_cfe_partitions( /* Global partition "linux" to make easy firmware upgrade */ parts[curpart].name = "linux"; diff --git a/target/linux/generic/patches-4.4/044-0001-MIPS-bcm963xx-Move-Broadcom-BCM963xx-image-tag-data-.patch b/target/linux/generic/patches-4.4/044-0001-MIPS-bcm963xx-Move-Broadcom-BCM963xx-image-tag-data-.patch new file mode 100644 index 0000000000..79ef5e320f --- /dev/null +++ b/target/linux/generic/patches-4.4/044-0001-MIPS-bcm963xx-Move-Broadcom-BCM963xx-image-tag-data-.patch @@ -0,0 +1,246 @@ +From 8fce60b8d0c62363c29d64efb0cceb98519f0350 Mon Sep 17 00:00:00 2001 +From: Simon Arlott +Date: Sun, 13 Dec 2015 22:46:59 +0000 +Subject: [PATCH] MIPS: bcm963xx: Move Broadcom BCM963xx image tag data + structure + +Move Broadcom BCM963xx image tag data structure to include/linux/ +so that drivers outside of mach-bcm63xx can use it. + +Signed-off-by: Simon Arlott +Cc: David Woodhouse +Cc: Brian Norris +Cc: Kevin Cernekee +Cc: Florian Fainelli +Cc: Jonas Gorski +Cc: Linux Kernel Mailing List +Cc: MIPS Mailing List +Cc: MTD Maling List +Patchwork: https://patchwork.linux-mips.org/patch/11832/ +Signed-off-by: Ralf Baechle +--- + arch/mips/include/asm/mach-bcm63xx/bcm963xx_tag.h | 96 ---------------------- + drivers/mtd/bcm63xxpart.c | 2 +- + include/linux/bcm963xx_tag.h | 98 +++++++++++++++++++++++ + 4 files changed, 100 insertions(+), 97 deletions(-) + delete mode 100644 arch/mips/include/asm/mach-bcm63xx/bcm963xx_tag.h + create mode 100644 include/linux/bcm963xx_tag.h + +--- a/arch/mips/include/asm/mach-bcm63xx/bcm963xx_tag.h ++++ /dev/null +@@ -1,96 +0,0 @@ +-#ifndef __BCM963XX_TAG_H +-#define __BCM963XX_TAG_H +- +-#define TAGVER_LEN 4 /* Length of Tag Version */ +-#define TAGLAYOUT_LEN 4 /* Length of FlashLayoutVer */ +-#define SIG1_LEN 20 /* Company Signature 1 Length */ +-#define SIG2_LEN 14 /* Company Signature 2 Length */ +-#define BOARDID_LEN 16 /* Length of BoardId */ +-#define ENDIANFLAG_LEN 2 /* Endian Flag Length */ +-#define CHIPID_LEN 6 /* Chip Id Length */ +-#define IMAGE_LEN 10 /* Length of Length Field */ +-#define ADDRESS_LEN 12 /* Length of Address field */ +-#define DUALFLAG_LEN 2 /* Dual Image flag Length */ +-#define INACTIVEFLAG_LEN 2 /* Inactie Flag Length */ +-#define RSASIG_LEN 20 /* Length of RSA Signature in tag */ +-#define TAGINFO1_LEN 30 /* Length of vendor information field1 in tag */ +-#define FLASHLAYOUTVER_LEN 4 /* Length of Flash Layout Version String tag */ +-#define TAGINFO2_LEN 16 /* Length of vendor information field2 in tag */ +-#define ALTTAGINFO_LEN 54 /* Alternate length for vendor information; Pirelli */ +- +-#define NUM_PIRELLI 2 +-#define IMAGETAG_CRC_START 0xFFFFFFFF +- +-#define PIRELLI_BOARDS { \ +- "AGPF-S0", \ +- "DWV-S0", \ +-} +- +-/* +- * The broadcom firmware assumes the rootfs starts the image, +- * therefore uses the rootfs start (flash_image_address) +- * to determine where to flash the image. Since we have the kernel first +- * we have to give it the kernel address, but the crc uses the length +- * associated with this address (root_length), which is added to the kernel +- * length (kernel_length) to determine the length of image to flash and thus +- * needs to be rootfs + deadcode (jffs2 EOF marker) +-*/ +- +-struct bcm_tag { +- /* 0-3: Version of the image tag */ +- char tag_version[TAGVER_LEN]; +- /* 4-23: Company Line 1 */ +- char sig_1[SIG1_LEN]; +- /* 24-37: Company Line 2 */ +- char sig_2[SIG2_LEN]; +- /* 38-43: Chip this image is for */ +- char chip_id[CHIPID_LEN]; +- /* 44-59: Board name */ +- char board_id[BOARDID_LEN]; +- /* 60-61: Map endianness -- 1 BE 0 LE */ +- char big_endian[ENDIANFLAG_LEN]; +- /* 62-71: Total length of image */ +- char total_length[IMAGE_LEN]; +- /* 72-83: Address in memory of CFE */ +- char cfe__address[ADDRESS_LEN]; +- /* 84-93: Size of CFE */ +- char cfe_length[IMAGE_LEN]; +- /* 94-105: Address in memory of image start +- * (kernel for OpenWRT, rootfs for stock firmware) +- */ +- char flash_image_start[ADDRESS_LEN]; +- /* 106-115: Size of rootfs */ +- char root_length[IMAGE_LEN]; +- /* 116-127: Address in memory of kernel */ +- char kernel_address[ADDRESS_LEN]; +- /* 128-137: Size of kernel */ +- char kernel_length[IMAGE_LEN]; +- /* 138-139: Unused at the moment */ +- char dual_image[DUALFLAG_LEN]; +- /* 140-141: Unused at the moment */ +- char inactive_flag[INACTIVEFLAG_LEN]; +- /* 142-161: RSA Signature (not used; some vendors may use this) */ +- char rsa_signature[RSASIG_LEN]; +- /* 162-191: Compilation and related information (not used in OpenWrt) */ +- char information1[TAGINFO1_LEN]; +- /* 192-195: Version flash layout */ +- char flash_layout_ver[FLASHLAYOUTVER_LEN]; +- /* 196-199: kernel+rootfs CRC32 */ +- __u32 fskernel_crc; +- /* 200-215: Unused except on Alice Gate where is is information */ +- char information2[TAGINFO2_LEN]; +- /* 216-219: CRC32 of image less imagetag (kernel for Alice Gate) */ +- __u32 image_crc; +- /* 220-223: CRC32 of rootfs partition */ +- __u32 rootfs_crc; +- /* 224-227: CRC32 of kernel partition */ +- __u32 kernel_crc; +- /* 228-235: Unused at present */ +- char reserved1[8]; +- /* 236-239: CRC32 of header excluding last 20 bytes */ +- __u32 header_crc; +- /* 240-255: Unused at present */ +- char reserved2[16]; +-}; +- +-#endif /* __BCM63XX_TAG_H */ +--- a/drivers/mtd/bcm63xxpart.c ++++ b/drivers/mtd/bcm63xxpart.c +@@ -24,6 +24,7 @@ + + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + ++#include + #include + #include + #include +@@ -34,7 +35,6 @@ + #include + + #include +-#include + #include + + #define BCM63XX_EXTENDED_SIZE 0xBFC00000 /* Extended flash address */ +--- /dev/null ++++ b/include/linux/bcm963xx_tag.h +@@ -0,0 +1,98 @@ ++#ifndef __LINUX_BCM963XX_TAG_H__ ++#define __LINUX_BCM963XX_TAG_H__ ++ ++#include ++ ++#define TAGVER_LEN 4 /* Length of Tag Version */ ++#define TAGLAYOUT_LEN 4 /* Length of FlashLayoutVer */ ++#define SIG1_LEN 20 /* Company Signature 1 Length */ ++#define SIG2_LEN 14 /* Company Signature 2 Length */ ++#define BOARDID_LEN 16 /* Length of BoardId */ ++#define ENDIANFLAG_LEN 2 /* Endian Flag Length */ ++#define CHIPID_LEN 6 /* Chip Id Length */ ++#define IMAGE_LEN 10 /* Length of Length Field */ ++#define ADDRESS_LEN 12 /* Length of Address field */ ++#define DUALFLAG_LEN 2 /* Dual Image flag Length */ ++#define INACTIVEFLAG_LEN 2 /* Inactie Flag Length */ ++#define RSASIG_LEN 20 /* Length of RSA Signature in tag */ ++#define TAGINFO1_LEN 30 /* Length of vendor information field1 in tag */ ++#define FLASHLAYOUTVER_LEN 4 /* Length of Flash Layout Version String tag */ ++#define TAGINFO2_LEN 16 /* Length of vendor information field2 in tag */ ++#define ALTTAGINFO_LEN 54 /* Alternate length for vendor information; Pirelli */ ++ ++#define NUM_PIRELLI 2 ++#define IMAGETAG_CRC_START 0xFFFFFFFF ++ ++#define PIRELLI_BOARDS { \ ++ "AGPF-S0", \ ++ "DWV-S0", \ ++} ++ ++/* ++ * The broadcom firmware assumes the rootfs starts the image, ++ * therefore uses the rootfs start (flash_image_address) ++ * to determine where to flash the image. Since we have the kernel first ++ * we have to give it the kernel address, but the crc uses the length ++ * associated with this address (root_length), which is added to the kernel ++ * length (kernel_length) to determine the length of image to flash and thus ++ * needs to be rootfs + deadcode (jffs2 EOF marker) ++*/ ++ ++struct bcm_tag { ++ /* 0-3: Version of the image tag */ ++ char tag_version[TAGVER_LEN]; ++ /* 4-23: Company Line 1 */ ++ char sig_1[SIG1_LEN]; ++ /* 24-37: Company Line 2 */ ++ char sig_2[SIG2_LEN]; ++ /* 38-43: Chip this image is for */ ++ char chip_id[CHIPID_LEN]; ++ /* 44-59: Board name */ ++ char board_id[BOARDID_LEN]; ++ /* 60-61: Map endianness -- 1 BE 0 LE */ ++ char big_endian[ENDIANFLAG_LEN]; ++ /* 62-71: Total length of image */ ++ char total_length[IMAGE_LEN]; ++ /* 72-83: Address in memory of CFE */ ++ char cfe__address[ADDRESS_LEN]; ++ /* 84-93: Size of CFE */ ++ char cfe_length[IMAGE_LEN]; ++ /* 94-105: Address in memory of image start ++ * (kernel for OpenWRT, rootfs for stock firmware) ++ */ ++ char flash_image_start[ADDRESS_LEN]; ++ /* 106-115: Size of rootfs */ ++ char root_length[IMAGE_LEN]; ++ /* 116-127: Address in memory of kernel */ ++ char kernel_address[ADDRESS_LEN]; ++ /* 128-137: Size of kernel */ ++ char kernel_length[IMAGE_LEN]; ++ /* 138-139: Unused at the moment */ ++ char dual_image[DUALFLAG_LEN]; ++ /* 140-141: Unused at the moment */ ++ char inactive_flag[INACTIVEFLAG_LEN]; ++ /* 142-161: RSA Signature (not used; some vendors may use this) */ ++ char rsa_signature[RSASIG_LEN]; ++ /* 162-191: Compilation and related information (not used in OpenWrt) */ ++ char information1[TAGINFO1_LEN]; ++ /* 192-195: Version flash layout */ ++ char flash_layout_ver[FLASHLAYOUTVER_LEN]; ++ /* 196-199: kernel+rootfs CRC32 */ ++ __u32 fskernel_crc; ++ /* 200-215: Unused except on Alice Gate where is is information */ ++ char information2[TAGINFO2_LEN]; ++ /* 216-219: CRC32 of image less imagetag (kernel for Alice Gate) */ ++ __u32 image_crc; ++ /* 220-223: CRC32 of rootfs partition */ ++ __u32 rootfs_crc; ++ /* 224-227: CRC32 of kernel partition */ ++ __u32 kernel_crc; ++ /* 228-235: Unused at present */ ++ char reserved1[8]; ++ /* 236-239: CRC32 of header excluding last 20 bytes */ ++ __u32 header_crc; ++ /* 240-255: Unused at present */ ++ char reserved2[16]; ++}; ++ ++#endif /* __LINUX_BCM63XX_TAG_H__ */ diff --git a/target/linux/generic/patches-4.4/044-0002-MIPS-bcm963xx-Move-extended-flash-address-to-bcm_tag.patch b/target/linux/generic/patches-4.4/044-0002-MIPS-bcm963xx-Move-extended-flash-address-to-bcm_tag.patch new file mode 100644 index 0000000000..65433830db --- /dev/null +++ b/target/linux/generic/patches-4.4/044-0002-MIPS-bcm963xx-Move-extended-flash-address-to-bcm_tag.patch @@ -0,0 +1,66 @@ +From 1f29cb19cb7c3bea870d7da02ec23823af9d636e Mon Sep 17 00:00:00 2001 +From: Simon Arlott +Date: Sun, 13 Dec 2015 22:47:55 +0000 +Subject: [PATCH] MIPS: bcm963xx: Move extended flash address to bcm_tag header + file + +The extended flash address needs to be subtracted from bcm_tag flash +image offsets. Move this value to the bcm_tag header file. + +Renamed define name to consistently use bcm963xx for flash layout +which should be considered a property of the board and not the SoC +(i.e. bcm63xx could theoretically be used on a board without CFE +or any flash). + +Signed-off-by: Simon Arlott +Cc: David Woodhouse +Cc: Brian Norris +Cc: Kevin Cernekee +Cc: Florian Fainelli +Cc: Jonas Gorski +Cc: Linux Kernel Mailing List +Cc: MIPS Mailing List +Cc: MTD Maling List +Patchwork: https://patchwork.linux-mips.org/patch/11833/ +Signed-off-by: Ralf Baechle +--- + drivers/mtd/bcm63xxpart.c | 6 ++---- + include/linux/bcm963xx_tag.h | 5 +++++ + 2 files changed, 7 insertions(+), 4 deletions(-) + +--- a/drivers/mtd/bcm63xxpart.c ++++ b/drivers/mtd/bcm63xxpart.c +@@ -37,8 +37,6 @@ + #include + #include + +-#define BCM63XX_EXTENDED_SIZE 0xBFC00000 /* Extended flash address */ +- + #define BCM63XX_CFE_BLOCK_SIZE SZ_64K /* always at least 64KiB */ + + #define BCM63XX_CFE_MAGIC_OFFSET 0x4e0 +@@ -123,8 +121,8 @@ static int bcm63xx_parse_cfe_partitions( + pr_info("CFE boot tag found with version %s and board type %s\n", + tagversion, boardid); + +- kerneladdr = kerneladdr - BCM63XX_EXTENDED_SIZE; +- rootfsaddr = rootfsaddr - BCM63XX_EXTENDED_SIZE; ++ kerneladdr = kerneladdr - BCM963XX_EXTENDED_SIZE; ++ rootfsaddr = rootfsaddr - BCM963XX_EXTENDED_SIZE; + spareaddr = roundup(totallen, master->erasesize) + cfelen; + + if (rootfsaddr < kerneladdr) { +--- a/include/linux/bcm963xx_tag.h ++++ b/include/linux/bcm963xx_tag.h +@@ -28,6 +28,11 @@ + "DWV-S0", \ + } + ++/* Extended flash address, needs to be subtracted ++ * from bcm_tag flash image offsets. ++ */ ++#define BCM963XX_EXTENDED_SIZE 0xBFC00000 ++ + /* + * The broadcom firmware assumes the rootfs starts the image, + * therefore uses the rootfs start (flash_image_address) diff --git a/target/linux/generic/patches-4.4/044-0003-MIPS-bcm963xx-Update-bcm_tag-field-image_sequence.patch b/target/linux/generic/patches-4.4/044-0003-MIPS-bcm963xx-Update-bcm_tag-field-image_sequence.patch new file mode 100644 index 0000000000..02b4f6c38a --- /dev/null +++ b/target/linux/generic/patches-4.4/044-0003-MIPS-bcm963xx-Update-bcm_tag-field-image_sequence.patch @@ -0,0 +1,50 @@ +From 696569f759cdebc7da67666fc4f962eaee13562b Mon Sep 17 00:00:00 2001 +From: Simon Arlott +Date: Sun, 13 Dec 2015 22:48:44 +0000 +Subject: [PATCH] MIPS: bcm963xx: Update bcm_tag field image_sequence + +The "dual_image" and "inactive_flag" fields should be merged into a single +"image_sequence" field. + +Signed-off-by: Simon Arlott +Cc: David Woodhouse +Cc: Brian Norris +Cc: Kevin Cernekee +Cc: Florian Fainelli +Cc: Jonas Gorski +Cc: Linux Kernel Mailing List +Cc: MIPS Mailing List +Cc: MTD Maling List +Patchwork: https://patchwork.linux-mips.org/patch/11834/ +Signed-off-by: Ralf Baechle +--- + include/linux/bcm963xx_tag.h | 11 +++++------ + 1 file changed, 5 insertions(+), 6 deletions(-) + +--- a/include/linux/bcm963xx_tag.h ++++ b/include/linux/bcm963xx_tag.h +@@ -12,8 +12,7 @@ + #define CHIPID_LEN 6 /* Chip Id Length */ + #define IMAGE_LEN 10 /* Length of Length Field */ + #define ADDRESS_LEN 12 /* Length of Address field */ +-#define DUALFLAG_LEN 2 /* Dual Image flag Length */ +-#define INACTIVEFLAG_LEN 2 /* Inactie Flag Length */ ++#define IMAGE_SEQUENCE_LEN 4 /* Image sequence Length */ + #define RSASIG_LEN 20 /* Length of RSA Signature in tag */ + #define TAGINFO1_LEN 30 /* Length of vendor information field1 in tag */ + #define FLASHLAYOUTVER_LEN 4 /* Length of Flash Layout Version String tag */ +@@ -72,10 +71,10 @@ struct bcm_tag { + char kernel_address[ADDRESS_LEN]; + /* 128-137: Size of kernel */ + char kernel_length[IMAGE_LEN]; +- /* 138-139: Unused at the moment */ +- char dual_image[DUALFLAG_LEN]; +- /* 140-141: Unused at the moment */ +- char inactive_flag[INACTIVEFLAG_LEN]; ++ /* 138-141: Image sequence number ++ * (to be incremented when flashed with a new image) ++ */ ++ char image_sequence[IMAGE_SEQUENCE_LEN]; + /* 142-161: RSA Signature (not used; some vendors may use this) */ + char rsa_signature[RSASIG_LEN]; + /* 162-191: Compilation and related information (not used in OpenWrt) */ -- 2.30.2