Changeset 12325
- Timestamp:
- 06/20/09 18:58:53 (4 years ago)
- Location:
- ar5315_microredboot/microredboot
- Files:
-
- 71 edited
-
CHANGELOG (modified) (1 diff)
-
boot/src/Makefile (modified) (1 diff)
-
boot/src/lib/LzmaDecode.c (modified) (12 diffs)
-
boot/src/misc_lzma.c (modified) (8 diffs)
-
images_default/redboot_ap48_32M_8M_kendin.rom (modified) (previous)
-
images_default/redboot_ap51_16M_4M_admtek.rom (modified) (previous)
-
images_default/redboot_ap51_16M_4M_icplus.rom (modified) (previous)
-
images_default/redboot_ap51_16M_4M_kendin.rom (modified) (previous)
-
images_default/redboot_ap51_16M_4M_marvell.rom (modified) (previous)
-
images_default/redboot_ap51_16M_8M_admtek.rom (modified) (previous)
-
images_default/redboot_ap51_16M_8M_icplus.rom (modified) (previous)
-
images_default/redboot_ap51_16M_8M_kendin.rom (modified) (previous)
-
images_default/redboot_ap51_16M_8M_marvell.rom (modified) (previous)
-
images_default/redboot_ap51_32M_4M_admtek.rom (modified) (previous)
-
images_default/redboot_ap51_32M_4M_icplus.rom (modified) (previous)
-
images_default/redboot_ap51_32M_4M_kendin.rom (modified) (previous)
-
images_default/redboot_ap51_32M_4M_marvell.rom (modified) (previous)
-
images_default/redboot_ap51_32M_8M_admtek.rom (modified) (previous)
-
images_default/redboot_ap51_32M_8M_icplus.rom (modified) (previous)
-
images_default/redboot_ap51_32M_8M_kendin.rom (modified) (previous)
-
images_default/redboot_ap51_32M_8M_marvell.rom (modified) (previous)
-
images_default/redboot_ap61_16M_4M_admtek.rom (modified) (previous)
-
images_default/redboot_ap61_16M_4M_icplus.rom (modified) (previous)
-
images_default/redboot_ap61_16M_4M_kendin.rom (modified) (previous)
-
images_default/redboot_ap61_16M_4M_marvell.rom (modified) (previous)
-
images_default/redboot_ap61_16M_8M_admtek.rom (modified) (previous)
-
images_default/redboot_ap61_16M_8M_icplus.rom (modified) (previous)
-
images_default/redboot_ap61_16M_8M_kendin.rom (modified) (previous)
-
images_default/redboot_ap61_16M_8M_marvell.rom (modified) (previous)
-
images_default/redboot_ap61_32M_4M_admtek.rom (modified) (previous)
-
images_default/redboot_ap61_32M_4M_icplus.rom (modified) (previous)
-
images_default/redboot_ap61_32M_4M_kendin.rom (modified) (previous)
-
images_default/redboot_ap61_32M_4M_marvell.rom (modified) (previous)
-
images_default/redboot_ap61_32M_8M_admtek.rom (modified) (previous)
-
images_default/redboot_ap61_32M_8M_icplus.rom (modified) (previous)
-
images_default/redboot_ap61_32M_8M_kendin.rom (modified) (previous)
-
images_default/redboot_ap61_32M_8M_marvell.rom (modified) (previous)
-
images_senao/redboot_ap48_32M_8M_kendin.rom (modified) (previous)
-
images_senao/redboot_ap51_16M_4M_admtek.rom (modified) (previous)
-
images_senao/redboot_ap51_16M_4M_icplus.rom (modified) (previous)
-
images_senao/redboot_ap51_16M_4M_kendin.rom (modified) (previous)
-
images_senao/redboot_ap51_16M_4M_marvell.rom (modified) (previous)
-
images_senao/redboot_ap51_16M_8M_admtek.rom (modified) (previous)
-
images_senao/redboot_ap51_16M_8M_icplus.rom (modified) (previous)
-
images_senao/redboot_ap51_16M_8M_kendin.rom (modified) (previous)
-
images_senao/redboot_ap51_16M_8M_marvell.rom (modified) (previous)
-
images_senao/redboot_ap51_32M_4M_admtek.rom (modified) (previous)
-
images_senao/redboot_ap51_32M_4M_icplus.rom (modified) (previous)
-
images_senao/redboot_ap51_32M_4M_kendin.rom (modified) (previous)
-
images_senao/redboot_ap51_32M_4M_marvell.rom (modified) (previous)
-
images_senao/redboot_ap51_32M_8M_admtek.rom (modified) (previous)
-
images_senao/redboot_ap51_32M_8M_icplus.rom (modified) (previous)
-
images_senao/redboot_ap51_32M_8M_kendin.rom (modified) (previous)
-
images_senao/redboot_ap51_32M_8M_marvell.rom (modified) (previous)
-
images_senao/redboot_ap61_16M_4M_admtek.rom (modified) (previous)
-
images_senao/redboot_ap61_16M_4M_icplus.rom (modified) (previous)
-
images_senao/redboot_ap61_16M_4M_kendin.rom (modified) (previous)
-
images_senao/redboot_ap61_16M_4M_marvell.rom (modified) (previous)
-
images_senao/redboot_ap61_16M_8M_admtek.rom (modified) (previous)
-
images_senao/redboot_ap61_16M_8M_icplus.rom (modified) (previous)
-
images_senao/redboot_ap61_16M_8M_kendin.rom (modified) (previous)
-
images_senao/redboot_ap61_16M_8M_marvell.rom (modified) (previous)
-
images_senao/redboot_ap61_32M_4M_admtek.rom (modified) (previous)
-
images_senao/redboot_ap61_32M_4M_icplus.rom (modified) (previous)
-
images_senao/redboot_ap61_32M_4M_kendin.rom (modified) (previous)
-
images_senao/redboot_ap61_32M_4M_marvell.rom (modified) (previous)
-
images_senao/redboot_ap61_32M_8M_admtek.rom (modified) (previous)
-
images_senao/redboot_ap61_32M_8M_icplus.rom (modified) (previous)
-
images_senao/redboot_ap61_32M_8M_kendin.rom (modified) (previous)
-
images_senao/redboot_ap61_32M_8M_marvell.rom (modified) (previous)
-
images_wrt54g2/redboot_ap65_16M_4M.rom (modified) (previous)
Legend:
- Unmodified
- Added
- Removed
-
ar5315_microredboot/microredboot/CHANGELOG
r12324 r12325 1 1 20.6.09 2 2 * AR5312/AR2313: fix nvram erase for nor flash devices (tested) 3 * make LzmaDecoder 2-3 times faster. this increases size, but we are still in 64 kb limit 3 4 note: 4 5 - finally the bootloader works now for ap51,ap65 and ap48 with all current planned features -
ar5315_microredboot/microredboot/boot/src/Makefile
r12321 r12325 49 49 HEAD = head.o 50 50 OBJS = misc_lzma.o lib/lib.o lib/print.o lib/printf.o 51 MEMCPY = mem cpy.o memset.o51 MEMCPY = memset.o 52 52 # CFLAGS = $(CPPFLAGS) -O2 -DSTDC_HEADERS $(CFLAGS_BOOT) 53 53 ZLDFLAGS = -G 0 -static -X -T ld.script -
ar5315_microredboot/microredboot/boot/src/lib/LzmaDecode.c
r12320 r12325 41 41 int Result; 42 42 #endif 43 int ExtraBytes;44 43 } CRangeDecoder; 45 44 46 static Byte RangeDecoderReadByte(CRangeDecoder * rd)45 static inline Byte RangeDecoderReadByte(CRangeDecoder * rd) 47 46 { 48 47 if (rd->Buffer == rd->BufferLim) { … … 51 50 rd->Result = read_byte(&rd->Buffer, &size); 52 51 rd->BufferLim = rd->Buffer + size; 53 if (size == 0) 54 #endif 55 { 56 rd->ExtraBytes = 1; 57 return 0xFF; 58 } 52 #endif 59 53 } 60 54 return (*rd->Buffer++); … … 73 67 rd->BufferLim = stream + bufferSize; 74 68 #endif 75 rd->ExtraBytes = 0;76 69 rd->Code = 0; 77 70 rd->Range = (0xFFFFFFFF); … … 84 77 #define RC_NORMALIZE if (range < kTopValue) { range <<= 8; code = (code << 8) | ReadByte; } 85 78 86 static UInt32 RangeDecoderDecodeDirectBits(CRangeDecoder * rd, int numTotalBits) 79 static inline UInt32 RangeDecoderDecodeDirectBits(CRangeDecoder * rd, 80 int numTotalBits) 87 81 { 88 82 RC_INIT_VAR UInt32 result = 0; … … 107 101 } 108 102 109 static in t RangeDecoderBitDecode(CProb * prob, CRangeDecoder * rd)103 static inline int RangeDecoderBitDecode(CProb * prob, CRangeDecoder * rd) 110 104 { 111 105 UInt32 bound = (rd->Range >> kNumBitModelTotalBits) * *prob; … … 140 134 #define RC_GET_BIT(prob, mi) RC_GET_BIT2(prob, mi, ; , ;) 141 135 142 static int RangeDecoderBitTreeDecode(CProb * probs, int numLevels,143 CRangeDecoder * rd)136 static int inline RangeDecoderBitTreeDecode(CProb * probs, int numLevels, 137 CRangeDecoder * rd) 144 138 { 145 139 int mi = 1; … … 162 156 } 163 157 164 static int RangeDecoderReverseBitTreeDecode(CProb * probs, int numLevels,165 CRangeDecoder * rd)158 static int inline RangeDecoderReverseBitTreeDecode(CProb * probs, int numLevels, 159 CRangeDecoder * rd) 166 160 { 167 161 int mi = 1; … … 187 181 } 188 182 189 static Byte LzmaLiteralDecode(CProb * probs, CRangeDecoder * rd)183 static Byte inline LzmaLiteralDecode(CProb * probs, CRangeDecoder * rd) 190 184 { 191 185 int symbol = 1; … … 210 204 } 211 205 212 static Byte LzmaLiteralDecodeMatch(CProb * probs, CRangeDecoder * rd,213 Byte matchByte)206 static inline Byte LzmaLiteralDecodeMatch(CProb * probs, CRangeDecoder * rd, 207 Byte matchByte) 214 208 { 215 209 int symbol = 1; … … 272 266 #define kNumLenProbs (LenHigh + kLenNumHighSymbols) 273 267 274 static in t LzmaLenDecode(CProb * p, CRangeDecoder * rd, int posState)268 static inline int LzmaLenDecode(CProb * p, CRangeDecoder * rd, int posState) 275 269 { 276 270 if (RangeDecoderBitDecode(p + LenChoice, rd) == 0) … … 364 358 } 365 359 366 staticint LzmaDecode(unsigned char *buffer,367 unsigned char *outStream, UInt32 outSize,368 UInt32 * outSizeProcessed)360 int LzmaDecode(unsigned char *buffer, 361 unsigned char *outStream, UInt32 outSize, 362 UInt32 * outSizeProcessed) 369 363 { 370 364 LzmaVarState *vs = (LzmaVarState *) buffer; … … 443 437 return rd.Result; 444 438 #endif 445 if (rd.ExtraBytes != 0)446 return LZMA_RESULT_DATA_ERROR;447 439 if (RangeDecoderBitDecode 448 440 (p + IsMatch + (state << kNumPosBitsMax) + posState, -
ar5315_microredboot/microredboot/boot/src/misc_lzma.c
r12323 r12325 43 43 static unsigned outcnt; /* bytes in output buffer */ 44 44 45 #define get_byte() (inptr < insize ? inbuf[inptr++] : fill_inbuf()) 46 47 static int fill_inbuf(void); 45 static void fill_inbuf(void); 46 47 static inline unsigned char get_byte(void) 48 { 49 static unsigned int vall; 50 51 if (((unsigned int)inptr % 4) == 0) { 52 vall = *(unsigned int *)inbuf; 53 inbuf += 4; 54 } 55 return *(((unsigned char *)&vall) + (inptr++ & 3)); 56 } 57 58 //#define get_byte() (inptr < insize ? inbuf[inptr++] : fill_inbuf()) 59 48 60 static void flush_window(void); 49 61 static void error(char *m); … … 63 75 64 76 #include "lib/LzmaDecode.h" 65 static int read_byte(unsigned char **buffer, UInt32 * bufferSize); 77 static unsigned int icnt = 0; 78 static inline int read_byte(unsigned char **buffer, UInt32 * bufferSize) 79 { 80 static unsigned char val; 81 *bufferSize = 1; 82 val = get_byte(); 83 *buffer = &val; 84 if (icnt++ % (1024 * 10) == 0) 85 putc('.'); 86 return LZMA_RESULT_OK; 87 } 88 66 89 #include "lib/LzmaDecode.c" 67 90 … … 80 103 unsigned char *workspace; 81 104 unsigned int lc, lp, pb; 105 if (inptr >= insize) 106 fill_inbuf(); 82 107 83 108 // lzma args … … 153 178 */ 154 179 155 static unsigned int icnt = 0;156 static int read_byte(unsigned char **buffer, UInt32 * bufferSize)157 {158 static unsigned char val;159 *bufferSize = 1;160 val = get_byte();161 *buffer = &val;162 if (icnt++ % (1024 * 10) == 0)163 putc('.');164 return LZMA_RESULT_OK;165 }166 167 180 struct fis_image_desc { 168 181 unsigned char name[16]; // Null terminated name … … 206 219 bootoffset = fis->entry_point; 207 220 output_data = (uch *) fis->mem_base; 208 #ifdef AR5312221 //#ifdef AR5312 209 222 return fis->flash_base; 210 #else211 memcpy((unsigned char *)ZCACHEADDR,212 (unsigned char *)fis->flash_base,213 1 * 1024 * 1024);214 return ZCACHEADDR;215 #endif223 //#else 224 // memcpy((unsigned char *)ZCACHEADDR, 225 // (unsigned char *)fis->flash_base, 226 // 1 * 1024 * 1024); 227 // return ZCACHEADDR; 228 //#endif 216 229 } 217 230 p += 256; … … 231 244 static int resettrigger = 0; 232 245 233 static intfill_inbuf(void)246 static void fill_inbuf(void) 234 247 { 235 248 if (insize != 0) … … 238 251 inbuf = (uch *) linuxaddr; 239 252 insize = 0x400000; 240 inptr = 1;253 inptr = 0; 241 254 } else { 242 255 inbuf = input_data; 243 256 insize = &input_data_end[0] - &input_data[0]; 244 inptr = 1;245 } 246 return inbuf[0];257 inptr = 0; 258 } 259 return; 247 260 } 248 261 … … 943 956 header->len, header); 944 957 nvramdetect = (unsigned int)header; 945 memcpy(nvram_buf, header, NVRAM_SPACE); 958 unsigned int *src = header; 959 unsigned int *dst = nvram_buf; 960 for (i = 0; i < NVRAM_SPACE / 4; i++) 961 dst[i] = src[i]; 946 962 return; 947 963 }
Note: See TracChangeset
for help on using the changeset viewer.
