Date: Thu, 4 May 2006 20:18:41 GMT From: Warner Losh <imp@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 96667 for review Message-ID: <200605042018.k44KIfpa080062@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=96667 Change 96667 by imp@imp_hammer on 2006/05/04 20:18:13 More trimming. We now have 2648 bytes free, up about 700. Room to breathe. Affected files ... .. //depot/projects/arm/src/sys/boot/arm/at91/bootiic/main.c#10 edit .. //depot/projects/arm/src/sys/boot/arm/at91/bootspi/loader_prompt.c#7 edit .. //depot/projects/arm/src/sys/boot/arm/at91/bootspi/main.c#8 edit Differences ... ==== //depot/projects/arm/src/sys/boot/arm/at91/bootiic/main.c#10 (text+ko) ==== ==== //depot/projects/arm/src/sys/boot/arm/at91/bootspi/loader_prompt.c#7 (text+ko) ==== @@ -50,7 +50,6 @@ static const char *backspaceString = "\010 \010"; static const command_entry_t CommandTable[] = { - {COMMAND_COPY, "c"}, {COMMAND_DUMP, "d"}, {COMMAND_EXEC, "e"}, {COMMAND_HELP, "?"}, @@ -95,7 +94,6 @@ off = i + offset; SPI_ReadFlash(off, addr + i, FLASH_PAGE_SIZE); } - printf("Loading %u bytes into the FPGA...\r\n", len); fpga_init(&main_fpga); fpga_clear(&main_fpga); fpga_write_bytes(&main_fpga, addr, len); @@ -204,25 +202,14 @@ UpdateFlash(int offset) { char *addr = (char *)SDRAM_BASE + (1 << 20); /* Load to base + 1MB */ - char *addr2 = (char *)SDRAM_BASE + (2 << 20); /* Load to base + 2MB */ - char *addr3 = (char *)SDRAM_BASE + (3 << 20); /* Load to base + 2MB */ - int len, i, j, off; + int len, i, off; while ((len = xmodem_rx(addr)) == -1) continue; printf("\r\nDownloaded %u bytes.\r\n", len); - p_memcpy(addr3, addr, (len + FLASH_PAGE_SIZE - 1) / - FLASH_PAGE_SIZE * FLASH_PAGE_SIZE); for (i = 0; i < len; i+= FLASH_PAGE_SIZE) { - for (j = 0; j < 10; j++) { - off = i + offset; - SPI_WriteFlash(off, addr + i, FLASH_PAGE_SIZE); - SPI_ReadFlash(off, addr2 + i, FLASH_PAGE_SIZE); - if (p_memcmp(addr3 + i, addr2 + i, FLASH_PAGE_SIZE) == 0) - break; - } - if (j >= 10) - printf("Bad Readback at %u\r\n", i); + off = i + offset; + SPI_WriteFlash(off, addr + i, FLASH_PAGE_SIZE); } } @@ -241,22 +228,6 @@ return; switch (StringToCommand(argv[0])) { - case COMMAND_COPY: - { - // "c <to> <from> <size in bytes>" - // copy memory - char *to, *from; - unsigned size; - - if (argc > 3) { - to = (char *)p_ASCIIToHex(argv[1]); - from = (char *)p_ASCIIToHex(argv[2]); - size = p_ASCIIToHex(argv[3]); - p_memcpy(to, from, size); - } - break; - } - case COMMAND_DUMP: // display boot commands DumpBootCommands(); @@ -299,7 +270,6 @@ case COMMAND_HELP: // dump command info printf("Commands:\r\n" - "\tc\r\n" "\td\r\n" "\te\r\n" "\tip\r\n" @@ -457,11 +427,7 @@ int ch = 0; p_memset((void*)inputBuffer, 0, sizeof(inputBuffer)); - buffCount = 0; - if (!inputFunction) { - inputFunction = getc; - } printf("\r\n>"); ==== //depot/projects/arm/src/sys/boot/arm/at91/bootspi/main.c#8 (text+ko) ==== @@ -51,9 +51,8 @@ #endif EMAC_Init(); LoadBootCommands(); - printf("\r\nSPI Boot loader.\r\n"); if (getc(1) == -1) ExecuteEnvironmentFunctions(); - Bootloader(0); + Bootloader(getc); return (1); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200605042018.k44KIfpa080062>