puts(" memread <hex-length> <hex-address>");
puts(" memdump <hex-length> <hex-address> <file>");
puts(" memload <hex-address> <file>");
+ puts(" jump <hex-address");
puts(" flashloader");
puts(" romloader");
puts(" ping");
length = msgb_get_u8(msg);
address = msgb_get_u32(msg);
break;
+ case LOADER_JUMP:
+ address = msgb_get_u32(msg);
+ break;
default:
printf("Received unknown reply %d:\n", cmd);
hexdump(msg->data, msg->len);
case LOADER_MEM_WRITE:
printf("Confirmed memory write of %d bytes at 0x%x.\n", length, address);
break;
+ case LOADER_JUMP:
+ printf("Confirmed jump to 0x%x.\n", address);
+ break;
default:
break;
}
osmoload.command = LOADER_MEM_WRITE;
}
+static void
+loader_send_jump(uint32_t address) {
+ struct msgb *msg = msgb_alloc(MSGB_MAX, "loader");
+ msgb_put_u8(msg, LOADER_JUMP);
+ msgb_put_u32(msg, address);
+ loader_send_request(msg);
+ msgb_free(msg);
+
+ osmoload.operation = OPERATION_QUERY;
+ osmoload.command = LOADER_JUMP;
+}
+
+
#define MEM_MSG_MAX (MSGB_MAX - 16)
static void
address = strtoul(cmdv[1], NULL, 16);
loader_start_memload(address, cmdv[2]);
+ } else if(!strcmp(cmd, "jump")) {
+ uint32_t address;
+
+ if(cmdc < 2) {
+ usage(name);
+ }
+
+ address = strtoul(cmdv[1], NULL, 16);
+
+ loader_send_jump(address);
} else if(!strcmp(cmd, "memwrite")) {
loader_send_memwrite(128, 0x810000, buf);
} else if(!strcmp(cmd, "off")) {
#include <keypad.h>
#include <board.h>
#include <console.h>
+#include <manifest.h>
#include <abb/twl3025.h>
#include <rf/trf6151.h>
entry();
}
+static void device_jump(void *entry) {
+ flush_uart();
+
+ void (*f)( void ) = (void (*)(void))entry;
+ f();
+}
+
static void
loader_send_simple(uint8_t dlci, uint8_t command) {
struct msgb *msg = sercomm_alloc_msgb(1);
puts("\n\nOSMOCOM Calypso loader (revision " GIT_REVISION ")\n");
puts(hr);
+ /* Identify environment */
+ printf("Running on %s in environment %s\n", target_board, target_environment);
+
/* Set up a key handler for powering off */
keypad_set_handler(&key_handler);
break;
+ case LOADER_JUMP:
+
+ address = msgb_get_u32(msg);
+
+ printf("jump to 0x%x\n", address);
+
+ reply = sercomm_alloc_msgb(5);
+
+ if(!reply) {
+ printf("Failed to allocate reply buffer!\n");
+ }
+
+ msgb_put_u8(reply, LOADER_JUMP);
+ msgb_put_u32(reply, address);
+
+ sercomm_sendmsg(dlci, reply);
+
+ device_jump((void*)address);
+
+ break;
+
+ default:
+ printf("unknown command\n", command);
+ break;
+
}
msgb_free(msg);