3 #include CYGHWR_MEMORY_LAYOUT_H
9 ///////////////////////////////////////////////////////////////////////////////////////////////
13 #define CE_RAM_BASE CYGMEM_REGION_ram
14 #define CE_RAM_SIZE CYGMEM_REGION_ram_SIZE
15 #define CE_RAM_END (CE_RAM_BASE + CE_RAM_SIZE)
16 #define CE_WINCE_VRAM_BASE 0x80000000
17 #define CE_FIX_ADDRESS(a) (((a) - CE_WINCE_VRAM_BASE) + CE_RAM_BASE)
19 // Bin image parse states
20 #define CE_PS_RTI_ADDR 0
21 #define CE_PS_RTI_LEN 1
22 #define CE_PS_E_ADDR 2
24 #define CE_PS_E_CHKSUM 4
25 #define CE_PS_E_DATA 5
28 #define CE_MIN(a, b) (((a) < (b)) ? (a) : (b))
29 #define CE_MAX(a, b) (((a) > (b)) ? (a) : (b))
33 #define STRMAC(s) _STRMAC(s)
35 ///////////////////////////////////////////////////////////////////////////////////////////////
38 unsigned int rtiPhysAddr;
39 unsigned int rtiPhysLen;
40 unsigned int ePhysAddr;
41 unsigned int ePhysLen;
44 unsigned int eEntryPoint;
45 unsigned int eRamStart;
49 unsigned char parseState;
50 unsigned int parseChkSum;
52 unsigned char *parsePtr;
61 edbg_os_config_data edbgConfig;
67 struct sockaddr_in locAddr;
68 struct sockaddr_in srvAddrSend;
69 struct sockaddr_in srvAddrRecv;
70 bool gotJumpingRequest;
72 unsigned short blockNum;
74 unsigned char data[516];
77 ///////////////////////////////////////////////////////////////////////////////////////////////
79 #ifdef CYGPKG_REDBOOT_NETWORKING
85 #ifdef CYGPKG_HAL_ARM_XSCALE_TRITON270_EQT32
86 #include <cyg/hal/hal_triton270.h>
90 ///////////////////////////////////////////////////////////////////////////////////////////////
93 void ce_init_bin(ce_bin *bin, unsigned char *dataBuffer);
94 int ce_parse_bin(ce_bin *bin);
95 bool ce_lookup_ep_bin(ce_bin *bin);
96 void ce_prepare_run_bin(ce_bin *bin);
97 void ce_run_bin(ce_bin *bin);
98 void ce_redboot_version(unsigned int *vhigh, unsigned int *vlow);
100 #ifdef CYGPKG_REDBOOT_NETWORKING
101 // Redboot network based routines
102 void ce_shell(int argc, char *argv[]);
103 void ce_init_download_link(ce_net *net, ce_bin *bin, struct sockaddr_in *host_addr, bool verbose);
104 void ce_init_edbg_link(ce_net *net);
105 int ce_send_frame(ce_net *net);
106 int ce_recv_frame(ce_net *net, int timeout);
107 int ce_send_bootme(ce_net *net);
108 int ce_send_write_ack(ce_net *net);
109 int ce_process_download(ce_net *net, ce_bin *bin);
110 void ce_process_edbg(ce_net *net, ce_bin *bin);
114 ///////////////////////////////////////////////////////////////////////////////////////////////
117 #ifdef CYGPKG_REDBOOT_NETWORKING
118 // Redboot network based commands
121 "Set up a connection to the CE host PC over TCP/IP and download the run-time image",
122 "[-v] [-t <timeout>] [-h <host>]",
127 ///////////////////////////////////////////////////////////////////////////////////////////////
130 bool ce_bin_load(void *image, int imglen)
132 ce_init_bin(&g_bin, image);
134 g_bin.dataLen = imglen;
136 if (ce_parse_bin(&g_bin) == CE_PR_EOF) {
137 ce_prepare_run_bin(&g_bin);
144 bool ce_is_bin_image(void *image, int imglen)
146 if (imglen < CE_BIN_SIGN_LEN) {
150 return (memcmp(image, CE_BIN_SIGN, CE_BIN_SIGN_LEN) == 0);
153 void ce_bin_init_parser()
155 // No buffer address by now, will be specified
156 // latter by the ce_bin_parse_next routine
158 ce_init_bin(&g_bin, NULL);
161 int ce_bin_parse_next(void *parseBuffer, int len)
165 g_bin.data = (unsigned char*)parseBuffer;
167 rc = ce_parse_bin(&g_bin);
169 if (rc == CE_PR_EOF) {
170 ce_prepare_run_bin(&g_bin);
176 void ce_init_bin(ce_bin *bin, unsigned char *dataBuffer)
178 memset(bin, 0, sizeof(ce_bin));
180 bin->data = dataBuffer;
181 bin->parseState = CE_PS_RTI_ADDR;
182 bin->parsePtr = (unsigned char*)&bin->rtiPhysAddr;
185 int ce_parse_bin(ce_bin *bin)
187 unsigned char *pbData = bin->data;
188 int pbLen = bin->dataLen;
192 if (bin->binLen == 0) {
193 // Check for the .BIN signature first
195 if (!ce_is_bin_image(pbData, pbLen)) {
196 diag_printf("Error: Invalid or corrupted .BIN image!\n");
201 diag_printf("Loading Windows CE .BIN image ...\n");
205 pbLen -= CE_BIN_SIGN_LEN;
206 pbData += CE_BIN_SIGN_LEN;
210 switch (bin->parseState) {
217 copyLen = CE_MIN(sizeof(unsigned int) - bin->parseLen, pbLen);
219 memcpy(&bin->parsePtr[ bin->parseLen ], pbData, copyLen);
221 bin->parseLen += copyLen;
225 if (bin->parseLen == sizeof(unsigned int)) {
226 if (bin->parseState == CE_PS_RTI_ADDR) {
227 bin->rtiPhysAddr = CE_FIX_ADDRESS(bin->rtiPhysAddr);
228 } else if (bin->parseState == CE_PS_E_ADDR) {
229 if (bin->ePhysAddr) {
230 bin->ePhysAddr = CE_FIX_ADDRESS(bin->ePhysAddr);
236 bin->parsePtr += sizeof(unsigned int);
238 if (bin->parseState == CE_PS_E_DATA) {
239 if (bin->ePhysAddr) {
240 bin->parsePtr = (unsigned char*)(bin->ePhysAddr);
241 bin->parseChkSum = 0;
255 if (bin->ePhysAddr) {
256 copyLen = CE_MIN(bin->ePhysLen - bin->parseLen, pbLen);
257 bin->parseLen += copyLen;
261 bin->parseChkSum += *pbData;
262 *bin->parsePtr ++ = *pbData ++;
265 if (bin->parseLen == bin->ePhysLen) {
266 diag_printf("Section [%02d]: address 0x%08X, size 0x%08X, checksum %s\n",
270 (bin->eChkSum == bin->parseChkSum) ? "ok" : "fail");
272 if (bin->eChkSum != bin->parseChkSum) {
275 diag_printf("Error: Checksum error, corrupted .BIN file!\n");
283 bin->parseState = CE_PS_E_ADDR;
285 bin->parsePtr = (unsigned char*)(&bin->ePhysAddr);
301 if (!ce_lookup_ep_bin(bin)) {
302 diag_printf("Error: entry point not found!\n");
309 diag_printf("Entry point: 0x%08X, address range: 0x%08X-0x%08X\n",
312 bin->rtiPhysAddr + bin->rtiPhysLen);
319 bin->binLen += bin->dataLen;
324 bool ce_lookup_ep_bin(ce_bin *bin)
327 ce_toc_entry *tentry;
331 // Check image Table Of Contents (TOC) signature
333 if (*(unsigned int*)(bin->rtiPhysAddr + ROM_SIGNATURE_OFFSET) != ROM_SIGNATURE) {
334 // Error: Did not find image TOC signature!
340 // Lookup entry point
342 header = (ce_rom_hdr*)CE_FIX_ADDRESS(*(unsigned int*)(bin->rtiPhysAddr +
343 ROM_SIGNATURE_OFFSET +
344 sizeof(unsigned int)));
345 tentry = (ce_toc_entry*)(header + 1);
347 for (i = 0; i < header->nummods; i ++) {
348 // Look for 'nk.exe' module
350 if (strcmp((char*)CE_FIX_ADDRESS(tentry[ i ].fileName), "nk.exe") == 0) {
351 // Save entry point and RAM addresses
353 e32 = (e32_rom*)CE_FIX_ADDRESS(tentry[ i ].e32Offset);
355 bin->eEntryPoint = CE_FIX_ADDRESS(tentry[ i ].loadOffset) + e32->e32_entryrva;
356 bin->eRamStart = CE_FIX_ADDRESS(header->ramStart);
357 bin->eRamLen = header->ramEnd - header->ramStart;
359 // Save driver_globals address
360 // Must follow RAM section in CE config.bib file
364 // RAM 80900000 03200000 RAM
365 // DRV_GLB 83B00000 00001000 RESERVED
368 bin->eDrvGlb = CE_FIX_ADDRESS(header->ramEnd);
374 // Error: Did not find 'nk.exe' module
379 void ce_prepare_run_bin(ce_bin *bin)
381 ce_driver_globals *drv_glb;
383 // Clear os RAM area (if needed)
385 if (1 || bin->edbgConfig.flags & EDBG_FL_CLEANBOOT) {
386 diag_printf("Preparing clean boot ... ");
387 memset((void*)bin->eRamStart, 0, bin->eRamLen);
391 // Prepare driver globals (if needed)
394 drv_glb = (ce_driver_globals*)bin->eDrvGlb;
396 // Fill out driver globals
397 memset(drv_glb, 0, sizeof(ce_driver_globals));
400 drv_glb->signature = DRV_GLB_SIGNATURE;
405 #ifdef CYGPKG_REDBOOT_NETWORKING
406 // Local ethernet MAC address
407 memcpy(drv_glb->macAddr, __local_enet_addr, sizeof(__local_enet_addr));
410 memcpy(&drv_glb->ipAddr, __local_ip_addr, sizeof(__local_ip_addr));
413 memcpy(&drv_glb->ipMask, __local_ip_mask, sizeof(__local_ip_mask));
416 #ifdef CYGSEM_REDBOOT_NETWORKING_USE_GATEWAY
418 memcpy(&drv_glb->ipGate, __local_ip_gate, sizeof(__local_ip_gate));
421 // Local ethernet MAC address
422 memset(drv_glb->macAddr, 0, sizeof(drv_glb->macAddr));
425 memset(&drv_glb->ipAddr, 0, sizeof(drv_glb->ipAddr));
428 memset(&drv_glb->ipMask, 0, sizeof(drv_glb->ipMask));
431 memset(&drv_glb->ipGate, 0, sizeof(drv_glb->ipGate));
432 #endif // CYGPKG_REDBOOT_NETWORKING
433 // EDBG services config
434 memcpy(&drv_glb->edbgConfig, &bin->edbgConfig, sizeof(bin->edbgConfig));
437 #ifdef CYGPKG_HAL_ARM_XSCALE_TRITON270_EQT32
438 // Copy configuration
440 drv_glb->contrastDefault = eedat.lcd_contrast;
441 drv_glb->contrastBand = eedat.lcd_contrast_band;
442 drv_glb->backlight = eedat.lcd_backlight;
443 drv_glb->backlightOffset = eedat.lcd_backlight_offset;
445 memcpy(drv_glb->macAddr, eedat.mac_address, sizeof(drv_glb->macAddr));
449 // Update global RedBoot entry point address
450 // to use with go/run commands
451 entry_address = bin->eEntryPoint;
454 void ce_run_bin(ce_bin *bin)
456 char *argv[] = { "go" };
458 diag_printf("Launching Windows CE ...\n");
460 // Call GO command direcly
464 // Extract version from CYGDAT_REDBOOT_CUSTOM_VERSION macro
465 // Works with versions like 'v2', 'v2.1', '2', '2.1', '2a', '2.1a'
467 void ce_redboot_version(unsigned int *vhigh, unsigned int *vlow)
469 char *pver = ""STRMAC(CYGDAT_REDBOOT_CUSTOM_VERSION);
478 p = pver + strlen(pver) - 1;
481 if (*p >= '0' && *p <= '9') {
482 *ver += ((*p - '0') * pow);
484 } else if (*p == '.') {
497 ///////////////////////////////////////////////////////////////////////////////////////////////
498 // Redboot network based routines
500 #ifdef CYGPKG_REDBOOT_NETWORKING
501 void ce_load(int argc, char *argv[])
503 struct option_info opts[3];
504 bool verbose, use_timeout;
505 int timeout, recv_timeout, ret;
508 struct sockaddr_in host_ip_addr;
510 // Prepare for command line scan
513 init_opts(&opts[0], 'v', false, OPTION_ARG_TYPE_FLG, (void *)&verbose, NULL,
514 "verbose operation");
517 init_opts(&opts[1], 't', true, OPTION_ARG_TYPE_NUM, (void *)&timeout, &use_timeout,
518 "<timeout> - max wait time (#sec) for the connection");
521 init_opts(&opts[2], 'h', true, OPTION_ARG_TYPE_STR, (void *)&host_name, NULL,
522 "<host> - host name or IP address");
524 if (!scan_opts(argc, argv, 1, opts, 3, NULL, 0, "")) {
525 diag_printf("CELOAD - Invalid option specified\n");
529 // Check host IP address (if specified)
530 memset(&host_ip_addr, 0, sizeof(host_ip_addr));
532 if (!_gethostbyname(host_name, (in_addr_t*)&host_ip_addr)) {
533 diag_printf("CELOAD - Invalid host name: %s\n", host_name);
538 // Initialize download link
540 ce_init_download_link(&g_net, &g_bin, &host_ip_addr, verbose);
552 diag_printf("CELOAD - Canceled, timeout\n");
557 if (_rb_gets(&ctemp, 1, 1) == _GETS_CTRLC) {
558 diag_printf("CELOAD - canceled by user\n");
563 if (ce_send_bootme(&g_net)) {
564 diag_printf("CELOAD - error while sending BOOTME request\n");
570 diag_printf("Waiting for connection, timeout %d sec\n",
573 diag_printf("Waiting for connection, enter ^C to abort\n");
578 // Try to receive frame
580 if (ce_recv_frame(&g_net, recv_timeout)) {
581 // Process received data
583 ret = ce_process_download(&g_net, &g_bin);
585 if (ret != CE_PR_MORE) {
588 } else if (use_timeout) {
589 timeout -= recv_timeout;
594 // Try to receive edbg commands from host
596 ce_init_edbg_link(&g_net);
599 diag_printf("Waiting for EDBG commands ...\n");
602 while (ce_recv_frame(&g_net, 3)) {
603 ce_process_edbg(&g_net, &g_bin);
606 // Prepare WinCE image for execution
608 ce_prepare_run_bin(&g_bin);
610 // Launch WinCE, if necessary
612 if (g_net.gotJumpingRequest) {
618 void ce_init_download_link(ce_net *net, ce_bin *bin, struct sockaddr_in *host_addr, bool verbose)
620 // Initialize EDBG link for download
622 memset(net, 0, sizeof(ce_net));
624 net->locAddr.sin_family = AF_INET;
625 memcpy(&net->locAddr.sin_addr, __local_ip_addr, sizeof(__local_ip_addr));
626 net->locAddr.sin_port = htons(EDBG_DOWNLOAD_PORT);
628 net->srvAddrSend.sin_family = AF_INET;
629 net->srvAddrSend.sin_port = htons(EDBG_DOWNLOAD_PORT);
631 net->srvAddrRecv.sin_family = AF_INET;
632 net->srvAddrRecv.sin_port = 0;
634 if (host_addr->sin_addr.s_addr) {
635 // Use specified host address ...
637 net->srvAddrSend.sin_addr = host_addr->sin_addr;
638 net->srvAddrRecv.sin_addr = host_addr->sin_addr;
640 // ... or use default server address
642 net->srvAddrSend.sin_addr = my_bootp_info.bp_siaddr;
643 net->srvAddrRecv.sin_addr = my_bootp_info.bp_siaddr;
646 net->verbose = verbose;
648 // Initialize .BIN parser
650 // net->data + 0 -> Command
651 // net->data + 2 -> Block number
652 // net->data + 4 -> Block data
654 ce_init_bin(bin, net->data + 4);
657 void ce_init_edbg_link(ce_net *net)
659 // Initialize EDBG link for commands
661 net->locAddr.sin_port = htons(EDBG_DOWNLOAD_PORT);
662 net->srvAddrSend.sin_port = htons(EDBG_DOWNLOAD_PORT);
663 net->srvAddrRecv.sin_port = 0;
667 int ce_send_frame(ce_net *net)
671 return __udp_sendto(net->data, net->dataLen, &net->srvAddrSend, &net->locAddr);
674 int ce_recv_frame(ce_net *net, int timeout)
676 struct timeval timeo;
680 timeo.tv_sec = timeout;
683 // Receive UDP packet
685 net->dataLen = __udp_recvfrom(net->data, sizeof(net->data), &net->srvAddrRecv,
686 &net->locAddr, &timeo);
688 if (net->dataLen < 0) {
689 // Error! No data available
696 int ce_send_bootme(ce_net *net)
699 edbg_bootme_data *data;
702 // Fill out BOOTME packet
703 memset(net->data, 0, BOOTME_PKT_SIZE);
705 header = (eth_dbg_hdr*)net->data;
706 data = (edbg_bootme_data*)header->data;
708 header->id = EDBG_ID;
709 header->service = EDBG_SVC_ADMIN;
710 header->flags = EDBG_FL_FROM_DEV;
711 header->seqNum = net->secNum ++;
712 header->cmd = EDBG_CMD_BOOTME;
714 // Get RedBoot version
715 ce_redboot_version(&verHigh, &verLow);
717 data->versionMajor = verHigh;
718 data->versionMinor = verLow;
719 data->cpuId = EDBG_CPU_TYPE_ARM;
720 data->bootmeVer = EDBG_CURRENT_BOOTME_VERSION;
722 data->downloadPort = 0;
725 memcpy(data->macAddr, __local_enet_addr, sizeof(__local_enet_addr));
726 memcpy(&data->ipAddr, __local_ip_addr, sizeof(__local_ip_addr));
728 // Device name string (NULL terminated). Should include
729 // platform and number based on Ether address (e.g. Odo42, CEPCLS2346, etc)
731 // We will use lower MAC address segment to create device name
732 // eg. MAC '00-0C-C6-69-09-05', device name 'Triton05'
734 strcpy(data->platformId, "Triton");
735 diag_sprintf(data->deviceName, "%s%02X", data->platformId, __local_enet_addr[5]);
737 diag_printf("header->id: %08X\r\n", header->id);
738 diag_printf("header->service: %08X\r\n", header->service);
739 diag_printf("header->flags: %08X\r\n", header->flags);
740 diag_printf("header->seqNum: %08X\r\n", header->seqNum);
741 diag_printf("header->cmd: %08X\r\n\r\n", header->cmd);
743 diag_printf("data->versionMajor: %08X\r\n", data->versionMajor);
744 diag_printf("data->versionMinor: %08X\r\n", data->versionMinor);
745 diag_printf("data->cpuId: %08X\r\n", data->cpuId);
746 diag_printf("data->bootmeVer: %08X\r\n", data->bootmeVer);
747 diag_printf("data->bootFlags: %08X\r\n", data->bootFlags);
748 diag_printf("data->svcPort: %08X\r\n\r\n", data->svcPort);
750 diag_printf("data->macAddr: %02X-%02X-%02X-%02X-%02X-%02X-%02X\r\n",
751 (data->macAddr[0] >> 0) & 0xFF,
752 (data->macAddr[0] >> 8) & 0xFF,
753 (data->macAddr[1] >> 0) & 0xFF,
754 (data->macAddr[1] >> 8) & 0xFF,
755 (data->macAddr[2] >> 0) & 0xFF,
756 (data->macAddr[2] >> 8) & 0xFF);
758 diag_printf("data->ipAddr: %d.%d.%d.%d\r\n",
759 (data->ipAddr >> 0) & 0xFF,
760 (data->ipAddr >> 8) & 0xFF,
761 (data->ipAddr >> 16) & 0xFF,
762 (data->ipAddr >> 24) & 0xFF);
764 diag_printf("data->platformId: %s\r\n", data->platformId);
765 diag_printf("data->deviceName: %s\r\n", data->deviceName);
767 // Some diag output ...
769 diag_printf("Sending BOOTME request [%d] to %s\n",
771 inet_ntoa((in_addr_t *)&net->srvAddrSend));
775 net->dataLen = BOOTME_PKT_SIZE;
777 return ce_send_frame(net);
780 int ce_send_write_ack(ce_net *net)
782 unsigned short *wdata = (unsigned short*)net->data;
784 wdata[ 0 ] = htons(EDBG_CMD_WRITE_ACK);
785 wdata[ 1 ] = htons(net->blockNum);
789 return ce_send_frame(net);
792 int ce_process_download(ce_net *net, ce_bin *bin)
794 int ret = CE_PR_MORE;
796 if (net->dataLen >= 2) {
797 switch (ntohs(*(unsigned short*)net->data)) {
798 case EDBG_CMD_WRITE_REQ:
800 // Check file name for WRITE request
801 // CE EShell uses "boot.bin" file name
803 /*diag_printf(">>>>>>>> First Frame, IP: %s, port: %d\n",
804 inet_ntoa((in_addr_t *)&net->srvAddrRecv),
805 net->srvAddrRecv.sin_port);*/
806 if (strncmp((char*)(net->data + 2), "boot.bin", 8) == 0) {
809 diag_printf("Locked Down download link, IP: %s, port: %d\n",
810 inet_ntoa((in_addr_t *)&net->srvAddrRecv),
811 net->srvAddrRecv.sin_port);
814 // Lock down EShell download link
815 net->locAddr.sin_port = htons(EDBG_DOWNLOAD_PORT + 1);
816 net->srvAddrSend.sin_port = net->srvAddrRecv.sin_port;
817 net->srvAddrSend.sin_addr = net->srvAddrRecv.sin_addr;
821 net->srvAddrRecv.sin_port = 0;
826 ce_send_write_ack(net);
830 // LW: is it really intended to fall thru in case of net->link != 0 ?
833 bin->dataLen = net->dataLen - 4;
835 // Parse next block of .bin file
836 ret = ce_parse_bin(bin);
838 // Request next block
839 if (ret != CE_PR_ERROR) {
842 ce_send_write_ack(net);
845 case EDBG_CMD_READ_REQ:
846 // Read requests are not supported
850 // Error condition on the host side
851 diag_printf("Error: unknown error on the host side\n");
862 void ce_process_edbg(ce_net *net, ce_bin *bin)
866 if (net->dataLen < sizeof(eth_dbg_hdr)) {
869 net->srvAddrRecv.sin_port = 0;
873 header = (eth_dbg_hdr*)net->data;
875 if (header->id != EDBG_ID) {
878 net->srvAddrRecv.sin_port = 0;
882 if (header->service != EDBG_SVC_ADMIN) {
892 diag_printf("Locked Down EDBG service link, IP: %s, port: %d\n",
893 inet_ntoa((in_addr_t *)&net->srvAddrRecv),
894 net->srvAddrRecv.sin_port);
897 // Lock down EDBG link
899 net->srvAddrSend.sin_port = net->srvAddrRecv.sin_port;
903 switch (header->cmd) {
904 case EDBG_CMD_JUMPIMG:
905 net->gotJumpingRequest = true;
908 diag_printf("Received JUMPING command\n");
910 // Just pass through and copy CONFIG structure
911 case EDBG_CMD_OS_CONFIG:
912 // Copy config structure
913 memcpy(&bin->edbgConfig, header->data, sizeof(edbg_os_config_data));
915 diag_printf("Received CONFIG command\n");
916 if (bin->edbgConfig.flags & EDBG_FL_DBGMSG) {
917 diag_printf("--> Enabling DBGMSG service, IP: %d.%d.%d.%d, port: %d\n",
918 (bin->edbgConfig.dbgMsgIPAddr >> 0) & 0xFF,
919 (bin->edbgConfig.dbgMsgIPAddr >> 8) & 0xFF,
920 (bin->edbgConfig.dbgMsgIPAddr >> 16) & 0xFF,
921 (bin->edbgConfig.dbgMsgIPAddr >> 24) & 0xFF,
922 (int)bin->edbgConfig.dbgMsgPort);
924 if (bin->edbgConfig.flags & EDBG_FL_PPSH) {
925 diag_printf("--> Enabling PPSH service, IP: %d.%d.%d.%d, port: %d\n",
926 (bin->edbgConfig.ppshIPAddr >> 0) & 0xFF,
927 (bin->edbgConfig.ppshIPAddr >> 8) & 0xFF,
928 (bin->edbgConfig.ppshIPAddr >> 16) & 0xFF,
929 (bin->edbgConfig.ppshIPAddr >> 24) & 0xFF,
930 (int)bin->edbgConfig.ppshPort);
932 if (bin->edbgConfig.flags & EDBG_FL_KDBG) {
933 diag_printf("--> Enabling KDBG service, IP: %d.%d.%d.%d, port: %d\n",
934 (bin->edbgConfig.kdbgIPAddr >> 0) & 0xFF,
935 (bin->edbgConfig.kdbgIPAddr >> 8) & 0xFF,
936 (bin->edbgConfig.kdbgIPAddr >> 16) & 0xFF,
937 (bin->edbgConfig.kdbgIPAddr >> 24) & 0xFF,
938 (int)bin->edbgConfig.kdbgPort);
940 if (bin->edbgConfig.flags & EDBG_FL_CLEANBOOT) {
941 diag_printf("--> Force clean boot\n");
947 diag_printf("Received unknown command: %08X\n", header->cmd);
953 header->flags = EDBG_FL_FROM_DEV | EDBG_FL_ACK;
954 net->dataLen = EDBG_DATA_OFFSET;