* Implement and test direct file FIASCO flash - openfiasco receives options for grepping for pieces and be verbose - fixed flashing order using grep options xloader, secondary, kernel, initfs, rootfs - Tested and working - Added parser for the hw revision string

* Autodetect device hw revision and setup the subversion string
  on the fly.
This commit is contained in:
pancake committed 2008-12-08 18:13:36 +01:00
1 parent 3d427bfd77
commit 5a96158322
7 files changed
+101 -37

No files matched your search

+11 -10
View File
@@ -134,27 +134,28 @@ int set_rd_mode(unsigned short mode)
/*
* query root device
*/
int get_hw_revision()
int get_hw_revision(char *str, int len)
{
unsigned char string[512];
int i = 0;
char tmpstr[64];
int i = 0, j=0, mod=0;
if (str == NULL)
str = tmpstr;
memset(string,'\0',512);
if (usb_control_msg(dev, CMD_QUERY, NOLO_GET_HWVERSION, 0, 0, (char *)string, 512, 2000) == -1) {
fprintf(stderr, "Cannot query hw revision.\n");
return -1;
}
printf("HW revision string: '");
for(i=0;i<44;i++) { // XXX ??
if (string[i]==0) {
printf(" ");
} else {
if (string[i]>19)
printf("%c", string[i]);
for(i=0;i<44&&i<len;i++) { // XXX ??
if (string[i]>19) {
if (i>0 && string[i-1]<19)
str[j++] = (++mod%2)?':':',';
str[j++] = string[i];
}
}
printf("'\n");
printf("HW revision string: '%s'\n", str);
return 0;
}