mirror of
https://github.com/fail0verflow/mini.git
synced 2024-11-17 08:59:28 +01:00
Geckoloader cleanup, use non-lame CMDs.
Rebuild and install your bootmii clients!
This commit is contained in:
parent
5470c9a124
commit
b899ab76f8
25
gecko.c
25
gecko.c
@ -246,6 +246,9 @@ int gecko_printf(const char *fmt, ...)
|
|||||||
|
|
||||||
#define GECKO_BUFFER_MAX (20 * 1024 * 1024)
|
#define GECKO_BUFFER_MAX (20 * 1024 * 1024)
|
||||||
|
|
||||||
|
#define GECKO_CMD_BIN_ARM 0x4241524d
|
||||||
|
#define GECKO_CMD_BIN_PPC 0x42505043
|
||||||
|
|
||||||
static u32 _gecko_cmd = 0;
|
static u32 _gecko_cmd = 0;
|
||||||
static u32 _gecko_cmd_start_time = 0;
|
static u32 _gecko_cmd_start_time = 0;
|
||||||
static u32 _gecko_state = GECKO_STATE_NONE;
|
static u32 _gecko_state = GECKO_STATE_NONE;
|
||||||
@ -277,24 +280,22 @@ void gecko_timer(void) {
|
|||||||
_gecko_cmd |= b;
|
_gecko_cmd |= b;
|
||||||
|
|
||||||
switch (_gecko_cmd) {
|
switch (_gecko_cmd) {
|
||||||
// upload powerpc ELF
|
case GECKO_CMD_BIN_ARM:
|
||||||
case 0x43524150:
|
|
||||||
_gecko_state = GECKO_STATE_RECEIVE_BUFFER_SIZE;
|
_gecko_state = GECKO_STATE_RECEIVE_BUFFER_SIZE;
|
||||||
_gecko_receive_len = 0;
|
_gecko_receive_len = 0;
|
||||||
_gecko_receive_left = 4;
|
_gecko_receive_left = 4;
|
||||||
_gecko_receive_buffer = (u8 *) 0x10100000;
|
_gecko_receive_buffer = (u8 *) 0x0; // yarly
|
||||||
|
|
||||||
irq_set_alarm(1, 0);
|
irq_set_alarm(1, 0);
|
||||||
_gecko_cmd_start_time = read32(HW_TIMER);
|
_gecko_cmd_start_time = read32(HW_TIMER);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// upload ARM ELF
|
case GECKO_CMD_BIN_PPC:
|
||||||
case 0x5a4f4d47:
|
|
||||||
_gecko_state = GECKO_STATE_RECEIVE_BUFFER_SIZE;
|
_gecko_state = GECKO_STATE_RECEIVE_BUFFER_SIZE;
|
||||||
_gecko_receive_len = 0;
|
_gecko_receive_len = 0;
|
||||||
_gecko_receive_left = 4;
|
_gecko_receive_left = 4;
|
||||||
_gecko_receive_buffer = (u8 *) 0x0; // yarly
|
_gecko_receive_buffer = (u8 *) 0x10100000;
|
||||||
|
|
||||||
irq_set_alarm(1, 0);
|
irq_set_alarm(1, 0);
|
||||||
_gecko_cmd_start_time = read32(HW_TIMER);
|
_gecko_cmd_start_time = read32(HW_TIMER);
|
||||||
@ -346,15 +347,15 @@ void gecko_timer(void) {
|
|||||||
|
|
||||||
// done receiving, handle the command
|
// done receiving, handle the command
|
||||||
switch (_gecko_cmd) {
|
switch (_gecko_cmd) {
|
||||||
case 0x43524150:
|
case GECKO_CMD_BIN_ARM:
|
||||||
ipc_enqueue_slow(IPC_DEV_PPC, IPC_PPC_BOOT, 3,
|
|
||||||
1, (u32) 0x10100000, _gecko_receive_len);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 0x5a4f4d47:
|
|
||||||
// skip headerlen, which is stored at u32[0]
|
// skip headerlen, which is stored at u32[0]
|
||||||
ipc_enqueue_slow(IPC_DEV_SYS, IPC_SYS_JUMP, 1, ((u32 *) 0x0)[0]);
|
ipc_enqueue_slow(IPC_DEV_SYS, IPC_SYS_JUMP, 1, ((u32 *) 0x0)[0]);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case GECKO_CMD_BIN_PPC:
|
||||||
|
ipc_enqueue_slow(IPC_DEV_PPC, IPC_PPC_BOOT, 3,
|
||||||
|
1, (u32) 0x10100000, _gecko_receive_len);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
|
Loading…
Reference in New Issue
Block a user