// setBoardParam: Set the board Id string, mac addresses, psi size, etc... // int setBoardParam(void) { int bChange = FALSE; int count = 0; PPARAMETER_SETTING tmpPtr = gBoardParam; int memType; while (tmpPtr->promptName != NULL) { count++; tmpPtr++; } getBoardParam(); while (1) { bChange = processPrompt(gBoardParam, count); if (strlen(gBoardParam[3].parameter) != 0) break; printf("Base Mac address is not entered. Try it again!\n"); } if (bChange) { // fill in board id string, psi and mac count nvramData.ulVersion = NVRAM_VERSION_NUMBER; nvramData.ulEnetModeFlag = 0xffffffff; // all ffs for enet mode flag memset(nvramData.szBoardId, 0, NVRAM_BOARD_ID_STRING_LEN); memcpy(nvramData.szBoardId, gBoardParam[0].parameter, NVRAM_BOARD_ID_STRING_LEN); nvramData.ulPsiSize = atoi(gBoardParam[1].parameter); nvramData.ulNumMacAddrs = atoi(gBoardParam[2].parameter); parsehwaddr(gBoardParam[3].parameter, nvramData.ucaBaseMacAddr); // set memory type thing memType = atoi(gBoardParam[4].parameter); kerSysMemoryTypeSet((int) FLASH63XX_ADDR_BOOT_ROM, (char *)&memType, sizeof(int)); if (nvramData.ulPsiSize != NVRAM_PSI_DEFAULT_6345) { printf("Are you REALLY sure persistent storage size is %d?", nvramData.ulPsiSize); if (yesno()) { nvramData.ulPsiSize = NVRAM_PSI_DEFAULT_6345; sprintf(gBoardParam[1].parameter, "%d", nvramData.ulPsiSize); return 0; } } // save the buf to nvram writeNvramData(); printf("Press any key to reset the board: \n"); while (1) if (console_status()) kerSysMipsSoftReset(); } return 0; } // setBoardParam
/* This function should be in a board specific directory. For now, * assume that all boards that include this file use a Broadcom chip * with a soft reset bit in the PLL control register. */ static void brcm_machine_restart(char *command) { const unsigned long ulSoftReset = 0x00000001; unsigned long *pulPllCtrl = (unsigned long *) 0xfffe0008; // *pulPllCtrl |= ulSoftReset; kerSysMipsSoftReset(); }
/*************************************************************************** * Function Name: cfe_web_process * Description : Calls the appropriate functions to write an image to * flash memory. * Returns : None. ***************************************************************************/ void cfe_web_fg_process(void) { /* Wait so the uploadinfo web page can be displayed on the browser. */ cfe_sleep(CFE_HZ * 2); if( g_image_format == BROADCOM_IMAGE_FORMAT ) flashImage( g_image_start ); else if( g_image_format == FLASH_IMAGE_FORMAT ) writeWholeImage( g_image_start, g_image_len ); if( g_image_format != NO_IMAGE_FORMAT ) { printf( "Resetting board...\n" ); kerSysMipsSoftReset(); } } /* cfe_web_process */
static void sg_complete (struct urb *urb, struct pt_regs *regs) { struct usb_sg_request *io = (struct usb_sg_request *) urb->context; spin_lock (&io->lock); /* In 2.5 we require hcds' endpoint queues not to progress after fault * reports, until the completion callback (this!) returns. That lets * device driver code (like this routine) unlink queued urbs first, * if it needs to, since the HC won't work on them at all. So it's * not possible for page N+1 to overwrite page N, and so on. * * That's only for "hard" faults; "soft" faults (unlinks) sometimes * complete before the HCD can get requests away from hardware, * though never during cleanup after a hard fault. */ if (io->status && (io->status != -ECONNRESET || urb->status != -ECONNRESET) && urb->actual_length) { dev_err (io->dev->bus->controller, "dev %s ep%d%s scatterlist error %d/%d\n", io->dev->devpath, usb_pipeendpoint (urb->pipe), usb_pipein (urb->pipe) ? "in" : "out", urb->status, io->status); // BUG (); } if (urb->status && urb->status != -ECONNRESET) { int i, found, status; io->status = urb->status; /* the previous urbs, and this one, completed already. * unlink pending urbs so they won't rx/tx bad data. */ for (i = 0, found = 0; i < io->entries; i++) { if (!io->urbs [i]) continue; if (found) { status = usb_unlink_urb (io->urbs [i]); if (status != -EINPROGRESS && status != -EBUSY) { dev_err (&io->dev->dev, "%s, unlink --> %d\n", __FUNCTION__, status); if(status == -19) { printk("sg_complete====will do softreset\n"); kerSysMipsSoftReset(); } } } else if (urb == io->urbs [i]) found = 1; } } urb->dev = NULL; /* on the last completion, signal usb_sg_wait() */ io->bytes += urb->actual_length; io->count--; if (!io->count) complete (&io->complete); spin_unlock (&io->lock); }
static void brcm_machine_restart(char *command) { kerSysMipsSoftReset(); }