Changeset 12321
- Timestamp:
- 06/19/09 15:16:14 (4 years ago)
- Location:
- ar5315_microredboot/microredboot
- Files:
-
- 3 edited
-
CHANGELOG (modified) (1 diff)
-
boot/src/Makefile (modified) (1 diff)
-
boot/src/misc_lzma.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
ar5315_microredboot/microredboot/CHANGELOG
r12320 r12321 1 1 19.6.09 2 * AR5312/AR2313: nor flash support for erasing nvram on reset button long push (untested) 2 3 * AR5312/AR2313: add support for 32MB ram chips (auto detection) 3 4 * most nor flash chips should be supported, but no guarantee. redboot will display the required ID's for implementation -
ar5315_microredboot/microredboot/boot/src/Makefile
r12319 r12321 108 108 sed "$(SEDFLAGS)" < ld.script.in > $@ 109 109 110 clean:; rm -f payload* ld.script *.o lib/*.o110 clean:; rm -f payload* ld.script *.o *.c~ *.h~ lib/*.o 111 111 112 112 .PHONY: clean -
ar5315_microredboot/microredboot/boot/src/misc_lzma.c
r12320 r12321 651 651 return; 652 652 } 653 printf("erasing nvram at [0x%08X]\n", flashbase +nvramdetect);653 printf("erasing nvram at [0x%08X]\n", nvramdetect); 654 654 655 655 ptr_opcode = &stm_opcodes[SPI_SECTOR_ERASE]; … … 698 698 699 699 } 700 #else 701 702 static int flash_erase_nvram(unsigned int flashsize, unsigned int blocksize) 703 { 704 int i, ticks; 705 unsigned short val; 706 if (!nvramdetect) { 707 puts("nvram can and will not erased, since nvram was not detected on this device (maybe dd-wrt isnt installed)!\n"); 708 return; 709 } 710 printf("erasing nvram at [0x%08X]\n", nvramdetect); 711 volatile unsigned short *block = (unsigned short *)nvramdetect; 712 volatile unsigned short *p555 = 713 (unsigned short *)((unsigned long)flashbase + 0x0aaa); 714 volatile unsigned short *p2aa = 715 (unsigned short *)((unsigned long)flashbase + 0x0554); 716 717 *block = 0xf0; /* Make sure in read state */ 718 *p555 = 0xaa; 719 *p2aa = 0x55; 720 *p555 = 0x80; 721 *p555 = 0xaa; 722 *p2aa = 0x55; 723 *block = 0x30; 724 for (ticks = 0, i = 0;; i++) { 725 val = *block; 726 727 /* When Erase operation is completed, DQ7 will produce 1 "1". 728 and DQ6 stops toggling. */ 729 if ((val & 0x80) == 0x80) { 730 731 // Check DQ6 toggle 732 unsigned short s_val; 733 734 // Read the second time. 735 s_val = *block; 736 if ((s_val & 0x80) && (s_val & 0x40) == (val & 0x40)) { 737 *block = 0xf0; /* Do reset */ 738 puts("erase successfull!\n"); 739 return 0; 740 } 741 } 742 743 else { 744 if (i >= 1024) { 745 i = 0; 746 if (++ticks > 7 * 100 * 10) { 747 break; 748 } 749 } 750 } 751 } 752 *block = 0xf0; /* Do reset */ 753 puts("erase failed!\n"); 754 return -1; 755 } 756 700 757 #endif 701 758 struct nvram_header { … … 795 852 if (resetTouched() || (resetbutton && !strcmp(resetbutton, "1"))) { 796 853 puts("Reset Button triggered\nBooting Recovery RedBoot\n"); 797 #ifndef AR5312 854 798 855 int count = 5; 799 856 while (count--) { … … 804 861 if (count <= 0) { 805 862 puts("reset button 5 seconds pushed, erasing nvram\n"); 863 864 #ifndef AR5312 806 865 if (!flashdetect()) 866 #endif 807 867 flash_erase_nvram(flashsize, sectorsize); 808 868 } 809 #endif810 869 811 870 bootoffset = 0x800004bc;
Note: See TracChangeset
for help on using the changeset viewer.
