Subversion Repositories freemyipod

Rev

Rev 85 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 85 Rev 92
Line 31... Line 31...
31
#include "util.h"
31
#include "util.h"
32
#include "contextswitch.h"
32
#include "contextswitch.h"
33
#include "power.h"
33
#include "power.h"
34
#include "mmu.h"
34
#include "mmu.h"
35
#include "shutdown.h"
35
#include "shutdown.h"
-
 
36
#include "execimage.h"
36
#ifdef HAVE_I2C
37
#ifdef HAVE_I2C
37
#include "i2c.h"
38
#include "i2c.h"
38
#endif
39
#endif
39
 
40
 
40
 
41
 
Line 51... Line 52...
51
    DBGACTION_I2CRECV,
52
    DBGACTION_I2CRECV,
52
    DBGACTION_RESET,
53
    DBGACTION_RESET,
53
    DBGACTION_POWEROFF,
54
    DBGACTION_POWEROFF,
54
    DBGACTION_CWRITE,
55
    DBGACTION_CWRITE,
55
    DBGACTION_CREAD,
56
    DBGACTION_CREAD,
56
    DBGACTION_CFLUSH
57
    DBGACTION_CFLUSH,
-
 
58
    DBGACTION_EXECIMAGE
57
};
59
};
58
 
60
 
59
static uint32_t dbgstack[0x100] STACK_ATTR;
61
static uint32_t dbgstack[0x100] STACK_ATTR;
60
struct wakeup dbgwakeup IBSS_ATTR;
62
struct wakeup dbgwakeup IBSS_ATTR;
61
extern struct scheduler_thread* scheduler_threads;
63
extern struct scheduler_thread* scheduler_threads;
Line 505... Line 507...
505
            clean_dcache();
507
            clean_dcache();
506
            invalidate_icache();
508
            invalidate_icache();
507
            dbgsendbuf[0] = 1;
509
            dbgsendbuf[0] = 1;
508
            size = 16;
510
            size = 16;
509
            break;
511
            break;
-
 
512
        case 21:  // EXECIMAGE
-
 
513
            if (set_dbgaction(DBGACTION_EXECIMAGE, 0)) break;
-
 
514
            dbgactionaddr = dbgrecvbuf[1];
-
 
515
            break;
510
        default:
516
        default:
511
            dbgsendbuf[0] = 2;
517
            dbgsendbuf[0] = 2;
512
            size = 16;
518
            size = 16;
513
        }
519
        }
514
        usb_setup_dbg_listener();
520
        usb_setup_dbg_listener();
Line 588... Line 594...
588
            case DBGACTION_CFLUSH:
594
            case DBGACTION_CFLUSH:
589
                cflush(dbgactionconsoles);
595
                cflush(dbgactionconsoles);
590
                dbgasyncsendbuf[0] = 1;
596
                dbgasyncsendbuf[0] = 1;
591
                usb_drv_send_nonblocking(dbgendpoints[1], dbgasyncsendbuf, 16);
597
                usb_drv_send_nonblocking(dbgendpoints[1], dbgasyncsendbuf, 16);
592
                break;
598
                break;
-
 
599
            case DBGACTION_EXECIMAGE:
-
 
600
                dbgasyncsendbuf[0] = 1;
-
 
601
                dbgasyncsendbuf[1] = execimage((void*)dbgactionaddr);
-
 
602
                usb_drv_send_nonblocking(dbgendpoints[1], dbgasyncsendbuf, 16);
-
 
603
                break;
593
            }
604
            }
594
            dbgaction = DBGACTION_IDLE;
605
            dbgaction = DBGACTION_IDLE;
595
        }
606
        }
596
    }
607
    }
597
}
608
}