From owner-p4-projects@FreeBSD.ORG Thu May 4 20:18:44 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 5AD6C16A43B; Thu, 4 May 2006 20:18:43 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C0BF716A412 for ; Thu, 4 May 2006 20:18:41 +0000 (UTC) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 87FF143D46 for ; Thu, 4 May 2006 20:18:41 +0000 (GMT) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id k44KIfKS080065 for ; Thu, 4 May 2006 20:18:41 GMT (envelope-from imp@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id k44KIfpa080062 for perforce@freebsd.org; Thu, 4 May 2006 20:18:41 GMT (envelope-from imp@freebsd.org) Date: Thu, 4 May 2006 20:18:41 GMT Message-Id: <200605042018.k44KIfpa080062@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to imp@freebsd.org using -f From: Warner Losh To: Perforce Change Reviews Cc: Subject: PERFORCE change 96667 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 May 2006 20:18:44 -0000 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 " - // 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); }