summaryrefslogtreecommitdiff
path: root/bootloader/main-e200r-installer.c
diff options
context:
space:
mode:
authorJonathan Gordon <rockbox@jdgordon.info>2007-10-14 11:16:20 +0000
committerJonathan Gordon <rockbox@jdgordon.info>2007-10-14 11:16:20 +0000
commitd777a367ada03574d5f1dbc0428d828cf0f582b6 (patch)
tree7b3c12e94c74d7558f92e67ceaa4fd8734537582 /bootloader/main-e200r-installer.c
parente329a45add38ffeaee8354ffc500adb1e588cb83 (diff)
downloadrockbox-d777a367ada03574d5f1dbc0428d828cf0f582b6.tar.gz
rockbox-d777a367ada03574d5f1dbc0428d828cf0f582b6.zip
clean up the e200r installer app to make it more user friendly
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15104 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'bootloader/main-e200r-installer.c')
-rw-r--r--bootloader/main-e200r-installer.c24
1 files changed, 19 insertions, 5 deletions
diff --git a/bootloader/main-e200r-installer.c b/bootloader/main-e200r-installer.c
index 9b977ca538..c1162c9ebf 100644
--- a/bootloader/main-e200r-installer.c
+++ b/bootloader/main-e200r-installer.c
@@ -35,6 +35,7 @@
35#include <string.h> 35#include <string.h>
36#include "i2c.h" 36#include "i2c.h"
37#include "backlight-target.h" 37#include "backlight-target.h"
38#include "power.h"
38 39
39/* Bootloader version */ 40/* Bootloader version */
40char version[] = APPSVERSION; 41char version[] = APPSVERSION;
@@ -75,6 +76,7 @@ void* main(void)
75 printf("Rockbox e200R installer"); 76 printf("Rockbox e200R installer");
76 printf("Version: %s", version); 77 printf("Version: %s", version);
77 printf(MODEL_NAME); 78 printf(MODEL_NAME);
79 printf("");
78 80
79 i=ata_init(); 81 i=ata_init();
80 disk_init(IF_MV(0)); 82 disk_init(IF_MV(0));
@@ -84,18 +86,21 @@ void* main(void)
84 error(EDISK,num_partitions); 86 error(EDISK,num_partitions);
85 } 87 }
86 pinfo = disk_partinfo(1); 88 pinfo = disk_partinfo(1);
89#if 0 /* not needed in release builds */
87 printf("--- Partition info ---"); 90 printf("--- Partition info ---");
88 printf("start: %x", pinfo->start); 91 printf("start: %x", pinfo->start);
89 printf("size: %x", pinfo->size); 92 printf("size: %x", pinfo->size);
90 printf("type: %x", pinfo->type); 93 printf("type: %x", pinfo->type);
91 printf("reading: %x", (START_SECTOR_OF_ROM + ROMSECTOR_TO_HACK)*512); 94 printf("reading: %x", (START_SECTOR_OF_ROM + ROMSECTOR_TO_HACK)*512);
95#endif
92 ata_read_sectors(IF_MV2(0,) 96 ata_read_sectors(IF_MV2(0,)
93 pinfo->start + START_SECTOR_OF_ROM + ROMSECTOR_TO_HACK, 97 pinfo->start + START_SECTOR_OF_ROM + ROMSECTOR_TO_HACK,
94 1 , sector); 98 1 , sector);
95 crc32 = chksum_crc32 (sector, 512); 99 crc32 = chksum_crc32 (sector, 512);
100#if 0 /* not needed in release builds */
96 printf("--- Hack Status ---"); 101 printf("--- Hack Status ---");
97 printf("Sector checksum: %x", crc32); 102 printf("Sector checksum: %x", crc32);
98 103#endif
99 if ((crc32 == KNOWN_CRC32) && 104 if ((crc32 == KNOWN_CRC32) &&
100 !memcmp(&sector[HACK_OFFSET], knownBytes, 105 !memcmp(&sector[HACK_OFFSET], knownBytes,
101 sizeof(knownBytes)/sizeof(*knownBytes))) 106 sizeof(knownBytes)/sizeof(*knownBytes)))
@@ -106,14 +111,23 @@ void* main(void)
106 ata_write_sectors(IF_MV2(0,) 111 ata_write_sectors(IF_MV2(0,)
107 pinfo->start + START_SECTOR_OF_ROM + ROMSECTOR_TO_HACK, 112 pinfo->start + START_SECTOR_OF_ROM + ROMSECTOR_TO_HACK,
108 1 , sector); 113 1 , sector);
109 printf("Firmware Hacked"); 114 printf("Firmware Unlocked");
110 printf("Proceed to Step 2"); 115 printf("Proceed to Step 2");
111 } 116 }
112 else 117 else
113 printf("Unknown bootloader... aborted"); 118 {
119 printf("Unknown bootloader");
120 printf("Rockbox installer cannot");
121 printf("continue");
122 }
114 GPIOG_OUTPUT_VAL &=~0x80; 123 GPIOG_OUTPUT_VAL &=~0x80;
115 124 printf("");
116 while(1); 125 if (button_hold())
126 printf("Release Hold and");
127 printf("Press any key to shutdown");
128 while(button_read_device() == BUTTON_NONE)
129 ;
130 power_off();
117 return NULL; 131 return NULL;
118} 132}
119 133