Date: Fri, 8 Sep 2006 21:43:24 GMT From: Warner Losh <imp@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 105857 for review Message-ID: <200609082143.k88LhOnC044062@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=105857 Change 105857 by imp@imp_lighthouse on 2006/09/08 21:43:16 Cleanup lots of code in boot2, gets back 300 bytes after eeprom integration. Also, part of this is making 'printf' a cooked interface. This saves an additional 14 bytes, and eliminates a common bug potential in the process. Affected files ... .. //depot/projects/arm/src/sys/boot/arm/at91/boot0iic/main.c#7 edit .. //depot/projects/arm/src/sys/boot/arm/at91/boot0spi/main.c#17 edit .. //depot/projects/arm/src/sys/boot/arm/at91/boot2/boot2.c#13 edit .. //depot/projects/arm/src/sys/boot/arm/at91/bootiic/loader_prompt.c#17 edit .. //depot/projects/arm/src/sys/boot/arm/at91/bootsd/main.c#7 edit .. //depot/projects/arm/src/sys/boot/arm/at91/bootspi/ee.c#4 edit .. //depot/projects/arm/src/sys/boot/arm/at91/bootspi/env_vars.c#9 edit .. //depot/projects/arm/src/sys/boot/arm/at91/bootspi/loader_prompt.c#19 edit .. //depot/projects/arm/src/sys/boot/arm/at91/bootspi/main.c#17 edit .. //depot/projects/arm/src/sys/boot/arm/at91/libat91/emac.c#28 edit .. //depot/projects/arm/src/sys/boot/arm/at91/libat91/lib.h#17 edit .. //depot/projects/arm/src/sys/boot/arm/at91/libat91/mci_device.c#8 edit .. //depot/projects/arm/src/sys/boot/arm/at91/libat91/printf.c#5 edit .. //depot/projects/arm/src/sys/boot/arm/at91/libat91/putchar.c#6 edit .. //depot/projects/arm/src/sys/boot/arm/at91/libat91/sd-card.c#7 edit .. //depot/projects/arm/src/sys/boot/arm/at91/libat91/spi_flash.c#17 edit Differences ... ==== //depot/projects/arm/src/sys/boot/arm/at91/boot0iic/main.c#7 (text) ==== @@ -36,8 +36,8 @@ while (xmodem_rx(addr) == -1) continue; InitEEPROM(); - printf("Writing EEPROM from 0x%x to addr 0\r\n", addr); + printf("Writing EEPROM from 0x%x to addr 0\n", addr); WriteEEPROM(0, addr, 8192); - printf("Write complete. Press reset\r\n"); + printf("Write complete. Press reset\n"); return (1); } ==== //depot/projects/arm/src/sys/boot/arm/at91/boot0spi/main.c#17 (text) ==== @@ -40,12 +40,12 @@ char *addr3 = (char *)SDRAM_BASE + (3 << 20); /* Load to base + 2MB */ SPI_InitFlash(); - printf("Waiting for data\r\n"); + printf("Waiting for data\n"); while ((len = xmodem_rx(addr)) == -1) continue; - printf("\r\nDownloaded %u bytes.\r\n", len); + printf("\nDownloaded %u bytes.\n", len); p_memcpy(addr3, addr, (len + FLASH_PAGE_SIZE - 1) / FLASH_PAGE_SIZE * FLASH_PAGE_SIZE); - printf("Writing %u bytes to flash at %u\r\n", len, OFFSET); + printf("Writing %u bytes to flash at %u\n", len, OFFSET); for (i = 0; i < len; i+= FLASH_PAGE_SIZE) { for (j = 0; j < 10; j++) { off = i + OFFSET; @@ -55,7 +55,7 @@ break; } if (j >= 10) - printf("Bad Readback at %u\r\n", i); + printf("Bad Readback at %u\n", i); } return (1); } ==== //depot/projects/arm/src/sys/boot/arm/at91/boot2/boot2.c#13 (text+ko) ==== @@ -31,15 +31,13 @@ #include "sd-card.h" #include "ee.h" -#define SECOND 18 /* Circa that many ticks in a second. */ - #define RBX_ASKNAME 0x0 /* -a */ #define RBX_SINGLE 0x1 /* -s */ /* 0x2 is reserved for log2(RB_NOSYNC). */ /* 0x3 is reserved for log2(RB_HALT). */ /* 0x4 is reserved for log2(RB_INITNAME). */ #define RBX_DFLTROOT 0x5 /* -r */ -#define RBX_KDB 0x6 /* -d */ +/* #define RBX_KDB 0x6 -d */ /* 0x7 is reserved for log2(RB_RDONLY). */ /* 0x8 is reserved for log2(RB_DUMP). */ /* 0x9 is reserved for log2(RB_MINIROOT). */ @@ -53,50 +51,34 @@ /* 0x11 is reserved for log2(RB_SELFTEST). */ /* 0x12 is reserved for boot programs. */ /* 0x13 is reserved for boot programs. */ -#define RBX_PAUSE 0x14 /* -p */ -#define RBX_QUIET 0x15 /* -q */ -#define RBX_NOINTR 0x1c /* -n */ +/* #define RBX_PAUSE 0x14 -p */ +/* #define RBX_QUIET 0x15 -q */ +/* #define RBX_NOINTR 0x1c -n */ /* 0x1d is reserved for log2(RB_MULTIPLE) and is just misnamed here. */ /* #define RBX_DUAL 0x1d -D */ /* 0x1f is reserved for log2(RB_BOOTINFO). */ -/* pass: -a, -s, -r, -d, -c, -v, -g, -p */ +/* pass: -a, -s, -r, -v, -g */ #define RBX_MASK (OPT_SET(RBX_ASKNAME) | OPT_SET(RBX_SINGLE) | \ - OPT_SET(RBX_DFLTROOT) | OPT_SET(RBX_KDB ) | \ - OPT_SET(RBX_CONFIG) | OPT_SET(RBX_VERBOSE) | \ - OPT_SET(RBX_GDB) | \ - OPT_SET(RBX_PAUSE)) + OPT_SET(RBX_DFLTROOT) | \ + OPT_SET(RBX_VERBOSE) | \ + OPT_SET(RBX_GDB)) #define PATH_CONFIG "/boot.config" //#define PATH_KERNEL "/boot/kernel/kernel" #define PATH_KERNEL "/kernel.gz.tramp" -#define ARGS 0x900 -#define NOPT 8 -#define NDEV 3 -#define MEM_BASE 0x12 -#define MEM_EXT 0x15 - -#define DRV_HARD 0x80 -#define DRV_MASK 0x7f - -#define TYPE_AD 0 -#define TYPE_DA 1 -#define TYPE_MAXHARD TYPE_DA -#define TYPE_FD 2 +#define NOPT 6 #define OPT_SET(opt) (1 << (opt)) #define OPT_CHECK(opt) ((opts) & OPT_SET(opt)) extern uint32_t _end; -static const char optstr[NOPT] = "agnpqrsv"; /* Also 'P' */ +static const char optstr[NOPT] = "agrsv"; static const unsigned char flags[NOPT] = { RBX_ASKNAME, RBX_GDB, - RBX_NOINTR, - RBX_PAUSE, - RBX_QUIET, RBX_DFLTROOT, RBX_SINGLE, RBX_VERBOSE @@ -109,7 +91,6 @@ static char kname[1024]; static uint32_t opts; static int dsk_meta; -//static int comspeed = SIOSPD; static void load(void); static int parse(void); @@ -143,20 +124,12 @@ ssize_t rv; if ((size_t)(rv = fsread(inode, buf, nbyte)) != nbyte) { - printf("Invalid %s\r\n", "sector"); + printf("Invalid %s\n", "sector"); return -1; } return 0; } -static void -xputchar(int ch) -{ - if (ch == '\n') - putchar('\r'); - putchar(ch); -} - static inline void getstr(void) { @@ -236,7 +209,7 @@ EERead(0, (uint8_t *)&sig, sizeof(sig)); if (sig != 0xaa55aa55) { - printf("Bad signature %x\r\n", sig); + printf("Bad signature %x\n", sig); return; } EERead(48, euid64, 8); @@ -255,13 +228,13 @@ ino_t ino; if (kname[0]) - printf("bss not zero\r\n"); + printf("bss not zero\n"); #ifdef TSC_FPGA SPI_InitFlash(); printf("Loading FPGA..."); fpga_load(); - printf("done\r\n"); + printf("done\n"); #endif EEInit(); MacFromEE(); @@ -280,8 +253,7 @@ if (*cmd) { if (parse()) autoboot = 0; - if (!OPT_CHECK(RBX_QUIET)) - printf("%s: %s", PATH_CONFIG, cmd); + printf("%s: %s", PATH_CONFIG, cmd); /* Do not process this command twice */ *cmd = 0; } @@ -290,13 +262,13 @@ p_strcpy(kname, PATH_KERNEL); for (;;) { - if (!autoboot || !OPT_CHECK(RBX_QUIET)) - printf("\r\nFreeBSD/arm boot\r\n" - "Default: %s\r\n" + if (!autoboot) + printf("\nFreeBSD/arm boot\n" + "Default: %s\n" "boot: ", kname); if (!autoboot || getc(5) == -1) getstr(); - else if (!autoboot || !OPT_CHECK(RBX_QUIET)) + else if (!autoboot) xputchar('\n'); autoboot = 0; if (parse()) @@ -321,13 +293,13 @@ if (!(ino = lookup(kname))) { if (!ls) - printf("No %s\r\n", kname); + printf("No %s\n", kname); return; } if (xfsread(ino, &eh, sizeof(eh))) return; if (!IS_ELF(eh)) { - printf("Invalid %s\r\n", "format"); + printf("Invalid %s\n", "format"); return; } fs_off = eh.e_phoff; @@ -392,7 +364,6 @@ return -1; opts ^= OPT_SET(flags[i]); } -// sio_init(115200 / comspeed); } else { if ((i = ep - arg)) { if ((size_t)i >= sizeof(kname)) @@ -424,7 +395,7 @@ break; } if (i == NDOSPART) { - printf("No BSD partition found\r\n"); + printf("No BSD partition found\n"); return -1; } // Although dp_start is aligned within the disk partition structure, @@ -435,11 +406,11 @@ return -1; d = (void *)(sec + LABELOFFSET); if (d->d_magic != DISKMAGIC || d->d_magic2 != DISKMAGIC) { - printf("Invalid %s\r\n", "label"); + printf("Invalid %s\n", "label"); return -1; } if (!d->d_partitions[0].p_size) { - printf("Invalid %s\r\n", "partition"); + printf("Invalid %s\n", "partition"); return -1; } dsk_start += d->d_partitions[0].p_offset; @@ -454,7 +425,6 @@ { static unsigned c = 0x2d5c7c2f; - if (!OPT_CHECK(RBX_QUIET)) - printf("%c\b", c = c << 8 | c >> 24); + printf("%c\b", c = c << 8 | c >> 24); return (MCI_read((char *)buf, lba << 9, nblk << 9)); } ==== //depot/projects/arm/src/sys/boot/arm/at91/bootiic/loader_prompt.c#17 (text+ko) ==== @@ -234,20 +234,20 @@ case COMMAND_HELP: // dump command info - printf("Commands:\r\n" - "\tc\r\n" - "\td\r\n" - "\te\r\n" - "\tip\r\n" - "\tserver_ip\r\n" - "\tm\r\n" - "\ttftp\r\n" - "\ts\r\n" + printf("Commands:\n" + "\tc\n" + "\td\n" + "\te\n" + "\tip\n" + "\tserver_ip\n" + "\tm\n" + "\ttftp\n" + "\ts\n" #ifdef SUPPORT_TAG_LIST - "\tt\r\n" + "\tt\n" #endif - "\tw\r\n" - "\tx\r\n"); + "\tw\n" + "\tx\n"); break; case COMMAND_LOCAL_IP: @@ -315,7 +315,7 @@ break; } - printf("\r\n"); + printf("\n"); } @@ -324,7 +324,7 @@ * void ServicePrompt(char) * This private function process each character checking for valid commands. * This function is only executed if the character is considered valid. - * Each command is terminated with NULL (0) or '\r'. + * Each command is terminated with NULL (0) or ''. * .KB_C_FN_DEFINITION_END */ static void @@ -346,11 +346,11 @@ putchar(p_char); } if (!p_char) { - printf("\r\n"); + printf("\n"); ParseCommand(inputBuffer); p_memset(inputBuffer, 0, MAX_INPUT_SIZE); buffCount = 0; - printf("\r\n>"); + printf("\n>"); } } @@ -379,7 +379,7 @@ inputFunction = getc; } - printf("\r\n>"); + printf("\n>"); while (1) if ((ch = ((*inputFunction)(0))) > 0) ==== //depot/projects/arm/src/sys/boot/arm/at91/bootsd/main.c#7 (text+ko) ==== @@ -84,7 +84,7 @@ int i; #endif - printf("\r\nTSC boot...\r\n"); + printf("\nTSC boot...\n"); SPI_InitFlash(); #ifdef TSC_FPGA printf("Loading FPGA..."); @@ -93,7 +93,7 @@ AT91C_BASE_PIOC->PIO_CODR = AT91C_PIO_PC7; fpga_load(); AT91C_BASE_PIOC->PIO_SODR = AT91C_PIO_PC7; - printf("done\r\n"); + printf("done\n"); #endif EMAC_Init(); sdcard_init(); @@ -104,11 +104,11 @@ MCI_read((char *)0x20000000, i << 9, 1 << 9); printf("*"); } - printf("\r\nStarting...\r\n"); + printf("\nStarting...\n"); ((void(*)())(0x20000000))(); #else MCI_read((char *)0x20000000, 0, 1 << 20); - printf("Found %s\r\n", (char *)0x20000000); + printf("Found %s\n", (char *)0x20000000); while (1); #endif return (1); ==== //depot/projects/arm/src/sys/boot/arm/at91/bootspi/ee.c#4 (text+ko) ==== @@ -96,7 +96,7 @@ unsigned int status; if ((ee_off & ~0xff) != ((ee_off + size) & ~0xff)) { - printf("Crosses page boundary: 0x%x 0x%x\r\n", ee_off, size); + printf("Crosses page boundary: 0x%x 0x%x\n", ee_off, size); return; } ==== //depot/projects/arm/src/sys/boot/arm/at91/bootspi/env_vars.c#9 (text+ko) ==== @@ -82,7 +82,7 @@ int i; for (i = 0; boot_commands[i][0]; i++) - printf("0x%x : %s[E]\r\n", i, boot_commands[i]); + printf("0x%x : %s[E]\n", i, boot_commands[i]); } @@ -125,6 +125,6 @@ currentOffset = 0; DumpBootCommands(); - printf("Autoboot...\r\n"); + printf("Autoboot...\n"); Bootloader(ReadCharFromEnvironment); } ==== //depot/projects/arm/src/sys/boot/arm/at91/bootspi/loader_prompt.c#19 (text+ko) ==== @@ -182,7 +182,7 @@ while ((len = xmodem_rx(addr)) == -1) continue; - printf("\r\nDownloaded %u bytes.\r\n", len); + printf("\nDownloaded %u bytes.\n", len); WriteEEPROM(eeaddr, 0, addr, len); } #endif @@ -195,7 +195,7 @@ while ((len = xmodem_rx(addr)) == -1) continue; - printf("\r\nDownloaded %u bytes.\r\n", len); + printf("\nDownloaded %u bytes.\n", len); for (i = 0; i < len; i+= FLASH_PAGE_SIZE) { off = i + offset; SPI_WriteFlash(off, addr + i, FLASH_PAGE_SIZE); @@ -302,38 +302,38 @@ break; case COMMAND_RESET: - printf("Reset\r\n"); + printf("Reset\n"); reset(); while (1) continue; break; case COMMAND_REPLACE_KERNEL_VIA_XMODEM: - printf("Updating KERNEL image\r\n"); + printf("Updating KERNEL image\n"); UpdateFlash(KERNEL_OFFSET); break; case COMMAND_REPLACE_FPGA_VIA_XMODEM: - printf("Updating FPGA image\r\n"); + printf("Updating FPGA image\n"); UpdateFlash(FPGA_OFFSET); break; case COMMAND_REPLACE_FLASH_VIA_XMODEM: - printf("Updating FLASH image\r\n"); + printf("Updating FLASH image\n"); UpdateFlash(FLASH_OFFSET); break; case COMMAND_REPLACE_ID_EEPROM: { char buf[25]; - printf("Testing Config EEPROM\r\n"); + printf("Testing Config EEPROM\n"); EEWrite(0, "This is a test", 15); EERead(0, buf, 15); - printf("Found '%s'\r\n", buf); + printf("Found '%s'\n", buf); break; } default: break; } - printf("\r\n"); + printf("\n"); } @@ -342,7 +342,7 @@ * void ServicePrompt(char) * This private function process each character checking for valid commands. * This function is only executed if the character is considered valid. - * Each command is terminated with NULL (0) or '\r'. + * Each command is terminated with NULL (0) or ''. * .KB_C_FN_DEFINITION_END */ static void @@ -364,11 +364,11 @@ putchar(p_char); } if (!p_char) { - printf("\r\n"); + printf("\n"); ParseCommand(inputBuffer); p_memset(inputBuffer, 0, MAX_INPUT_SIZE); buffCount = 0; - printf("\r\n>"); + printf("\n>"); } } @@ -393,7 +393,7 @@ p_memset((void*)inputBuffer, 0, sizeof(inputBuffer)); buffCount = 0; - printf("\r\n>"); + printf("\n>"); while (1) if ((ch = ((*inputFunction)(0))) > 0) ==== //depot/projects/arm/src/sys/boot/arm/at91/bootspi/main.c#17 (text+ko) ==== @@ -46,7 +46,7 @@ int main(void) { - printf("\r\nBoot\r\n"); + printf("\nBoot\n"); EEInit(); SPI_InitFlash(); #ifdef TSC_FPGA ==== //depot/projects/arm/src/sys/boot/arm/at91/libat91/emac.c#28 (text+ko) ==== @@ -209,14 +209,14 @@ dlAddress += len; lastSize += len; if (ackBlock % 128 == 0) - printf("tftp: %u kB\r", lastSize / 1024); + printf("tftp: %u kB", lastSize / 1024); } tftpHeader.opcode = TFTP_ACK_OPCODE; tftpHeader.block_num = SWAP16(ackBlock); Send_TFTP_Packet((char*)&tftpHeader, 4); if (len < 512) { ackBlock = -2; - printf("tftp: %u byte\r\n", lastSize); + printf("tftp: %u byte\n", lastSize); } } @@ -424,7 +424,7 @@ printf(" FDX"); update |= AT91C_EMAC_FD; } - printf("\r\n"); + printf("\n"); #endif pEmac->EMAC_CFG = update; } @@ -553,10 +553,10 @@ // Be sure to send a NAK, which is done by // ACKing the last block we got. TFTP_ACK_Data(0, ackBlock, 512); - printf("\nNAK %u\r\n", ackBlock); + printf("\nNAK %u\n", ackBlock); } } } if (timeout == 0) - printf("TFTP TIMEOUT!\r\n"); + printf("TFTP TIMEOUT!\n"); } ==== //depot/projects/arm/src/sys/boot/arm/at91/libat91/lib.h#17 (text) ==== @@ -29,6 +29,7 @@ int getc(int); void putchar(int); +void xputchar(int); void printf(const char *fmt,...); /* The following function write eeprom at ee_addr using data */ ==== //depot/projects/arm/src/sys/boot/arm/at91/libat91/mci_device.c#8 (text+ko) ==== @@ -168,7 +168,7 @@ /////////////////////////////////////////////////////////////////////// if (pMCI_Device->pMCI_DeviceDesc->state != AT91C_MCI_IDLE) { #if IMP_DEBUG - printf("1 state is 0x%x\r\n", pMCI_Device->pMCI_DeviceDesc->state); + printf("1 state is 0x%x\n", pMCI_Device->pMCI_DeviceDesc->state); #endif return AT91C_READ_ERROR; } @@ -178,14 +178,14 @@ pMCI_Device->pMCI_DeviceFeatures->Relative_Card_Address) & AT91C_SR_READY_FOR_DATA) != AT91C_SR_READY_FOR_DATA) { #if IMP_DEBUG - printf("2\r\n"); + printf("2\n"); #endif return AT91C_READ_ERROR; } if ( (src + sizeToRead) > pMCI_Device->pMCI_DeviceFeatures->Memory_Capacity ) { #if IMP_DEBUG - printf("3\r\n"); + printf("3\n"); #endif return AT91C_READ_ERROR; } @@ -193,7 +193,7 @@ // If source does not fit a begin of a block if ((src & (sectorLength - 1)) != 0) { #if IMP_DEBUG - printf("4\r\n"); + printf("4\n"); #endif return AT91C_READ_ERROR; } @@ -203,14 +203,14 @@ if( (sizeToRead < sectorLength) && (pMCI_Device->pMCI_DeviceFeatures->Read_Partial == 0x00) ) { #if IMP_DEBUG - printf("5\r\n"); + printf("5\n"); #endif return AT91C_READ_ERROR; } if( sizeToRead > sectorLength) { #if IMP_DEBUG - printf("6\r\n"); + printf("6\n"); #endif return AT91C_READ_ERROR; } @@ -455,7 +455,7 @@ f->Relative_Card_Address = 0; continue; } - printf("Response is %x %x %x %x\r\n", tab_response[0], + printf("Response is %x %x %x %x\n", tab_response[0], tab_response[1], tab_response[2], tab_response[3]) f->READ_BL_LEN = ((tab_response[2] >> CSD__RD_B_LEN_S) & CSD__RD_B_LEN_M); f->WRITE_BL_LEN = ((tab_response[3] >> CSD__WBLEN_S) & CSD__WBLEN_M ); @@ -583,7 +583,7 @@ if (AT91F_MCI_GetCSD(f->Relative_Card_Address,tab_response) != AT91C_CMD_SEND_OK) return AT91C_INIT_ERROR; - printf("Response is %x %x %x %x\r\n", tab_response[0], + printf("Response is %x %x %x %x\n", tab_response[0], tab_response[1], tab_response[2], tab_response[3]); f->READ_BL_LEN = (tab_response[1] >> CSD_1_RD_B_LEN_S) & CSD_1_RD_B_LEN_M; @@ -617,7 +617,7 @@ return AT91C_INIT_ERROR; if (AT91F_MCI_SetBlocklength(1 << f->READ_BL_LEN) != AT91C_CMD_SEND_OK) return AT91C_INIT_ERROR; - printf("Found SD card %u bytes in size %u %u\r\n", f->Memory_Capacity, + printf("Found SD card %u bytes in size %u %u\n", f->Memory_Capacity, blocknr, mult); return AT91C_INIT_OK; } ==== //depot/projects/arm/src/sys/boot/arm/at91/libat91/printf.c#5 (text+ko) ==== @@ -36,11 +36,11 @@ c = *fmt++; switch (c) { case 'c': - putchar(va_arg(ap, int)); + xputchar(va_arg(ap, int)); continue; case 's': for (s = va_arg(ap, char *); *s; s++) - putchar(*s); + xputchar(*s); continue; case 'd': /* A lie, always prints unsigned */ case 'u': @@ -51,7 +51,7 @@ while (u /= 10U); dumpbuf:; while (--s >= buf) - putchar(*s); + xputchar(*s); continue; case 'x': u = va_arg(ap, unsigned); @@ -62,7 +62,7 @@ goto dumpbuf; } } - putchar(c); + xputchar(c); } va_end(ap); ==== //depot/projects/arm/src/sys/boot/arm/at91/libat91/putchar.c#6 (text) ==== @@ -52,3 +52,11 @@ continue; pUSART->US_THR = (ch & 0xFF); } + +void +xputchar(int ch) +{ + if (ch == '\n') + putchar('\r'); + putchar(ch); +} ==== //depot/projects/arm/src/sys/boot/arm/at91/libat91/sd-card.c#7 (text+ko) ==== @@ -87,7 +87,7 @@ #if IMP_DEBUG if (timeout == 0) - printf("Timeout, status is 0x%x\r\n", status); + printf("Timeout, status is 0x%x\n", status); #endif //TODO: Make interrupts work! @@ -104,7 +104,7 @@ int sizeToWrite; #if IMP_DEBUG - printf("\r\n"); + printf("\n"); #endif //See if we are requested to write partial sectors, and have the capability to do so @@ -181,7 +181,7 @@ unsigned int *walker; #if IMP_DEBUG - printf("Reading 0x%x bytes into ARM Addr 0x%x from card offset 0x%x\r\n", + printf("Reading 0x%x bytes into ARM Addr 0x%x from card offset 0x%x\n", length, dest, source); #endif @@ -209,7 +209,7 @@ //TODO:Status checking if (status != AT91C_READ_OK) { #if IMP_DEBUG - printf("STATUS is 0x%x\r\n", status); + printf("STATUS is 0x%x\n", status); #endif return -1; } @@ -241,14 +241,14 @@ //Do the writing status = AT91F_MCI_ReadBlock(&MCI_Device, source, (unsigned int*)dest, sizeToRead); #if IMP_DEBUG - printf("Reading 0x%x Addr 0x%x card 0x%x\r\n", + printf("Reading 0x%x Addr 0x%x card 0x%x\n", sizeToRead, dest, source); #endif //TODO:Status checking if (status != AT91C_READ_OK) { #if IMP_DEBUG - printf("STATUS is 0x%x\r\n", status); + printf("STATUS is 0x%x\n", status); #endif return -1; } ==== //depot/projects/arm/src/sys/boot/arm/at91/libat91/spi_flash.c#17 (text+ko) ==== @@ -234,5 +234,5 @@ AT91C_BASE_ST->ST_RTMR = 1; if (((value = GetFlashStatus()) & 0xFC) != 0xBC) - printf(" Bad SPI status: 0x%x\r\n", value); + printf(" Bad SPI status: 0x%x\n", value); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200609082143.k88LhOnC044062>