]> hackdaworld.org Git - my-code/arm.git/commitdiff
parsinf 05 records now too, still strabge bootloader returns to the go cmd!
authorhackbard <hackbard@staubsauger.localdomain>
Thu, 30 Aug 2007 15:12:18 +0000 (17:12 +0200)
committerhackbard <hackbard@staubsauger.localdomain>
Thu, 30 Aug 2007 15:12:18 +0000 (17:12 +0200)
betty/lpcload.c

index 6c167e27082cfd355f1b47e884ed2f67e4e213b7..30a808ec6ef8cb2baa6afda566e8a646303c3b9d 100644 (file)
@@ -60,6 +60,7 @@ typedef struct s_lpc {
        u8 info;                /* info/mode */
        char freq[8];           /* frequency */
        u32 roff;               /* ram offset of uc */
+       u32 jaddr;              /* addr for the jump */
 } t_lpc;
 
 void usage(void) {
@@ -311,7 +312,7 @@ int go(t_lpc *lpc) {
        char buf[BUFSIZE];
        int ret,len;
 
-       snprintf(buf,BUFSIZE,"G %d A\r\n",lpc->roff);
+       snprintf(buf,BUFSIZE,"G %d A\r\n",lpc->jaddr);
        len=strlen(buf);
        ret=txrx(lpc,buf,len,TXRX_TYPE_GO);
 
@@ -476,6 +477,10 @@ int firmware_to_ram(t_lpc *lpc) {
                        case 0x04:
                                lpc->roff=((buf[0]<<24)|(buf[1]<<16));
                                break;
+                       case 0x05:
+                               lpc->jaddr=((buf[0]<<24)|(buf[1]<<16));
+                               lpc->jaddr|=((buf[2]<<8)|buf[3]);
+                               break;
                        default:
                                printf("fw to ram: unknown type %02x\n",type);
                                return -1;
@@ -498,6 +503,7 @@ int main(int argc,char **argv) {
        memset(&lpc,0,sizeof(t_lpc));
        strncpy(lpc.freq,CRYSTFREQ,7);
        lpc.roff=RAMOFFSET;
+       lpc.jaddr=RAMOFFSET;
 
        /* parse argv */