OpenWrt – Diff between revs 2 and 3
?pathlinks?
Rev 2 | Rev 3 | |||
---|---|---|---|---|
Line 63... | Line 63... | |||
63 | uint8_t *data; |
63 | uint8_t *data; |
|
64 | }; |
64 | }; |
|
Line 65... | Line 65... | |||
65 | |
65 | |
|
66 | /** A flash partition table entry */ |
66 | /** A flash partition table entry */ |
|
67 | struct flash_partition_entry { |
67 | struct flash_partition_entry { |
|
68 | char *name; |
68 | const char *name; |
|
69 | uint32_t base; |
69 | uint32_t base; |
|
70 | uint32_t size; |
70 | uint32_t size; |
|
Line 71... | Line 71... | |||
71 | }; |
71 | }; |
|
Line 75... | Line 75... | |||
75 | const char *id; |
75 | const char *id; |
|
76 | const char *vendor; |
76 | const char *vendor; |
|
77 | const char *support_list; |
77 | const char *support_list; |
|
78 | char support_trail; |
78 | char support_trail; |
|
79 | const char *soft_ver; |
79 | const char *soft_ver; |
|
80 | struct flash_partition_entry partitions[MAX_PARTITIONS+1]; |
80 | const struct flash_partition_entry partitions[MAX_PARTITIONS+1]; |
|
81 | const char *first_sysupgrade_partition; |
81 | const char *first_sysupgrade_partition; |
|
82 | const char *last_sysupgrade_partition; |
82 | const char *last_sysupgrade_partition; |
|
83 | }; |
83 | }; |
|
Line 84... | Line 84... | |||
84 | |
84 | |
|
Line 208... | Line 208... | |||
208 | "CPE510(TP-LINK|UN|N300-5):1.1\r\n" |
208 | "CPE510(TP-LINK|UN|N300-5):1.1\r\n" |
|
209 | "CPE510(TP-LINK|US|N300-5):1.1\r\n" |
209 | "CPE510(TP-LINK|US|N300-5):1.1\r\n" |
|
210 | "CPE510(TP-LINK|EU|N300-5):1.1\r\n" |
210 | "CPE510(TP-LINK|EU|N300-5):1.1\r\n" |
|
211 | "CPE520(TP-LINK|UN|N300-5):1.1\r\n" |
211 | "CPE520(TP-LINK|UN|N300-5):1.1\r\n" |
|
212 | "CPE520(TP-LINK|US|N300-5):1.1\r\n" |
212 | "CPE520(TP-LINK|US|N300-5):1.1\r\n" |
|
213 | "CPE520(TP-LINK|EU|N300-5):1.1\r\n" |
213 | "CPE520(TP-LINK|EU|N300-5):1.1\r\n", |
|
214 | "CPE510(TP-LINK|EU|N300-5|00000000):2.0\r\n" |
- | ||
215 | "CPE510(TP-LINK|EU|N300-5|45550000):2.0\r\n" |
- | ||
216 | "CPE510(TP-LINK|EU|N300-5|55530000):2.0\r\n" |
- | ||
217 | "CPE510(TP-LINK|UN|N300-5|00000000):2.0\r\n" |
- | ||
218 | "CPE510(TP-LINK|UN|N300-5|45550000):2.0\r\n" |
- | ||
219 | "CPE510(TP-LINK|UN|N300-5|55530000):2.0\r\n" |
- | ||
220 | "CPE510(TP-LINK|US|N300-5|55530000):2.0\r\n" |
- | ||
221 | "CPE510(TP-LINK|UN|N300-5):2.0\r\n" |
- | ||
222 | "CPE510(TP-LINK|EU|N300-5):2.0\r\n" |
- | ||
223 | "CPE510(TP-LINK|US|N300-5):2.0\r\n", |
- | ||
224 | .support_trail = '\xff', |
214 | .support_trail = '\xff', |
|
225 | .soft_ver = NULL, |
215 | .soft_ver = NULL, |
|
Line 226... | Line 216... | |||
226 | |
216 | |
|
227 | .partitions = { |
217 | .partitions = { |
|
Line 355... | Line 345... | |||
355 | |
345 | |
|
356 | .first_sysupgrade_partition = "os-image", |
346 | .first_sysupgrade_partition = "os-image", |
|
357 | .last_sysupgrade_partition = "file-system" |
347 | .last_sysupgrade_partition = "file-system" |
|
Line 358... | Line -... | |||
358 | }, |
- | ||
359 | |
- | ||
360 | /** Firmware layout for the A7-V5 */ |
- | ||
361 | { |
- | ||
362 | .id = "ARCHER-A7-V5", |
- | ||
363 | .support_list = |
- | ||
364 | "SupportList:\n" |
- | ||
365 | "{product_name:Archer A7,product_ver:5.0.0,special_id:45550000}\n" |
- | ||
366 | "{product_name:Archer A7,product_ver:5.0.0,special_id:55530000}\n" |
- | ||
367 | "{product_name:Archer A7,product_ver:5.0.0,special_id:43410000}\n" |
- | ||
368 | "{product_name:Archer A7,product_ver:5.0.0,special_id:4A500000}\n" |
- | ||
369 | "{product_name:Archer A7,product_ver:5.0.0,special_id:54570000}\n", |
- | ||
370 | .support_trail = '\x00', |
- | ||
371 | .soft_ver = "soft_ver:1.0.0\n", |
- | ||
372 | |
- | ||
373 | /* We're using a dynamic kernel/rootfs split here */ |
- | ||
374 | .partitions = { |
- | ||
375 | {"factory-boot", 0x00000, 0x20000}, |
- | ||
376 | {"fs-uboot", 0x20000, 0x20000}, |
- | ||
377 | {"firmware", 0x40000, 0xec0000}, /* Stock: name os-image base 0x40000 size 0x120000 */ |
- | ||
378 | /* Stock: name file-system base 0x160000 size 0xda0000 */ |
- | ||
379 | {"default-mac", 0xf40000, 0x00200}, |
- | ||
380 | {"pin", 0xf40200, 0x00200}, |
- | ||
381 | {"device-id", 0xf40400, 0x00100}, |
- | ||
382 | {"product-info", 0xf40500, 0x0fb00}, |
- | ||
383 | {"soft-version", 0xf50000, 0x00100}, |
- | ||
384 | {"extra-para", 0xf51000, 0x01000}, |
- | ||
385 | {"support-list", 0xf52000, 0x0a000}, |
- | ||
386 | {"profile", 0xf5c000, 0x04000}, |
- | ||
387 | {"default-config", 0xf60000, 0x10000}, |
- | ||
388 | {"user-config", 0xf70000, 0x40000}, |
- | ||
389 | {"certificate", 0xfb0000, 0x10000}, |
- | ||
390 | {"partition-table", 0xfc0000, 0x10000}, |
- | ||
391 | {"log", 0xfd0000, 0x20000}, |
- | ||
392 | {"radio", 0xff0000, 0x10000}, |
- | ||
393 | {NULL, 0, 0} |
- | ||
394 | }, |
- | ||
395 | |
- | ||
396 | .first_sysupgrade_partition = "os-image", |
- | ||
397 | .last_sysupgrade_partition = "file-system", |
- | ||
398 | }, |
- | ||
399 | |
- | ||
400 | /** Firmware layout for the C2v3 */ |
- | ||
401 | { |
- | ||
402 | .id = "ARCHER-C2-V3", |
- | ||
403 | .support_list = |
- | ||
404 | "SupportList:\n" |
- | ||
405 | "{product_name:ArcherC2,product_ver:3.0.0,special_id:00000000}\n" |
- | ||
406 | "{product_name:ArcherC2,product_ver:3.0.0,special_id:55530000}\n" |
- | ||
407 | "{product_name:ArcherC2,product_ver:3.0.0,special_id:45550000}\n", |
- | ||
408 | .support_trail = '\x00', |
- | ||
409 | .soft_ver = "soft_ver:3.0.1\n", |
- | ||
410 | |
- | ||
411 | /** We're using a dynamic kernel/rootfs split here */ |
- | ||
412 | |
- | ||
413 | .partitions = { |
- | ||
414 | {"factory-boot", 0x00000, 0x20000}, |
- | ||
415 | {"fs-uboot", 0x20000, 0x10000}, |
- | ||
416 | {"firmware", 0x30000, 0x7a0000}, |
- | ||
417 | {"user-config", 0x7d0000, 0x04000}, |
- | ||
418 | {"default-mac", 0x7e0000, 0x00100}, |
- | ||
419 | {"device-id", 0x7e0100, 0x00100}, |
- | ||
420 | {"extra-para", 0x7e0200, 0x00100}, |
- | ||
421 | {"pin", 0x7e0300, 0x00100}, |
- | ||
422 | {"support-list", 0x7e0400, 0x00400}, |
- | ||
423 | {"soft-version", 0x7e0800, 0x00400}, |
- | ||
424 | {"product-info", 0x7e0c00, 0x01400}, |
- | ||
425 | {"partition-table", 0x7e2000, 0x01000}, |
- | ||
426 | {"profile", 0x7e3000, 0x01000}, |
- | ||
427 | {"default-config", 0x7e4000, 0x04000}, |
- | ||
428 | {"merge-config", 0x7ec000, 0x02000}, |
- | ||
429 | {"qos-db", 0x7ee000, 0x02000}, |
- | ||
430 | {"radio", 0x7f0000, 0x10000}, |
- | ||
431 | {NULL, 0, 0} |
- | ||
432 | }, |
- | ||
433 | |
- | ||
434 | .first_sysupgrade_partition = "os-image", |
- | ||
435 | .last_sysupgrade_partition = "file-system", |
- | ||
436 | }, |
348 | }, |
|
437 | |
349 | |
|
438 | /** Firmware layout for the C25v1 */ |
350 | /** Firmware layout for the C25v1 */ |
|
439 | { |
351 | { |
|
440 | .id = "ARCHER-C25-V1", |
352 | .id = "ARCHER-C25-V1", |
|
Line 444... | Line 356... | |||
444 | "{product_name:ArcherC25,product_ver:1.0.0,special_id:55530000}\n" |
356 | "{product_name:ArcherC25,product_ver:1.0.0,special_id:55530000}\n" |
|
445 | "{product_name:ArcherC25,product_ver:1.0.0,special_id:45550000}\n", |
357 | "{product_name:ArcherC25,product_ver:1.0.0,special_id:45550000}\n", |
|
446 | .support_trail = '\x00', |
358 | .support_trail = '\x00', |
|
447 | .soft_ver = "soft_ver:1.0.0\n", |
359 | .soft_ver = "soft_ver:1.0.0\n", |
|
Line -... | Line 360... | |||
- | 360 | |
||
448 | |
361 | /** |
|
- | 362 | We use a bigger os-image partition than the stock images (and thus |
||
- | 363 | smaller file-system), as our kernel doesn't fit in the stock firmware's |
||
- | 364 | 1MB os-image. |
||
449 | /* We're using a dynamic kernel/rootfs split here */ |
365 | */ |
|
450 | .partitions = { |
366 | .partitions = { |
|
451 | {"factory-boot", 0x00000, 0x20000}, |
367 | {"factory-boot", 0x00000, 0x20000}, |
|
452 | {"fs-uboot", 0x20000, 0x10000}, |
368 | {"fs-uboot", 0x20000, 0x10000}, |
|
453 | {"firmware", 0x30000, 0x7a0000}, /* Stock: name os-image base 0x30000 size 0x100000 */ |
369 | {"os-image", 0x30000, 0x180000}, /* Stock: base 0x30000 size 0x100000 */ |
|
454 | /* Stock: name file-system base 0x130000 size 0x6a0000 */ |
370 | {"file-system", 0x1b0000, 0x620000}, /* Stock: base 0x130000 size 0x6a0000 */ |
|
455 | {"user-config", 0x7d0000, 0x04000}, |
371 | {"user-config", 0x7d0000, 0x04000}, |
|
456 | {"default-mac", 0x7e0000, 0x00100}, |
372 | {"default-mac", 0x7e0000, 0x00100}, |
|
457 | {"device-id", 0x7e0100, 0x00100}, |
373 | {"device-id", 0x7e0100, 0x00100}, |
|
458 | {"extra-para", 0x7e0200, 0x00100}, |
374 | {"extra-para", 0x7e0200, 0x00100}, |
|
Line 495... | Line 411... | |||
495 | {"support-list", 0x11500, 0x00100}, |
411 | {"support-list", 0x11500, 0x00100}, |
|
496 | {"device-id", 0x11600, 0x00100}, |
412 | {"device-id", 0x11600, 0x00100}, |
|
497 | {"profile", 0x11700, 0x03900}, |
413 | {"profile", 0x11700, 0x03900}, |
|
498 | {"default-config", 0x15000, 0x04000}, |
414 | {"default-config", 0x15000, 0x04000}, |
|
499 | {"user-config", 0x19000, 0x04000}, |
415 | {"user-config", 0x19000, 0x04000}, |
|
500 | {"firmware", 0x20000, 0x7c8000}, |
416 | {"os-image", 0x20000, 0x180000}, |
|
- | 417 | {"file-system", 0x1a0000, 0x648000}, |
||
501 | {"certyficate", 0x7e8000, 0x08000}, |
418 | {"certyficate", 0x7e8000, 0x08000}, |
|
502 | {"radio", 0x7f0000, 0x10000}, |
419 | {"radio", 0x7f0000, 0x10000}, |
|
503 | {NULL, 0, 0} |
420 | {NULL, 0, 0} |
|
504 | }, |
421 | }, |
|
Line 518... | Line 435... | |||
518 | "{product_name:Archer C59,product_ver:1.0.0,special_id:52550000}\r\n" |
435 | "{product_name:Archer C59,product_ver:1.0.0,special_id:52550000}\r\n" |
|
519 | "{product_name:Archer C59,product_ver:1.0.0,special_id:55530000}\r\n", |
436 | "{product_name:Archer C59,product_ver:1.0.0,special_id:55530000}\r\n", |
|
520 | .support_trail = '\x00', |
437 | .support_trail = '\x00', |
|
521 | .soft_ver = "soft_ver:1.0.0\n", |
438 | .soft_ver = "soft_ver:1.0.0\n", |
|
Line 522... | Line -... | |||
522 | |
- | ||
523 | /* We're using a dynamic kernel/rootfs split here */ |
439 | |
|
524 | .partitions = { |
440 | .partitions = { |
|
525 | {"fs-uboot", 0x00000, 0x10000}, |
441 | {"fs-uboot", 0x00000, 0x10000}, |
|
526 | {"default-mac", 0x10000, 0x00200}, |
442 | {"default-mac", 0x10000, 0x00200}, |
|
527 | {"pin", 0x10200, 0x00200}, |
443 | {"pin", 0x10200, 0x00200}, |
|
528 | {"device-id", 0x10400, 0x00100}, |
444 | {"device-id", 0x10400, 0x00100}, |
|
529 | {"product-info", 0x10500, 0x0fb00}, |
445 | {"product-info", 0x10500, 0x0fb00}, |
|
- | 446 | {"os-image", 0x20000, 0x180000}, |
||
530 | {"firmware", 0x20000, 0xe30000}, |
447 | {"file-system", 0x1a0000, 0xcb0000}, |
|
531 | {"partition-table", 0xe50000, 0x10000}, |
448 | {"partition-table", 0xe50000, 0x10000}, |
|
532 | {"soft-version", 0xe60000, 0x10000}, |
449 | {"soft-version", 0xe60000, 0x10000}, |
|
533 | {"support-list", 0xe70000, 0x10000}, |
450 | {"support-list", 0xe70000, 0x10000}, |
|
534 | {"profile", 0xe80000, 0x10000}, |
451 | {"profile", 0xe80000, 0x10000}, |
|
Line 544... | Line 461... | |||
544 | |
461 | |
|
545 | .first_sysupgrade_partition = "os-image", |
462 | .first_sysupgrade_partition = "os-image", |
|
546 | .last_sysupgrade_partition = "file-system", |
463 | .last_sysupgrade_partition = "file-system", |
|
Line 547... | Line -... | |||
547 | }, |
- | ||
548 | |
- | ||
549 | /** Firmware layout for the C59v2 */ |
- | ||
550 | { |
- | ||
551 | .id = "ARCHER-C59-V2", |
- | ||
552 | .vendor = "", |
- | ||
553 | .support_list = |
- | ||
554 | "SupportList:\r\n" |
- | ||
555 | "{product_name:Archer C59,product_ver:2.0.0,special_id:00000000}\r\n" |
- | ||
556 | "{product_name:Archer C59,product_ver:2.0.0,special_id:45550000}\r\n" |
- | ||
557 | "{product_name:Archer C59,product_ver:2.0.0,special_id:55530000}\r\n", |
- | ||
558 | .support_trail = '\x00', |
- | ||
559 | .soft_ver = "soft_ver:2.0.0 Build 20161206 rel.7303\n", |
- | ||
560 | |
- | ||
561 | /** We're using a dynamic kernel/rootfs split here */ |
- | ||
562 | .partitions = { |
- | ||
563 | {"factory-boot", 0x00000, 0x20000}, |
- | ||
564 | {"fs-uboot", 0x20000, 0x10000}, |
- | ||
565 | {"default-mac", 0x30000, 0x00200}, |
- | ||
566 | {"pin", 0x30200, 0x00200}, |
- | ||
567 | {"device-id", 0x30400, 0x00100}, |
- | ||
568 | {"product-info", 0x30500, 0x0fb00}, |
- | ||
569 | {"firmware", 0x40000, 0xe10000}, |
- | ||
570 | {"partition-table", 0xe50000, 0x10000}, |
- | ||
571 | {"soft-version", 0xe60000, 0x10000}, |
- | ||
572 | {"support-list", 0xe70000, 0x10000}, |
- | ||
573 | {"profile", 0xe80000, 0x10000}, |
- | ||
574 | {"default-config", 0xe90000, 0x10000}, |
- | ||
575 | {"user-config", 0xea0000, 0x40000}, |
- | ||
576 | {"usb-config", 0xee0000, 0x10000}, |
- | ||
577 | {"certificate", 0xef0000, 0x10000}, |
- | ||
578 | {"extra-para", 0xf00000, 0x10000}, |
- | ||
579 | {"qos-db", 0xf10000, 0x30000}, |
- | ||
580 | {"log", 0xfe0000, 0x10000}, |
- | ||
581 | {"radio", 0xff0000, 0x10000}, |
- | ||
582 | {NULL, 0, 0} |
- | ||
583 | }, |
- | ||
584 | |
- | ||
585 | .first_sysupgrade_partition = "os-image", |
- | ||
586 | .last_sysupgrade_partition = "file-system", |
- | ||
587 | }, |
- | ||
588 | |
- | ||
589 | /** Firmware layout for the C6v2 */ |
- | ||
590 | { |
- | ||
591 | .id = "ARCHER-C6-V2", |
- | ||
592 | .vendor = "", |
- | ||
593 | .support_list = |
- | ||
594 | "SupportList:\r\n" |
- | ||
595 | "{product_name:Archer C6,product_ver:2.0.0,special_id:45550000}\r\n" |
- | ||
596 | "{product_name:Archer C6,product_ver:2.0.0,special_id:52550000}\r\n" |
- | ||
597 | "{product_name:Archer C6,product_ver:2.0.0,special_id:4A500000}\r\n", |
- | ||
598 | .support_trail = '\x00', |
- | ||
599 | .soft_ver = "soft_ver:1.0.0\n", |
- | ||
600 | |
- | ||
601 | .partitions = { |
- | ||
602 | {"fs-uboot", 0x00000, 0x20000}, |
- | ||
603 | {"default-mac", 0x20000, 0x00200}, |
- | ||
604 | {"pin", 0x20200, 0x00100}, |
- | ||
605 | {"product-info", 0x20300, 0x00200}, |
- | ||
606 | {"device-id", 0x20500, 0x0fb00}, |
- | ||
607 | {"firmware", 0x30000, 0x7a9400}, |
- | ||
608 | {"soft-version", 0x7d9400, 0x00100}, |
- | ||
609 | {"extra-para", 0x7d9500, 0x00100}, |
- | ||
610 | {"support-list", 0x7d9600, 0x00200}, |
- | ||
611 | {"profile", 0x7d9800, 0x03000}, |
- | ||
612 | {"default-config", 0x7dc800, 0x03000}, |
- | ||
613 | {"partition-table", 0x7df800, 0x00800}, |
- | ||
614 | {"user-config", 0x7e0000, 0x0c000}, |
- | ||
615 | {"certificate", 0x7ec000, 0x04000}, |
- | ||
616 | {"radio", 0x7f0000, 0x10000}, |
- | ||
617 | {NULL, 0, 0} |
- | ||
618 | }, |
- | ||
619 | |
- | ||
620 | .first_sysupgrade_partition = "os-image", |
- | ||
621 | .last_sysupgrade_partition = "file-system", |
- | ||
622 | }, |
- | ||
623 | |
464 | }, |
|
624 | |
465 | |
|
625 | /** Firmware layout for the C60v1 */ |
466 | /** Firmware layout for the C60v1 */ |
|
626 | { |
467 | { |
|
627 | .id = "ARCHER-C60-V1", |
468 | .id = "ARCHER-C60-V1", |
|
Line 644... | Line 485... | |||
644 | {"support-list", 0x11500, 0x00100}, |
485 | {"support-list", 0x11500, 0x00100}, |
|
645 | {"device-id", 0x11600, 0x00100}, |
486 | {"device-id", 0x11600, 0x00100}, |
|
646 | {"profile", 0x11700, 0x03900}, |
487 | {"profile", 0x11700, 0x03900}, |
|
647 | {"default-config", 0x15000, 0x04000}, |
488 | {"default-config", 0x15000, 0x04000}, |
|
648 | {"user-config", 0x19000, 0x04000}, |
489 | {"user-config", 0x19000, 0x04000}, |
|
649 | {"firmware", 0x20000, 0x7c8000}, |
490 | {"os-image", 0x20000, 0x180000}, |
|
- | 491 | {"file-system", 0x1a0000, 0x648000}, |
||
650 | {"certyficate", 0x7e8000, 0x08000}, |
492 | {"certyficate", 0x7e8000, 0x08000}, |
|
651 | {"radio", 0x7f0000, 0x10000}, |
493 | {"radio", 0x7f0000, 0x10000}, |
|
652 | {NULL, 0, 0} |
494 | {NULL, 0, 0} |
|
653 | }, |
495 | }, |
|
Line 673... | Line 515... | |||
673 | {"default-mac", 0x1fb00, 0x00200}, |
515 | {"default-mac", 0x1fb00, 0x00200}, |
|
674 | {"pin", 0x1fd00, 0x00100}, |
516 | {"pin", 0x1fd00, 0x00100}, |
|
675 | {"product-info", 0x1fe00, 0x00100}, |
517 | {"product-info", 0x1fe00, 0x00100}, |
|
676 | {"device-id", 0x1ff00, 0x00100}, |
518 | {"device-id", 0x1ff00, 0x00100}, |
|
677 | {"fs-uboot", 0x20000, 0x10000}, |
519 | {"fs-uboot", 0x20000, 0x10000}, |
|
678 | {"firmware", 0x30000, 0x7a0000}, |
520 | {"os-image", 0x30000, 0x180000}, |
|
- | 521 | {"file-system", 0x1b0000, 0x620000}, |
||
679 | {"soft-version", 0x7d9500, 0x00100}, |
522 | {"soft-version", 0x7d9500, 0x00100}, |
|
680 | {"support-list", 0x7d9600, 0x00100}, |
523 | {"support-list", 0x7d9600, 0x00100}, |
|
681 | {"extra-para", 0x7d9700, 0x00100}, |
524 | {"extra-para", 0x7d9700, 0x00100}, |
|
682 | {"profile", 0x7d9800, 0x03000}, |
525 | {"profile", 0x7d9800, 0x03000}, |
|
683 | {"default-config", 0x7dc800, 0x03000}, |
526 | {"default-config", 0x7dc800, 0x03000}, |
|
Line 743... | Line 586... | |||
743 | "{product_name:Archer C7,product_ver:4.0.0,special_id:55530000}\n" |
586 | "{product_name:Archer C7,product_ver:4.0.0,special_id:55530000}\n" |
|
744 | "{product_name:Archer C7,product_ver:4.0.0,special_id:43410000}\n", |
587 | "{product_name:Archer C7,product_ver:4.0.0,special_id:43410000}\n", |
|
745 | .support_trail = '\x00', |
588 | .support_trail = '\x00', |
|
746 | .soft_ver = "soft_ver:1.0.0\n", |
589 | .soft_ver = "soft_ver:1.0.0\n", |
|
Line -... | Line 590... | |||
- | 590 | |
||
747 | |
591 | /** |
|
- | 592 | We use a bigger os-image partition than the stock images (and thus |
||
- | 593 | smaller file-system), as our kernel doesn't fit in the stock firmware's |
||
- | 594 | 1MB os-image. |
||
748 | /* We're using a dynamic kernel/rootfs split here */ |
595 | */ |
|
749 | .partitions = { |
596 | .partitions = { |
|
750 | {"factory-boot", 0x00000, 0x20000}, |
597 | {"factory-boot", 0x00000, 0x20000}, |
|
751 | {"fs-uboot", 0x20000, 0x20000}, |
598 | {"fs-uboot", 0x20000, 0x20000}, |
|
752 | {"firmware", 0x40000, 0xEC0000}, /* Stock: name os-image base 0x40000 size 0x120000 */ |
599 | {"os-image", 0x40000, 0x180000}, /* Stock: base 0x40000 size 0x120000 */ |
|
753 | /* Stock: name file-system base 0x160000 size 0xda0000 */ |
600 | {"file-system", 0x1c0000, 0xd40000}, /* Stock: base 0x160000 size 0xda0000 */ |
|
754 | {"default-mac", 0xf00000, 0x00200}, |
601 | {"default-mac", 0xf00000, 0x00200}, |
|
755 | {"pin", 0xf00200, 0x00200}, |
602 | {"pin", 0xf00200, 0x00200}, |
|
756 | {"device-id", 0xf00400, 0x00100}, |
603 | {"device-id", 0xf00400, 0x00100}, |
|
757 | {"product-info", 0xf00500, 0x0fb00}, |
604 | {"product-info", 0xf00500, 0x0fb00}, |
|
Line 777... | Line 624... | |||
777 | { |
624 | { |
|
778 | .id = "ARCHER-C7-V5", |
625 | .id = "ARCHER-C7-V5", |
|
779 | .support_list = |
626 | .support_list = |
|
780 | "SupportList:\n" |
627 | "SupportList:\n" |
|
781 | "{product_name:Archer C7,product_ver:5.0.0,special_id:00000000}\n" |
628 | "{product_name:Archer C7,product_ver:5.0.0,special_id:00000000}\n" |
|
782 | "{product_name:Archer C7,product_ver:5.0.0,special_id:45550000}\n" |
- | ||
783 | "{product_name:Archer C7,product_ver:5.0.0,special_id:55530000}\n" |
629 | "{product_name:Archer C7,product_ver:5.0.0,special_id:55530000}\n", |
|
784 | "{product_name:Archer C7,product_ver:5.0.0,special_id:43410000}\n" |
- | ||
785 | "{product_name:Archer C7,product_ver:5.0.0,special_id:4A500000}\n" |
- | ||
786 | "{product_name:Archer C7,product_ver:5.0.0,special_id:54570000}\n" |
- | ||
787 | "{product_name:Archer C7,product_ver:5.0.0,special_id:52550000}\n", |
- | ||
Line 788... | Line 630... | |||
788 | |
630 | |
|
789 | .support_trail = '\x00', |
631 | .support_trail = '\x00', |
|
Line -... | Line 632... | |||
- | 632 | .soft_ver = "soft_ver:1.0.0\n", |
||
790 | .soft_ver = "soft_ver:1.0.0\n", |
633 | |
|
- | 634 | /** |
||
- | 635 | We use a bigger os-image partition than the stock images (and thus |
||
- | 636 | smaller file-system), as our kernel doesn't fit in the stock firmware's |
||
791 | |
637 | 1MB os-image. |
|
792 | /* We're using a dynamic kernel/rootfs split here */ |
638 | */ |
|
793 | .partitions = { |
639 | .partitions = { |
|
794 | {"factory-boot", 0x00000, 0x20000}, |
640 | {"factory-boot", 0x00000, 0x20000}, |
|
795 | {"fs-uboot", 0x20000, 0x20000}, |
641 | {"fs-uboot", 0x20000, 0x20000}, |
|
Line 804... | Line 650... | |||
804 | {"support-list", 0x72000, 0x0a000}, |
650 | {"support-list", 0x72000, 0x0a000}, |
|
805 | {"profile", 0x7c000, 0x04000}, |
651 | {"profile", 0x7c000, 0x04000}, |
|
806 | {"user-config", 0x80000, 0x40000}, |
652 | {"user-config", 0x80000, 0x40000}, |
|
Line 807... | Line 653... | |||
807 | |
653 | |
|
808 | |
654 | |
|
Line 809... | Line 655... | |||
809 | {"firmware", 0xc0000, 0xf00000}, /* Stock: name os-image base 0xc0000 size 0x120000 */ |
655 | {"os-image", 0xc0000, 0x180000}, /* Stock: base 0xc0000 size 0x120000 */ |
|
810 | /* Stock: name file-system base 0x1e0000 size 0xde0000 */ |
656 | {"file-system", 0x240000, 0xd80000}, /* Stock: base 0x1e0000 size 0xde0000 */ |
|
811 | |
657 | |
|
812 | {"log", 0xfc0000, 0x20000}, |
658 | {"log", 0xfc0000, 0x20000}, |
|
Line 979... | Line 825... | |||
979 | .support_trail = '\x00', |
825 | .support_trail = '\x00', |
|
980 | .soft_ver = "soft_ver:1.0.0\n", |
826 | .soft_ver = "soft_ver:1.0.0\n", |
|
981 | .partitions = { |
827 | .partitions = { |
|
982 | {"factory-boot", 0x00000, 0x20000}, |
828 | {"factory-boot", 0x00000, 0x20000}, |
|
983 | {"fs-uboot", 0x20000, 0x20000}, |
829 | {"fs-uboot", 0x20000, 0x20000}, |
|
984 | {"firmware", 0x40000, 0xec0000}, |
830 | {"os-image", 0x40000, 0x180000}, |
|
- | 831 | {"file-system", 0x1c0000, 0xd40000}, |
||
985 | {"default-mac", 0xf00000, 0x00200}, |
832 | {"default-mac", 0xf00000, 0x00200}, |
|
986 | {"pin", 0xf00200, 0x00200}, |
833 | {"pin", 0xf00200, 0x00200}, |
|
987 | {"device-id", 0xf00400, 0x00100}, |
834 | {"device-id", 0xf00400, 0x00100}, |
|
988 | {"product-info", 0xf00500, 0x0fb00}, |
835 | {"product-info", 0xf00500, 0x0fb00}, |
|
989 | {"soft-version", 0xf10000, 0x01000}, |
836 | {"soft-version", 0xf10000, 0x01000}, |
|
Line 1011... | Line 858... | |||
1011 | "SupportList:\n" |
858 | "SupportList:\n" |
|
1012 | "{product_name:TL-WR1043ND,product_ver:4.0.0,special_id:45550000}\n", |
859 | "{product_name:TL-WR1043ND,product_ver:4.0.0,special_id:45550000}\n", |
|
1013 | .support_trail = '\x00', |
860 | .support_trail = '\x00', |
|
1014 | .soft_ver = NULL, |
861 | .soft_ver = NULL, |
|
Line -... | Line 862... | |||
- | 862 | |
||
1015 | |
863 | /** |
|
- | 864 | We use a bigger os-image partition than the stock images (and thus |
||
- | 865 | smaller file-system), as our kernel doesn't fit in the stock firmware's |
||
- | 866 | 1MB os-image. |
||
1016 | /* We're using a dynamic kernel/rootfs split here */ |
867 | */ |
|
1017 | .partitions = { |
868 | .partitions = { |
|
1018 | {"fs-uboot", 0x00000, 0x20000}, |
869 | {"fs-uboot", 0x00000, 0x20000}, |
|
- | 870 | {"os-image", 0x20000, 0x180000}, |
||
1019 | {"firmware", 0x20000, 0xf30000}, |
871 | {"file-system", 0x1a0000, 0xdb0000}, |
|
1020 | {"default-mac", 0xf50000, 0x00200}, |
872 | {"default-mac", 0xf50000, 0x00200}, |
|
1021 | {"pin", 0xf50200, 0x00200}, |
873 | {"pin", 0xf50200, 0x00200}, |
|
1022 | {"product-info", 0xf50400, 0x0fc00}, |
874 | {"product-info", 0xf50400, 0x0fc00}, |
|
1023 | {"soft-version", 0xf60000, 0x0b000}, |
875 | {"soft-version", 0xf60000, 0x0b000}, |
|
Line 1050... | Line 902... | |||
1050 | 384KB were moved from file-system to os-image |
902 | 384KB were moved from file-system to os-image |
|
1051 | in comparison to the stock image |
903 | in comparison to the stock image |
|
1052 | */ |
904 | */ |
|
1053 | .partitions = { |
905 | .partitions = { |
|
1054 | {"fs-uboot", 0x00000, 0x20000}, |
906 | {"fs-uboot", 0x00000, 0x20000}, |
|
1055 | {"firmware", 0x20000, 0x730000}, |
907 | {"os-image", 0x20000, 0x180000}, |
|
- | 908 | {"file-system", 0x1a0000, 0x5b0000}, |
||
1056 | {"default-mac", 0x750000, 0x00200}, |
909 | {"default-mac", 0x750000, 0x00200}, |
|
1057 | {"pin", 0x750200, 0x00200}, |
910 | {"pin", 0x750200, 0x00200}, |
|
1058 | {"product-info", 0x750400, 0x0fc00}, |
911 | {"product-info", 0x750400, 0x0fc00}, |
|
1059 | {"soft-version", 0x760000, 0x0b000}, |
912 | {"soft-version", 0x760000, 0x0b000}, |
|
1060 | {"support-list", 0x76b000, 0x04000}, |
913 | {"support-list", 0x76b000, 0x04000}, |
|
Line 1082... | Line 935... | |||
1082 | .support_trail = '\x00', |
935 | .support_trail = '\x00', |
|
1083 | .soft_ver = NULL, |
936 | .soft_ver = NULL, |
|
Line 1084... | Line 937... | |||
1084 | |
937 | |
|
1085 | .partitions = { |
938 | .partitions = { |
|
1086 | {"fs-uboot", 0x00000, 0x20000}, |
939 | {"fs-uboot", 0x00000, 0x20000}, |
|
- | 940 | {"os-image", 0x20000, 0x180000}, |
||
1087 | {"firmware", 0x20000, 0xe20000}, |
941 | {"file-system", 0x1a0000, 0xca0000}, |
|
1088 | {"default-mac", 0xe40000, 0x00200}, |
942 | {"default-mac", 0xe40000, 0x00200}, |
|
1089 | {"pin", 0xe40200, 0x00200}, |
943 | {"pin", 0xe40200, 0x00200}, |
|
1090 | {"product-info", 0xe40400, 0x0fc00}, |
944 | {"product-info", 0xe40400, 0x0fc00}, |
|
1091 | {"partition-table", 0xe50000, 0x10000}, |
945 | {"partition-table", 0xe50000, 0x10000}, |
|
Line 1121... | Line 975... | |||
1121 | "{product_name:RE350,product_ver:1.0.0,special_id:4b520000}\n" |
975 | "{product_name:RE350,product_ver:1.0.0,special_id:4b520000}\n" |
|
1122 | "{product_name:RE350,product_ver:1.0.0,special_id:4a500000}\n", |
976 | "{product_name:RE350,product_ver:1.0.0,special_id:4a500000}\n", |
|
1123 | .support_trail = '\x00', |
977 | .support_trail = '\x00', |
|
1124 | .soft_ver = NULL, |
978 | .soft_ver = NULL, |
|
Line -... | Line 979... | |||
- | 979 | |
||
1125 | |
980 | /** |
|
- | 981 | The original os-image partition is too small, |
||
- | 982 | so we enlarge it to 1.75M |
||
1126 | /** We're using a dynamic kernel/rootfs split here */ |
983 | */ |
|
1127 | .partitions = { |
984 | .partitions = { |
|
1128 | {"fs-uboot", 0x00000, 0x20000}, |
985 | {"fs-uboot", 0x00000, 0x20000}, |
|
- | 986 | {"os-image", 0x20000, 0x1c0000}, |
||
1129 | {"firmware", 0x20000, 0x5e0000}, |
987 | {"file-system", 0x1e0000, 0x420000}, |
|
1130 | {"partition-table", 0x600000, 0x02000}, |
988 | {"partition-table", 0x600000, 0x02000}, |
|
1131 | {"default-mac", 0x610000, 0x00020}, |
989 | {"default-mac", 0x610000, 0x00020}, |
|
1132 | {"pin", 0x610100, 0x00020}, |
990 | {"pin", 0x610100, 0x00020}, |
|
1133 | {"product-info", 0x611100, 0x01000}, |
991 | {"product-info", 0x611100, 0x01000}, |
|
Line 1159... | Line 1017... | |||
1159 | "{product_name:RE355,product_ver:1.0.0,special_id:4B520000}\r\n" |
1017 | "{product_name:RE355,product_ver:1.0.0,special_id:4B520000}\r\n" |
|
1160 | "{product_name:RE355,product_ver:1.0.0,special_id:55534100}\r\n", |
1018 | "{product_name:RE355,product_ver:1.0.0,special_id:55534100}\r\n", |
|
1161 | .support_trail = '\x00', |
1019 | .support_trail = '\x00', |
|
1162 | .soft_ver = NULL, |
1020 | .soft_ver = NULL, |
|
Line -... | Line 1021... | |||
- | 1021 | |
||
- | 1022 | /** |
||
1163 | |
1023 | The flash partition table for RE355; |
|
- | 1024 | it is almost the same as the one used by the stock images, |
||
- | 1025 | 576KB were moved from file-system to os-image. |
||
1164 | /* We're using a dynamic kernel/rootfs split here */ |
1026 | */ |
|
1165 | .partitions = { |
1027 | .partitions = { |
|
1166 | {"fs-uboot", 0x00000, 0x20000}, |
1028 | {"fs-uboot", 0x00000, 0x20000}, |
|
- | 1029 | {"os-image", 0x20000, 0x180000}, |
||
1167 | {"firmware", 0x20000, 0x5e0000}, |
1030 | {"file-system", 0x1a0000, 0x460000}, |
|
1168 | {"partition-table", 0x600000, 0x02000}, |
1031 | {"partition-table", 0x600000, 0x02000}, |
|
1169 | {"default-mac", 0x610000, 0x00020}, |
1032 | {"default-mac", 0x610000, 0x00020}, |
|
1170 | {"pin", 0x610100, 0x00020}, |
1033 | {"pin", 0x610100, 0x00020}, |
|
1171 | {"product-info", 0x611100, 0x01000}, |
1034 | {"product-info", 0x611100, 0x01000}, |
|
Line 1197... | Line 1060... | |||
1197 | "{product_name:RE450,product_ver:1.0.0,special_id:4B520000}\r\n" |
1060 | "{product_name:RE450,product_ver:1.0.0,special_id:4B520000}\r\n" |
|
1198 | "{product_name:RE450,product_ver:1.0.0,special_id:55534100}\r\n", |
1061 | "{product_name:RE450,product_ver:1.0.0,special_id:55534100}\r\n", |
|
1199 | .support_trail = '\x00', |
1062 | .support_trail = '\x00', |
|
1200 | .soft_ver = NULL, |
1063 | .soft_ver = NULL, |
|
Line 1201... | Line -... | |||
1201 | |
- | ||
1202 | /** We're using a dynamic kernel/rootfs split here */ |
- | ||
1203 | .partitions = { |
- | ||
1204 | {"fs-uboot", 0x00000, 0x20000}, |
- | ||
1205 | {"firmware", 0x20000, 0x5e0000}, |
- | ||
1206 | {"partition-table", 0x600000, 0x02000}, |
- | ||
1207 | {"default-mac", 0x610000, 0x00020}, |
- | ||
1208 | {"pin", 0x610100, 0x00020}, |
- | ||
1209 | {"product-info", 0x611100, 0x01000}, |
- | ||
1210 | {"soft-version", 0x620000, 0x01000}, |
- | ||
1211 | {"support-list", 0x621000, 0x01000}, |
- | ||
1212 | {"profile", 0x622000, 0x08000}, |
- | ||
1213 | {"user-config", 0x630000, 0x10000}, |
- | ||
1214 | {"default-config", 0x640000, 0x10000}, |
- | ||
1215 | {"radio", 0x7f0000, 0x10000}, |
- | ||
1216 | {NULL, 0, 0} |
1064 | |
|
1217 | }, |
- | ||
1218 | |
1065 | /** |
|
1219 | .first_sysupgrade_partition = "os-image", |
1066 | The flash partition table for RE450; |
|
1220 | .last_sysupgrade_partition = "file-system" |
- | ||
1221 | }, |
- | ||
1222 | |
1067 | it is almost the same as the one used by the stock images, |
|
1223 | /** Firmware layout for the RE450 v2 */ |
1068 | 576KB were moved from file-system to os-image. |
|
1224 | { |
- | ||
1225 | .id = "RE450-V2", |
- | ||
1226 | .vendor = "", |
- | ||
1227 | .support_list = |
- | ||
1228 | "SupportList:\r\n" |
- | ||
1229 | "{product_name:RE450,product_ver:2.0.0,special_id:00000000}\r\n" |
- | ||
1230 | "{product_name:RE450,product_ver:2.0.0,special_id:55530000}\r\n" |
- | ||
1231 | "{product_name:RE450,product_ver:2.0.0,special_id:45550000}\r\n" |
- | ||
1232 | "{product_name:RE450,product_ver:2.0.0,special_id:4A500000}\r\n" |
- | ||
1233 | "{product_name:RE450,product_ver:2.0.0,special_id:43410000}\r\n" |
- | ||
1234 | "{product_name:RE450,product_ver:2.0.0,special_id:41550000}\r\n" |
- | ||
1235 | "{product_name:RE450,product_ver:2.0.0,special_id:41530000}\r\n" |
- | ||
1236 | "{product_name:RE450,product_ver:2.0.0,special_id:4B520000}\r\n" |
- | ||
1237 | "{product_name:RE450,product_ver:2.0.0,special_id:42520000}\r\n", |
- | ||
1238 | .support_trail = '\x00', |
- | ||
1239 | .soft_ver = NULL, |
- | ||
1240 | |
- | ||
1241 | /* We're using a dynamic kernel/rootfs split here */ |
1069 | */ |
|
1242 | .partitions = { |
1070 | .partitions = { |
|
1243 | {"fs-uboot", 0x00000, 0x20000}, |
1071 | {"fs-uboot", 0x00000, 0x20000}, |
|
- | 1072 | {"os-image", 0x20000, 0x180000}, |
||
1244 | {"firmware", 0x20000, 0x5e0000}, |
1073 | {"file-system", 0x1a0000, 0x460000}, |
|
1245 | {"partition-table", 0x600000, 0x02000}, |
1074 | {"partition-table", 0x600000, 0x02000}, |
|
1246 | {"default-mac", 0x610000, 0x00020}, |
1075 | {"default-mac", 0x610000, 0x00020}, |
|
1247 | {"pin", 0x610100, 0x00020}, |
1076 | {"pin", 0x610100, 0x00020}, |
|
1248 | {"product-info", 0x611100, 0x01000}, |
1077 | {"product-info", 0x611100, 0x01000}, |
|
1249 | {"soft-version", 0x620000, 0x01000}, |
1078 | {"soft-version", 0x620000, 0x01000}, |
|
1250 | {"support-list", 0x621000, 0x01000}, |
1079 | {"support-list", 0x621000, 0x01000}, |
|
1251 | {"profile", 0x622000, 0x08000}, |
1080 | {"profile", 0x622000, 0x08000}, |
|
1252 | {"user-config", 0x630000, 0x10000}, |
1081 | {"user-config", 0x630000, 0x10000}, |
|
1253 | {"default-config", 0x640000, 0x10000}, |
1082 | {"default-config", 0x640000, 0x10000}, |
|
1254 | {"radio", 0x7f0000, 0x10000}, |
- | ||
1255 | |
1083 | {"radio", 0x7f0000, 0x10000}, |
|
1256 | {NULL, 0, 0} |
1084 | {NULL, 0, 0} |
|
Line 1257... | Line 1085... | |||
1257 | }, |
1085 | }, |
|
1258 | |
1086 | |
|
Line 1393... | Line 1221... | |||
1393 | |
1221 | |
|
1394 | return entry; |
1222 | return entry; |
|
Line 1395... | Line 1223... | |||
1395 | } |
1223 | } |
|
1396 | |
1224 | |
|
1397 | /** Generates the support-list partition */ |
1225 | /** Generates the support-list partition */ |
|
1398 | static struct image_partition_entry make_support_list(struct device_info *info) { |
1226 | static struct image_partition_entry make_support_list(const struct device_info *info) { |
|
Line 1399... | Line 1227... | |||
1399 | size_t len = strlen(info->support_list); |
1227 | size_t len = strlen(info->support_list); |
|
1400 | struct image_partition_entry entry = alloc_image_partition("support-list", len + 9); |
1228 | struct image_partition_entry entry = alloc_image_partition("support-list", len + 9); |
|
Line 1406... | Line 1234... | |||
1406 | |
1234 | |
|
1407 | return entry; |
1235 | return entry; |
|
Line 1408... | Line 1236... | |||
1408 | } |
1236 | } |
|
1409 | |
1237 | |
|
1410 | /** Creates a new image partition with an arbitrary name from a file */ |
1238 | /** Creates a new image partition with an arbitrary name from a file */ |
|
Line 1411... | Line 1239... | |||
1411 | static struct image_partition_entry read_file(const char *part_name, const char *filename, bool add_jffs2_eof, struct flash_partition_entry *file_system_partition) { |
1239 | static struct image_partition_entry read_file(const char *part_name, const char *filename, bool add_jffs2_eof) { |
|
1412 | struct stat statbuf; |
1240 | struct stat statbuf; |
|
Line 1413... | Line 1241... | |||
1413 | |
1241 | |
|
Line 1414... | Line 1242... | |||
1414 | if (stat(filename, &statbuf) < 0) |
1242 | if (stat(filename, &statbuf) < 0) |
|
1415 | error(1, errno, "unable to stat file `%s'", filename); |
- | ||
1416 | |
- | ||
1417 | size_t len = statbuf.st_size; |
- | ||
1418 | |
1243 | error(1, errno, "unable to stat file `%s'", filename); |
|
Line 1419... | Line 1244... | |||
1419 | if (add_jffs2_eof) |
1244 | |
|
Line 1420... | Line 1245... | |||
1420 | if (file_system_partition) |
1245 | size_t len = statbuf.st_size; |
|
1421 | len = ALIGN(len + file_system_partition->base, 0x10000) + sizeof(jffs2_eof_mark) - file_system_partition->base; |
1246 | |
|
Line 1534... | Line 1359... | |||
1534 | 0018-1013 Vendor information (4092 bytes, padded with 0xff; there seem to be older |
1359 | 0018-1013 Vendor information (4092 bytes, padded with 0xff; there seem to be older |
|
1535 | (VxWorks-based) TP-LINK devices which use a smaller vendor information block) |
1360 | (VxWorks-based) TP-LINK devices which use a smaller vendor information block) |
|
1536 | 1014-1813 Image partition table (2048 bytes, padded with 0xff) |
1361 | 1014-1813 Image partition table (2048 bytes, padded with 0xff) |
|
1537 | 1814-xxxx Firmware partitions |
1362 | 1814-xxxx Firmware partitions |
|
1538 | */ |
1363 | */ |
|
1539 | static void * generate_factory_image(struct device_info *info, const struct image_partition_entry *parts, size_t *len) { |
1364 | static void * generate_factory_image(const struct device_info *info, const struct image_partition_entry *parts, size_t *len) { |
|
1540 | *len = 0x1814; |
1365 | *len = 0x1814; |
|
Line 1541... | Line 1366... | |||
1541 | |
1366 | |
|
1542 | size_t i; |
1367 | size_t i; |
|
1543 | for (i = 0; parts[i].name; i++) |
1368 | for (i = 0; parts[i].name; i++) |
|
Line 1567... | Line 1392... | |||
1567 | |
1392 | |
|
1568 | This makes some assumptions about the provided flash and image partition tables and |
1393 | This makes some assumptions about the provided flash and image partition tables and |
|
1569 | should be generalized when TP-LINK starts building its safeloader into hardware with |
1394 | should be generalized when TP-LINK starts building its safeloader into hardware with |
|
1570 | different flash layouts. |
1395 | different flash layouts. |
|
1571 | */ |
1396 | */ |
|
1572 | static void * generate_sysupgrade_image(struct device_info *info, const struct image_partition_entry *image_parts, size_t *len) { |
1397 | static void * generate_sysupgrade_image(const struct device_info *info, const struct image_partition_entry *image_parts, size_t *len) { |
|
1573 | size_t i, j; |
1398 | size_t i, j; |
|
1574 | size_t flash_first_partition_index = 0; |
1399 | size_t flash_first_partition_index = 0; |
|
1575 | size_t flash_last_partition_index = 0; |
1400 | size_t flash_last_partition_index = 0; |
|
1576 | const struct flash_partition_entry *flash_first_partition = NULL; |
1401 | const struct flash_partition_entry *flash_first_partition = NULL; |
|
Line 1630... | Line 1455... | |||
1630 | const char *kernel_image, |
1455 | const char *kernel_image, |
|
1631 | const char *rootfs_image, |
1456 | const char *rootfs_image, |
|
1632 | uint32_t rev, |
1457 | uint32_t rev, |
|
1633 | bool add_jffs2_eof, |
1458 | bool add_jffs2_eof, |
|
1634 | bool sysupgrade, |
1459 | bool sysupgrade, |
|
1635 | struct device_info *info) { |
1460 | const struct device_info *info) { |
|
1636 | |
- | ||
1637 | size_t i; |
- | ||
Line 1638... | Line 1461... | |||
1638 | |
1461 | |
|
Line 1639... | Line -... | |||
1639 | struct image_partition_entry parts[7] = {}; |
- | ||
1640 | |
- | ||
1641 | struct flash_partition_entry *firmware_partition = NULL; |
- | ||
1642 | struct flash_partition_entry *os_image_partition = NULL; |
- | ||
1643 | struct flash_partition_entry *file_system_partition = NULL; |
- | ||
1644 | size_t firmware_partition_index = 0; |
- | ||
1645 | |
- | ||
1646 | for (i = 0; info->partitions[i].name; i++) { |
- | ||
1647 | if (!strcmp(info->partitions[i].name, "firmware")) |
- | ||
1648 | { |
- | ||
1649 | firmware_partition = &info->partitions[i]; |
- | ||
1650 | firmware_partition_index = i; |
- | ||
1651 | } |
- | ||
1652 | } |
- | ||
1653 | |
- | ||
1654 | if (firmware_partition) |
- | ||
1655 | { |
- | ||
1656 | os_image_partition = &info->partitions[firmware_partition_index]; |
- | ||
1657 | file_system_partition = &info->partitions[firmware_partition_index + 1]; |
- | ||
1658 | |
- | ||
1659 | struct stat kernel; |
- | ||
1660 | if (stat(kernel_image, &kernel) < 0) |
- | ||
1661 | error(1, errno, "unable to stat file `%s'", kernel_image); |
- | ||
1662 | |
- | ||
1663 | if (kernel.st_size > firmware_partition->size) |
- | ||
1664 | error(1, 0, "kernel overflowed firmware partition\n"); |
- | ||
1665 | |
- | ||
1666 | for (i = MAX_PARTITIONS-1; i >= firmware_partition_index + 1; i--) |
- | ||
1667 | info->partitions[i+1] = info->partitions[i]; |
- | ||
1668 | |
- | ||
1669 | file_system_partition->name = "file-system"; |
- | ||
1670 | file_system_partition->base = firmware_partition->base + kernel.st_size; |
- | ||
1671 | |
- | ||
1672 | /* Align partition start to erase blocks for factory images only */ |
- | ||
1673 | if (!sysupgrade) |
- | ||
1674 | file_system_partition->base = ALIGN(firmware_partition->base + kernel.st_size, 0x10000); |
- | ||
1675 | |
- | ||
1676 | file_system_partition->size = firmware_partition->size - file_system_partition->base; |
- | ||
1677 | |
- | ||
1678 | os_image_partition->name = "os-image"; |
- | ||
1679 | os_image_partition->size = kernel.st_size; |
- | ||
1680 | } |
1462 | struct image_partition_entry parts[7] = {}; |
|
1681 | |
1463 | |
|
1682 | parts[0] = make_partition_table(info->partitions); |
1464 | parts[0] = make_partition_table(info->partitions); |
|
1683 | if (info->soft_ver) |
1465 | if (info->soft_ver) |
|
1684 | parts[1] = make_soft_version_from_string(info->soft_ver); |
1466 | parts[1] = make_soft_version_from_string(info->soft_ver); |
|
Line 1685... | Line 1467... | |||
1685 | else |
1467 | else |
|
1686 | parts[1] = make_soft_version(rev); |
1468 | parts[1] = make_soft_version(rev); |
|
1687 | |
1469 | |
|
Line 1688... | Line 1470... | |||
1688 | parts[2] = make_support_list(info); |
1470 | parts[2] = make_support_list(info); |
|
1689 | parts[3] = read_file("os-image", kernel_image, false, NULL); |
1471 | parts[3] = read_file("os-image", kernel_image, false); |
|
1690 | parts[4] = read_file("file-system", rootfs_image, add_jffs2_eof, file_system_partition); |
- | ||
1691 | |
- | ||
1692 | /* Some devices need the extra-para partition to accept the firmware */ |
1472 | parts[4] = read_file("file-system", rootfs_image, add_jffs2_eof); |
|
1693 | if (strcasecmp(info->id, "ARCHER-C2-V3") == 0 || |
1473 | |
|
1694 | strcasecmp(info->id, "ARCHER-C25-V1") == 0 || |
1474 | /* Some devices need the extra-para partition to accept the firmware */ |
|
1695 | strcasecmp(info->id, "ARCHER-C59-V2") == 0 || |
1475 | if (strcasecmp(info->id, "ARCHER-C25-V1") == 0 || |
|
1696 | strcasecmp(info->id, "ARCHER-C60-V2") == 0 || |
1476 | strcasecmp(info->id, "ARCHER-C60-V2") == 0 || |
|
1697 | strcasecmp(info->id, "TLWR1043NV5") == 0) { |
1477 | strcasecmp(info->id, "TLWR1043NV5") == 0) { |
|
1698 | const char mdat[11] = {0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00}; |
1478 | const char mdat[11] = {0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00}; |
|
1699 | parts[5] = put_data("extra-para", mdat, 11); |
- | ||
1700 | } else if (strcasecmp(info->id, "ARCHER-A7-V5") == 0 || strcasecmp(info->id, "ARCHER-C7-V4") == 0 || strcasecmp(info->id, "ARCHER-C7-V5") == 0) { |
- | ||
1701 | const char mdat[11] = {0x01, 0x00, 0x00, 0x02, 0x00, 0x00, 0xca, 0x00, 0x01, 0x00, 0x00}; |
- | ||
1702 | parts[5] = put_data("extra-para", mdat, 11); |
1479 | parts[5] = put_data("extra-para", mdat, 11); |
|
Line 1703... | Line 1480... | |||
1703 | } else if (strcasecmp(info->id, "ARCHER-C6-V2") == 0) { |
1480 | } else if (strcasecmp(info->id, "ARCHER-C7-V4") == 0 || strcasecmp(info->id, "ARCHER-C7-V5") == 0) { |
|
1704 | const char mdat[11] = {0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00}; |
1481 | const char mdat[11] = {0x01, 0x00, 0x00, 0x02, 0x00, 0x00, 0xca, 0x00, 0x01, 0x00, 0x00}; |
|
1705 | parts[5] = put_data("extra-para", mdat, 11); |
1482 | parts[5] = put_data("extra-para", mdat, 11); |
|
Line 1721... | Line 1498... | |||
1721 | |
1498 | |
|
Line 1722... | Line 1499... | |||
1722 | fclose(file); |
1499 | fclose(file); |
|
Line -... | Line 1500... | |||
- | 1500 | |
||
1723 | |
1501 | free(image); |
|
1724 | free(image); |
1502 | |
|
1725 | |
1503 | size_t i; |
|
Line 1726... | Line 1504... | |||
1726 | for (i = 0; parts[i].name; i++) |
1504 | for (i = 0; parts[i].name; i++) |
|
Line 1750... | Line 1528... | |||
1750 | argv0 |
1528 | argv0 |
|
1751 | ); |
1529 | ); |
|
1752 | }; |
1530 | }; |
|
Line 1753... | Line 1531... | |||
1753 | |
1531 | |
|
1754 | |
1532 | |
|
1755 | static struct device_info *find_board(const char *id) |
1533 | static const struct device_info *find_board(const char *id) |
|
Line 1756... | Line 1534... | |||
1756 | { |
1534 | { |
|
1757 | struct device_info *board = NULL; |
1535 | struct device_info *board = NULL; |
|
Line 1782... | Line 1560... | |||
1782 | if (ptr == max_entries) { |
1560 | if (ptr == max_entries) { |
|
1783 | error(1, 0, "No free flash part entry available."); |
1561 | error(1, 0, "No free flash part entry available."); |
|
1784 | } |
1562 | } |
|
Line 1785... | Line 1563... | |||
1785 | |
1563 | |
|
1786 | part_list->name = calloc(1, strlen(name) + 1); |
- | ||
1787 | if (!part_list->name) { |
- | ||
1788 | error(1, 0, "Unable to allocate memory"); |
- | ||
1789 | } |
- | ||
1790 | |
1564 | part_list->name = calloc(1, strlen(name) + 1); |
|
1791 | memcpy((char *)part_list->name, name, strlen(name)); |
1565 | memcpy((char *)part_list->name, name, strlen(name)); |
|
1792 | part_list->base = base; |
1566 | part_list->base = base; |
|
Line 1793... | Line 1567... | |||
1793 | part_list->size = size; |
1567 | part_list->size = size; |
|
Line 2084... | Line 1858... | |||
2084 | int main(int argc, char *argv[]) { |
1858 | int main(int argc, char *argv[]) { |
|
2085 | const char *board = NULL, *kernel_image = NULL, *rootfs_image = NULL, *output = NULL; |
1859 | const char *board = NULL, *kernel_image = NULL, *rootfs_image = NULL, *output = NULL; |
|
2086 | const char *extract_image = NULL, *output_directory = NULL, *convert_image = NULL; |
1860 | const char *extract_image = NULL, *output_directory = NULL, *convert_image = NULL; |
|
2087 | bool add_jffs2_eof = false, sysupgrade = false; |
1861 | bool add_jffs2_eof = false, sysupgrade = false; |
|
2088 | unsigned rev = 0; |
1862 | unsigned rev = 0; |
|
2089 | struct device_info *info; |
1863 | const struct device_info *info; |
|
2090 | set_source_date_epoch(); |
1864 | set_source_date_epoch(); |
|
Line 2091... | Line 1865... | |||
2091 | |
1865 | |
|
2092 | while (true) { |
1866 | while (true) { |