#ifdef CYGPKG_REDBOOT_NETWORKING
// Redboot network based commands
RedBoot_cmd(
- "ceconnect",
- "Set up a connection to the CE host PC over TCP/IP and download the run-time image",
- "[-v] [-t <timeout>] [-h <host>]",
- ce_load
- );
+ "ceconnect",
+ "Set up a connection to the CE host PC over TCP/IP and download the run-time image",
+ "[-v] [-t <timeout>] [-h <host>]",
+ ce_load
+ );
#endif
///////////////////////////////////////////////////////////////////////////////////////////////
{
if (imglen < CE_BIN_SIGN_LEN) {
diag_printf("Not a valid CE image: image size %u shorter than minimum %u\n",
- imglen, CE_BIN_SIGN_LEN);
+ imglen, CE_BIN_SIGN_LEN);
return 0;
}
if (is_rom_addr(image)) {
void *err_addr;
if (flash_read(image, sign_buf,
- CE_BIN_SIGN_LEN, &err_addr) != FLASH_ERR_OK) {
+ CE_BIN_SIGN_LEN, &err_addr) != FLASH_ERR_OK) {
return 0;
}
return memcmp(sign_buf, CE_BIN_SIGN, CE_BIN_SIGN_LEN) == 0;
void *err_addr;
if (flash_read(pbData, &bin->parsePtr[bin->parseLen],
- copyLen, &err_addr) != FLASH_ERR_OK) {
+ copyLen, &err_addr) != FLASH_ERR_OK) {
return CE_PR_ERROR;
}
} else {
bin->rtiPhysAddr = CE_FIX_ADDRESS(bin->rtiPhysAddr);
if (!is_ram_addr(bin->rtiPhysAddr)) {
diag_printf("Invalid address %08lx in CE_PS_RTI_ADDR section\n",
- bin->rtiPhysAddr);
+ bin->rtiPhysAddr);
return CE_PR_ERROR;
}
} else if (bin->parseState == CE_PS_E_ADDR) {
bin->ePhysAddr = CE_FIX_ADDRESS(bin->ePhysAddr);
if (!is_ram_addr(bin->ePhysAddr)) {
diag_printf("Invalid address %08lx in CE_PS_E_ADDR section\n",
- bin->ePhysAddr);
+ bin->ePhysAddr);
return CE_PR_ERROR;
}
}
void *err_addr;
if (flash_read(pbData, bin->parsePtr,
- copyLen, &err_addr) != FLASH_ERR_OK) {
+ copyLen, &err_addr) != FLASH_ERR_OK) {
return CE_PR_ERROR;
}
pbData += copyLen;
// Lookup entry point
header = (ce_rom_hdr*)CE_FIX_ADDRESS(*(unsigned int*)(bin->rtiPhysAddr +
- ROM_SIGNATURE_OFFSET +
- sizeof(unsigned int)));
+ ROM_SIGNATURE_OFFSET +
+ sizeof(unsigned int)));
tentry = (ce_toc_entry*)(header + 1);
for (i = 0; i < header->nummods; i++) {
std_drv_glb->header.bspVersion = 1;
std_drv_glb->kitl.flags = 0;
- diag_sprintf(std_drv_glb->deviceId, "Triton");
+ diag_sprintf(std_drv_glb->deviceId, "Triton");
#ifdef CYGPKG_REDBOOT_NETWORKING
memcpy(&std_drv_glb->kitl.mac[0], __local_enet_addr, sizeof(__local_enet_addr));
if (verbose) {
if (use_timeout) {
diag_printf("Waiting for connection, timeout %d sec\n",
- timeout);
+ timeout);
} else {
diag_printf("Waiting for connection, enter ^C to abort\n");
}
// Receive UDP packet
net->dataLen = __udp_recvfrom(net->data, sizeof(net->data), &net->srvAddrRecv,
- &net->locAddr, &timeo);
+ &net->locAddr, &timeo);
if (net->dataLen < 0) {
// Error! No data available
// Some diag output ...
if (net->verbose) {
diag_printf("Sending BOOTME request [%d] to %s\n",
- net->secNum,
- inet_ntoa((in_addr_t *)&net->srvAddrSend));
+ net->secNum,
+ inet_ntoa((in_addr_t *)&net->srvAddrSend));
}
// Send packet
int ret = CE_PR_MORE;
if (net->dataLen >= 2) {
- switch (ntohs(*(unsigned short*)net->data)) {
+ unsigned short *wdata = (unsigned short*)net->data;
+ switch (ntohs(*wdata)) {
case EDBG_CMD_WRITE_REQ:
if (!net->link) {
// Check file name for WRITE request
// Some diag output
if (net->verbose) {
diag_printf("Locked Down download link, IP: %s, port: %d\n",
- inet_ntoa((in_addr_t *)&net->srvAddrRecv),
- net->srvAddrRecv.sin_port);
+ inet_ntoa((in_addr_t *)&net->srvAddrRecv),
+ net->srvAddrRecv.sin_port);
}
// Lock down EShell download link
ce_send_frame(net);
}
#endif
-