generic: b53: clear SM_SW_FWD_MODE unconditionally when enabling VLAN
[openwrt.git] / target / linux / generic / patches-3.7 / 261-move_bcm963xx_tag.patch
1 From b00c6f1a96a2cee4b9e63a8aa4f10ed0473f437b Mon Sep 17 00:00:00 2001
2 From: Jonas Gorski <jogo@openwrt.org>
3 Date: Tue, 29 Jan 2013 10:24:12 +0100
4 Subject: [PATCH 001/118] MIPS: BCM63XX: export bcm63xx tag to userspace
5
6 ---
7  arch/mips/include/asm/mach-bcm63xx/bcm963xx_tag.h |   96 ---------------------
8  drivers/mtd/bcm63xxpart.c                         |    2 +-
9  include/uapi/linux/Kbuild                         |    1 +
10  include/uapi/linux/bcm963xx_tag.h                 |   96 +++++++++++++++++++++
11  4 files changed, 98 insertions(+), 97 deletions(-)
12  delete mode 100644 arch/mips/include/asm/mach-bcm63xx/bcm963xx_tag.h
13  create mode 100644 include/uapi/linux/bcm963xx_tag.h
14
15 --- a/arch/mips/include/asm/mach-bcm63xx/bcm963xx_tag.h
16 +++ /dev/null
17 @@ -1,96 +0,0 @@
18 -#ifndef __BCM963XX_TAG_H
19 -#define __BCM963XX_TAG_H
20 -
21 -#define TAGVER_LEN             4       /* Length of Tag Version */
22 -#define TAGLAYOUT_LEN          4       /* Length of FlashLayoutVer */
23 -#define SIG1_LEN               20      /* Company Signature 1 Length */
24 -#define SIG2_LEN               14      /* Company Signature 2 Length */
25 -#define BOARDID_LEN            16      /* Length of BoardId */
26 -#define ENDIANFLAG_LEN         2       /* Endian Flag Length */
27 -#define CHIPID_LEN             6       /* Chip Id Length */
28 -#define IMAGE_LEN              10      /* Length of Length Field */
29 -#define ADDRESS_LEN            12      /* Length of Address field */
30 -#define DUALFLAG_LEN           2       /* Dual Image flag Length */
31 -#define INACTIVEFLAG_LEN       2       /* Inactie Flag Length */
32 -#define RSASIG_LEN             20      /* Length of RSA Signature in tag */
33 -#define TAGINFO1_LEN           30      /* Length of vendor information field1 in tag */
34 -#define FLASHLAYOUTVER_LEN     4       /* Length of Flash Layout Version String tag */
35 -#define TAGINFO2_LEN           16      /* Length of vendor information field2 in tag */
36 -#define ALTTAGINFO_LEN         54      /* Alternate length for vendor information; Pirelli */
37 -
38 -#define NUM_PIRELLI            2
39 -#define IMAGETAG_CRC_START     0xFFFFFFFF
40 -
41 -#define PIRELLI_BOARDS { \
42 -       "AGPF-S0", \
43 -       "DWV-S0", \
44 -}
45 -
46 -/*
47 - * The broadcom firmware assumes the rootfs starts the image,
48 - * therefore uses the rootfs start (flash_image_address)
49 - * to determine where to flash the image.  Since we have the kernel first
50 - * we have to give it the kernel address, but the crc uses the length
51 - * associated with this address (root_length), which is added to the kernel
52 - * length (kernel_length) to determine the length of image to flash and thus
53 - * needs to be rootfs + deadcode (jffs2 EOF marker)
54 -*/
55 -
56 -struct bcm_tag {
57 -       /* 0-3: Version of the image tag */
58 -       char tag_version[TAGVER_LEN];
59 -       /* 4-23: Company Line 1 */
60 -       char sig_1[SIG1_LEN];
61 -       /*  24-37: Company Line 2 */
62 -       char sig_2[SIG2_LEN];
63 -       /* 38-43: Chip this image is for */
64 -       char chip_id[CHIPID_LEN];
65 -       /* 44-59: Board name */
66 -       char board_id[BOARDID_LEN];
67 -       /* 60-61: Map endianness -- 1 BE 0 LE */
68 -       char big_endian[ENDIANFLAG_LEN];
69 -       /* 62-71: Total length of image */
70 -       char total_length[IMAGE_LEN];
71 -       /* 72-83: Address in memory of CFE */
72 -       char cfe__address[ADDRESS_LEN];
73 -       /* 84-93: Size of CFE */
74 -       char cfe_length[IMAGE_LEN];
75 -       /* 94-105: Address in memory of image start
76 -        * (kernel for OpenWRT, rootfs for stock firmware)
77 -        */
78 -       char flash_image_start[ADDRESS_LEN];
79 -       /* 106-115: Size of rootfs */
80 -       char root_length[IMAGE_LEN];
81 -       /* 116-127: Address in memory of kernel */
82 -       char kernel_address[ADDRESS_LEN];
83 -       /* 128-137: Size of kernel */
84 -       char kernel_length[IMAGE_LEN];
85 -       /* 138-139: Unused at the moment */
86 -       char dual_image[DUALFLAG_LEN];
87 -       /* 140-141: Unused at the moment */
88 -       char inactive_flag[INACTIVEFLAG_LEN];
89 -       /* 142-161: RSA Signature (not used; some vendors may use this) */
90 -       char rsa_signature[RSASIG_LEN];
91 -       /* 162-191: Compilation and related information (not used in OpenWrt) */
92 -       char information1[TAGINFO1_LEN];
93 -       /* 192-195: Version flash layout */
94 -       char flash_layout_ver[FLASHLAYOUTVER_LEN];
95 -       /* 196-199: kernel+rootfs CRC32 */
96 -       __u32 fskernel_crc;
97 -       /* 200-215: Unused except on Alice Gate where is is information */
98 -       char information2[TAGINFO2_LEN];
99 -       /* 216-219: CRC32 of image less imagetag (kernel for Alice Gate) */
100 -       __u32 image_crc;
101 -       /* 220-223: CRC32 of rootfs partition */
102 -       __u32 rootfs_crc;
103 -       /* 224-227: CRC32 of kernel partition */
104 -       __u32 kernel_crc;
105 -       /* 228-235: Unused at present */
106 -       char reserved1[8];
107 -       /* 236-239: CRC32 of header excluding last 20 bytes */
108 -       __u32 header_crc;
109 -       /* 240-255: Unused at present */
110 -       char reserved2[16];
111 -};
112 -
113 -#endif /* __BCM63XX_TAG_H */
114 --- a/drivers/mtd/bcm63xxpart.c
115 +++ b/drivers/mtd/bcm63xxpart.c
116 @@ -32,7 +32,7 @@
117  #include <linux/mtd/mtd.h>
118  #include <linux/mtd/partitions.h>
119  
120 -#include <asm/mach-bcm63xx/bcm963xx_tag.h>
121 +#include <linux/bcm963xx_tag.h>
122  #include <asm/mach-bcm63xx/board_bcm963xx.h>
123  
124  #define BCM63XX_EXTENDED_SIZE  0xBFC00000      /* Extended flash address */
125 --- a/include/uapi/linux/Kbuild
126 +++ b/include/uapi/linux/Kbuild
127 @@ -67,6 +67,7 @@ header-y += binfmts.h
128  header-y += blkpg.h
129  header-y += blktrace_api.h
130  header-y += bpqether.h
131 +header-y += bcm963xx_tag.h
132  header-y += bsg.h
133  header-y += can.h
134  header-y += capability.h
135 --- /dev/null
136 +++ b/include/uapi/linux/bcm963xx_tag.h
137 @@ -0,0 +1,96 @@
138 +#ifndef __BCM963XX_TAG_H
139 +#define __BCM963XX_TAG_H
140 +
141 +#define TAGVER_LEN             4       /* Length of Tag Version */
142 +#define TAGLAYOUT_LEN          4       /* Length of FlashLayoutVer */
143 +#define SIG1_LEN               20      /* Company Signature 1 Length */
144 +#define SIG2_LEN               14      /* Company Signature 2 Length */
145 +#define BOARDID_LEN            16      /* Length of BoardId */
146 +#define ENDIANFLAG_LEN         2       /* Endian Flag Length */
147 +#define CHIPID_LEN             6       /* Chip Id Length */
148 +#define IMAGE_LEN              10      /* Length of Length Field */
149 +#define ADDRESS_LEN            12      /* Length of Address field */
150 +#define DUALFLAG_LEN           2       /* Dual Image flag Length */
151 +#define INACTIVEFLAG_LEN       2       /* Inactie Flag Length */
152 +#define RSASIG_LEN             20      /* Length of RSA Signature in tag */
153 +#define TAGINFO1_LEN           30      /* Length of vendor information field1 in tag */
154 +#define FLASHLAYOUTVER_LEN     4       /* Length of Flash Layout Version String tag */
155 +#define TAGINFO2_LEN           16      /* Length of vendor information field2 in tag */
156 +#define ALTTAGINFO_LEN         54      /* Alternate length for vendor information; Pirelli */
157 +
158 +#define NUM_PIRELLI            2
159 +#define IMAGETAG_CRC_START     0xFFFFFFFF
160 +
161 +#define PIRELLI_BOARDS { \
162 +       "AGPF-S0", \
163 +       "DWV-S0", \
164 +}
165 +
166 +/*
167 + * The broadcom firmware assumes the rootfs starts the image,
168 + * therefore uses the rootfs start (flash_image_address)
169 + * to determine where to flash the image.  Since we have the kernel first
170 + * we have to give it the kernel address, but the crc uses the length
171 + * associated with this address (root_length), which is added to the kernel
172 + * length (kernel_length) to determine the length of image to flash and thus
173 + * needs to be rootfs + deadcode (jffs2 EOF marker)
174 +*/
175 +
176 +struct bcm_tag {
177 +       /* 0-3: Version of the image tag */
178 +       char tag_version[TAGVER_LEN];
179 +       /* 4-23: Company Line 1 */
180 +       char sig_1[SIG1_LEN];
181 +       /*  24-37: Company Line 2 */
182 +       char sig_2[SIG2_LEN];
183 +       /* 38-43: Chip this image is for */
184 +       char chip_id[CHIPID_LEN];
185 +       /* 44-59: Board name */
186 +       char board_id[BOARDID_LEN];
187 +       /* 60-61: Map endianness -- 1 BE 0 LE */
188 +       char big_endian[ENDIANFLAG_LEN];
189 +       /* 62-71: Total length of image */
190 +       char total_length[IMAGE_LEN];
191 +       /* 72-83: Address in memory of CFE */
192 +       char cfe__address[ADDRESS_LEN];
193 +       /* 84-93: Size of CFE */
194 +       char cfe_length[IMAGE_LEN];
195 +       /* 94-105: Address in memory of image start
196 +        * (kernel for OpenWRT, rootfs for stock firmware)
197 +        */
198 +       char flash_image_start[ADDRESS_LEN];
199 +       /* 106-115: Size of rootfs */
200 +       char root_length[IMAGE_LEN];
201 +       /* 116-127: Address in memory of kernel */
202 +       char kernel_address[ADDRESS_LEN];
203 +       /* 128-137: Size of kernel */
204 +       char kernel_length[IMAGE_LEN];
205 +       /* 138-139: Unused at the moment */
206 +       char dual_image[DUALFLAG_LEN];
207 +       /* 140-141: Unused at the moment */
208 +       char inactive_flag[INACTIVEFLAG_LEN];
209 +       /* 142-161: RSA Signature (not used; some vendors may use this) */
210 +       char rsa_signature[RSASIG_LEN];
211 +       /* 162-191: Compilation and related information (not used in OpenWrt) */
212 +       char information1[TAGINFO1_LEN];
213 +       /* 192-195: Version flash layout */
214 +       char flash_layout_ver[FLASHLAYOUTVER_LEN];
215 +       /* 196-199: kernel+rootfs CRC32 */
216 +       __u32 fskernel_crc;
217 +       /* 200-215: Unused except on Alice Gate where is is information */
218 +       char information2[TAGINFO2_LEN];
219 +       /* 216-219: CRC32 of image less imagetag (kernel for Alice Gate) */
220 +       __u32 image_crc;
221 +       /* 220-223: CRC32 of rootfs partition */
222 +       __u32 rootfs_crc;
223 +       /* 224-227: CRC32 of kernel partition */
224 +       __u32 kernel_crc;
225 +       /* 228-235: Unused at present */
226 +       char reserved1[8];
227 +       /* 236-239: CRC32 of header excluding last 20 bytes */
228 +       __u32 header_crc;
229 +       /* 240-255: Unused at present */
230 +       char reserved2[16];
231 +};
232 +
233 +#endif /* __BCM63XX_TAG_H */