You can subscribe to this list here.
2001 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(79) |
Aug
(27) |
Sep
(64) |
Oct
(202) |
Nov
(31) |
Dec
(59) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2002 |
Jan
(125) |
Feb
(173) |
Mar
(13) |
Apr
(140) |
May
(75) |
Jun
(1) |
Jul
(37) |
Aug
(14) |
Sep
|
Oct
(20) |
Nov
(9) |
Dec
(2) |
2003 |
Jan
(51) |
Feb
(12) |
Mar
(18) |
Apr
(24) |
May
(1) |
Jun
|
Jul
|
Aug
(72) |
Sep
(12) |
Oct
(18) |
Nov
(60) |
Dec
(26) |
2004 |
Jan
(1) |
Feb
(40) |
Mar
(3) |
Apr
(3) |
May
|
Jun
(1) |
Jul
(4) |
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
(1) |
2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
(1) |
Dec
(5) |
2006 |
Jan
(13) |
Feb
(5) |
Mar
(8) |
Apr
(13) |
May
(7) |
Jun
(6) |
Jul
(10) |
Aug
(6) |
Sep
(6) |
Oct
(35) |
Nov
(20) |
Dec
(10) |
2007 |
Jan
(13) |
Feb
(9) |
Mar
(2) |
Apr
(1) |
May
(1) |
Jun
(2) |
Jul
(2) |
Aug
(3) |
Sep
(1) |
Oct
|
Nov
(1) |
Dec
(1) |
2008 |
Jan
|
Feb
|
Mar
(1) |
Apr
(4) |
May
(1) |
Jun
|
Jul
|
Aug
(2) |
Sep
(1) |
Oct
|
Nov
|
Dec
|
2009 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(54) |
Jun
(78) |
Jul
(35) |
Aug
(21) |
Sep
(21) |
Oct
(29) |
Nov
(10) |
Dec
(5) |
2010 |
Jan
|
Feb
|
Mar
(26) |
Apr
(55) |
May
(73) |
Jun
(63) |
Jul
(38) |
Aug
(39) |
Sep
(19) |
Oct
(2) |
Nov
(1) |
Dec
(1) |
2011 |
Jan
(2) |
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2013 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
From: Erik M. <er...@us...> - 2002-01-05 20:21:52
|
Update of /cvsroot/blob/blob/src/blob In directory usw-pr-cvs1:/tmp/cvs-serv7208/src/blob Modified Files: Makefile.am main.c Added Files: xmodem.c Log Message: Add xmodem download (from Christopher Hoover) Get rid of old xmodem files --- NEW FILE: xmodem.c --- /*------------------------------------------------------------------------- * Filename: xmodem.c * Version: $Id: xmodem.c,v 1.1 2002/01/05 20:21:49 erikm Exp $ * Copyright: Copyright (C) 2001, Hewlett-Packard Company * Author: Christopher Hoover <ch...@hp...> * Description: xmodem functionality for uploading of kernels * and the like * Created at: Thu Dec 20 01:58:08 PST 2001 *-----------------------------------------------------------------------*/ /* * xmodem.c: xmodem functionality for uploading of kernels and * the like * * Copyright (C) 2001 Hewlett-Packard Laboratories * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ #ident "$Id: xmodem.c,v 1.1 2002/01/05 20:21:49 erikm Exp $" #ifdef HAVE_CONFIG_H # include <blob/config.h> #endif #include <blob/errno.h> #include <blob/serial.h> #include <blob/util.h> #define SOH 0x01 #define STX 0x02 #define EOT 0x04 #define ACK 0x06 #define NAK 0x15 #define CAN 0x18 #define BS 0x08 /* Cf: http://www.textfiles.com/apple/xmodem http://www.phys.washington.edu/~belonis/xmodem/docxmodem.txt http://www.phys.washington.edu/~belonis/xmodem/docymodem.txt http://www.phys.washington.edu/~belonis/xmodem/modmprot.col */ #define TIMEOUT 10 #define MAXERRORS 5 #define ERROR(...) do { } while (0) static inline void WriteByte(char cc) { serial_write_raw(cc); } static inline void ReadFlush() { serial_flush_input(); } int ReadByteWithTimeout(unsigned int timeout) { char buf[1]; int n; n = SerialInputBlock(buf, 1, timeout); if (n == 1) return buf[0] & 0xff; else return -1; } int XModemReceive(char *bufBase, int bufLen) { char blockBuf[1024]; unsigned int errors = 0; unsigned int wantBlockNo = 1; unsigned int length = 0; int crc = 1; char nak = 'C'; ReadFlush(); /* Ask for CRC; if we get errors, we will go with checksum */ WriteByte(nak); for (;;) { int blockBegin; int blockNo, blockNoOnesCompl; int blockLength; int cksum = 0; int crcHi = 0; int crcLo = 0; blockBegin = ReadByteWithTimeout(TIMEOUT); if (blockBegin < 0) goto timeout; nak = NAK; switch (blockBegin) { case SOH: case STX: break; case EOT: WriteByte(ACK); goto done; default: goto error; } /* block no */ blockNo = ReadByteWithTimeout(TIMEOUT); if (blockNo < 0) goto timeout; /* block no one's compliment */ blockNoOnesCompl = ReadByteWithTimeout(TIMEOUT); if (blockNoOnesCompl < 0) goto timeout; if (blockNo != (255 - blockNoOnesCompl)) { ERROR("bad block ones compl\n"); goto error; } blockLength = (blockBegin == SOH) ? 128 : 1024; { int i; for (i = 0; i < blockLength; i++) { int cc = ReadByteWithTimeout(TIMEOUT); if (cc < 0) goto timeout; blockBuf[i] = cc; } } if (crc) { crcHi = ReadByteWithTimeout(TIMEOUT); if (crcHi < 0) goto timeout; crcLo = ReadByteWithTimeout(TIMEOUT); if (crcLo < 0) goto timeout; } else { cksum = ReadByteWithTimeout(TIMEOUT); if (cksum < 0) goto timeout; } if (blockNo == ((wantBlockNo - 1) & 0xff)) { /* a repeat of the last block is ok, just ignore it. */ /* this also ignores the initial block 0 which is */ /* meta data. */ goto next; } else if (blockNo != (wantBlockNo & 0xff)) { ERROR("unexpected block no, 0x%08x, expecting 0x%08x\n", blockNo, wantBlockNo); goto error; } if (crc) { int crc = 0; int i, j; int expectedCrcHi; int expectedCrcLo; for (i = 0; i < blockLength; i++) { crc = crc ^ (int) blockBuf[i] << 8; for (j = 0; j < 8; j++) if (crc & 0x8000) crc = crc << 1 ^ 0x1021; else crc = crc << 1; } expectedCrcHi = (crc >> 8) & 0xff; expectedCrcLo = crc & 0xff; if ((crcHi != expectedCrcHi) || (crcLo != expectedCrcLo)) { ERROR("crc error, expected 0x%02x 0x%02x, got 0x%02x 0x%02x\n", expectedCrcHi, expectedCrcLo, crcHi, crcLo); goto error; } } else { unsigned char expectedCksum = 0; int i; for (i = 0; i < blockLength; i++) expectedCksum += blockBuf[i]; if (cksum != expectedCksum) { ERROR("checksum error, expected 0x%02x, got 0x%02x\n", expectedCksum, cksum); goto error; } } wantBlockNo++; length += blockLength; if (length > bufLen) { ERROR("out of space\n"); goto error; } { int i; for (i = 0; i < blockLength; i++) *bufBase++ = blockBuf[i]; } next: errors = 0; WriteByte(ACK); continue; error: timeout: errors++; if (errors == MAXERRORS) { /* Abort */ int i; // if using crc, try again w/o crc if (nak == 'C') { nak = NAK; errors = 0; crc = 0; goto timeout; } ERROR("too many errors; giving up\n"); for (i = 0; i < 5; i ++) WriteByte(CAN); for (i = 0; i < 5; i ++) WriteByte(BS); return -1; } ReadFlush(); WriteByte(nak); } done: return length; } Index: Makefile.am =================================================================== RCS file: /cvsroot/blob/blob/src/blob/Makefile.am,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- Makefile.am 2001/12/27 18:27:37 1.13 +++ Makefile.am 2002/01/05 20:21:49 1.14 @@ -130,7 +130,8 @@ param_block.c \ partition.c \ reboot.c \ - uucodec.c + uucodec.c \ + xmodem.c # conditionally compiled sources Index: main.c =================================================================== RCS file: /cvsroot/blob/blob/src/blob/main.c,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- main.c 2002/01/03 16:07:18 1.20 +++ main.c 2002/01/05 20:21:49 1.21 @@ -53,6 +53,7 @@ #include <blob/time.h> #include <blob/util.h> #include <blob/uucodec.h> +#include <blob/xmodem.h> @@ -182,48 +183,59 @@ -static int Download(int argc, char *argv[]) +static int set_download_parameters(char *name, u32 *startAddress, + int *bufLen, int **numRead) { - u32 startAddress = 0; - int bufLen; - int *numRead = 0; - int retval; - - if(argc < 2) - return -ENOPARAMS; - - if(strncmp(argv[1], "blob", 5) == 0) { + if(strncmp(name, "blob", 5) == 0) { /* download blob */ - startAddress = BLOB_RAM_BASE; - bufLen = BLOB_FLASH_LEN; - numRead = &blob_status.blobSize; + *startAddress = BLOB_RAM_BASE; + *bufLen = BLOB_FLASH_LEN; + *numRead = &blob_status.blobSize; blob_status.blobType = fromDownload; #ifdef PARAM_START - } else if(strncmp(argv[1], "param", 6) == 0) { + } else if(strncmp(name, "param", 6) == 0) { /* download param */ - startAddress = PARAM_RAM_BASE; - bufLen = PARAM_FLASH_LEN; - numRead = &blob_status.paramSize; + *startAddress = PARAM_RAM_BASE; + *bufLen = PARAM_FLASH_LEN; + *numRead = &blob_status.paramSize; blob_status.paramType = fromDownload; #endif - } else if(strncmp(argv[1], "kernel", 7) == 0) { + } else if(strncmp(name, "kernel", 7) == 0) { /* download kernel */ - startAddress = KERNEL_RAM_BASE; - bufLen = KERNEL_FLASH_LEN; - numRead = &blob_status.kernelSize; + *startAddress = KERNEL_RAM_BASE; + *bufLen = KERNEL_FLASH_LEN; + *numRead = &blob_status.kernelSize; blob_status.kernelType = fromDownload; - } else if(strncmp(argv[1], "ramdisk", 8) == 0) { + } else if(strncmp(name, "ramdisk", 8) == 0) { /* download ramdisk */ - startAddress = RAMDISK_RAM_BASE; - bufLen = RAMDISK_FLASH_LEN; - numRead = &blob_status.ramdiskSize; + *startAddress = RAMDISK_RAM_BASE; + *bufLen = RAMDISK_FLASH_LEN; + *numRead = &blob_status.ramdiskSize; blob_status.ramdiskType = fromDownload; } else { - printerror(EINVAL, argv[1]); - return 0; + printerror(-EINVAL, name); + return -EINVAL; } + return 0; +} + + + +static int Download(int argc, char *argv[]) +{ + u32 startAddress = 0; + int bufLen; + int *numRead = 0; + int retval; + + if(argc < 2) + return -ENOPARAMS; + + retval = set_download_parameters(argv[1], &startAddress, + &bufLen, &numRead); + if (blob_status.terminalSpeed != blob_status.downloadSpeed) { SerialOutputString("Switching to "); PrintSerialSpeed(blob_status.downloadSpeed); @@ -275,9 +287,88 @@ } static char downloadhelp[] = "download {blob|param|kernel|ramdisk}\n" -"Download <argument> image to RAM\n"; +"Download <argument> image to RAM using uuencode\n"; __commandlist(Download, "download", downloadhelp); + + + + +static int xdownload(int argc, char *argv[]) +{ + u32 startAddress = 0; + int bufLen; + int *numRead = 0; + int retval; + + if(argc < 2) + return -ENOPARAMS; + + retval = set_download_parameters(argv[1], &startAddress, + &bufLen, &numRead); + + if (blob_status.terminalSpeed != blob_status.downloadSpeed) { + SerialOutputString("Switching to "); + PrintSerialSpeed(blob_status.downloadSpeed); + SerialOutputString(" baud\n"); + + SerialOutputString("Switch your terminal emulator to the same speed and\n"); + SerialOutputString("start sending using the XMODEM protocl (repeated ^X) to quit.\n"); + SerialOutputString(PACKAGE " will switch back to "); + PrintSerialSpeed(blob_status.terminalSpeed); + SerialOutputString(" baud after XMODEM succeeds or times out.\n"); + + serial_init(blob_status.downloadSpeed); + } else { + SerialOutputString("Start sending using the XMODEM protocol (repeated ^X to quit).\n\n"); + } + + *numRead = XModemReceive((char *) startAddress, bufLen); + + SerialOutputString("\n\n\n"); + + if (blob_status.terminalSpeed != blob_status.downloadSpeed) { + SerialOutputString("\n(Please switch your terminal emulator back to "); + PrintSerialSpeed(blob_status.terminalSpeed); + SerialOutputString(" baud)\n"); + } + + if(*numRead < 0) { + /* something went wrong */ + retval = *numRead; + + /* reload the correct memory */ + do_reload(argv[1]); + + serial_init(blob_status.terminalSpeed); + return retval; + } + SerialOutputString("Received "); + SerialOutputDec(*numRead); + SerialOutputString(" (0x"); + SerialOutputHex(*numRead); + SerialOutputString(") bytes"); +#ifdef BLOB_DEBUG + SerialOutputString(" at 0x"); + SerialOutputHex((u32) startAddress); +#endif + SerialOutputString(".\n"); + + + serial_init(blob_status.terminalSpeed); + + return 0; +} + +static char xdownloadhelp[] = "xdownload {blob|param|kernel|ramdisk}\n" +"Download <argument> image to RAM using xmodem\n"; + +__commandlist(xdownload, "xdownload", xdownloadhelp); + + + + + |
From: Erik M. <er...@us...> - 2002-01-05 20:21:52
|
Update of /cvsroot/blob/blob/src In directory usw-pr-cvs1:/tmp/cvs-serv7208/src Removed Files: xmodemio.c Log Message: Add xmodem download (from Christopher Hoover) Get rid of old xmodem files --- xmodemio.c DELETED --- |
From: Erik M. <er...@us...> - 2002-01-05 20:21:52
|
Update of /cvsroot/blob/blob/include/blob In directory usw-pr-cvs1:/tmp/cvs-serv7208/include/blob Modified Files: Makefile.am Added Files: xmodem.h Log Message: Add xmodem download (from Christopher Hoover) Get rid of old xmodem files --- NEW FILE: xmodem.h --- /*------------------------------------------------------------------------- * Filename: xmodem.h * Version: $Id: xmodem.h,v 1.1 2002/01/05 20:21:49 erikm Exp $ * Copyright: Copyright (C) 2001, Hewlett-Packard Corporation * Author: Christopher Hoover <ch...@hp...> * Description: Header file for xmodem.c * Created at: Thu Dec 20 02:13:44 PST 2001 *-----------------------------------------------------------------------*/ /* * xmodem.h: xmodem functionality for uploading of kernels and * the like * * Copyright (C) 2001, Hewlett-Packard Corporation * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ #ident "$Id: xmodem.h,v 1.1 2002/01/05 20:21:49 erikm Exp $" #ifndef BLOB_XMODEM_H #define BLOB_XMODEM_H int XModemReceive(char *bufBase, int bufLen); #endif Index: Makefile.am =================================================================== RCS file: /cvsroot/blob/blob/include/blob/Makefile.am,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- Makefile.am 2001/12/19 22:53:45 1.11 +++ Makefile.am 2002/01/05 20:21:49 1.12 @@ -39,7 +39,8 @@ time.h \ types.h \ util.h \ - uucodec.h + uucodec.h \ + xmodem.h CLEANFILES = ${srcdir}/*~ |
From: Erik M. <er...@us...> - 2002-01-05 20:21:51
|
Update of /cvsroot/blob/blob/include In directory usw-pr-cvs1:/tmp/cvs-serv7208/include Removed Files: xmodemio.h Log Message: Add xmodem download (from Christopher Hoover) Get rid of old xmodem files --- xmodemio.h DELETED --- |
From: Erik M. <er...@us...> - 2002-01-05 20:14:39
|
Update of /cvsroot/blob/blob/src/lib In directory usw-pr-cvs1:/tmp/cvs-serv5126/src/lib Modified Files: serial.c Log Message: - Add serial_write_raw() that doesn't interpret \n as \n\r - Add serial_flush_input() and serial_flush_output() to flush serial in or output Index: serial.c =================================================================== RCS file: /cvsroot/blob/blob/src/lib/serial.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- serial.c 2002/01/03 16:07:18 1.6 +++ serial.c 2002/01/05 20:14:34 1.7 @@ -82,8 +82,9 @@ -/* write character to serial port. return 0 on success, or negative - * error number on failure. this function is blocking +/* write character to serial port and replace all \n characters by a + * \n\r sequence. return 0 on success, or negative error number on + * failure. this function is blocking */ int serial_write(int c) { @@ -101,12 +102,46 @@ +/* write character to serial port and do not replace any + * characters. return 0 on success, or negative error number on + * failure. this function is blocking + */ +int serial_write_raw(int c) +{ + return serial_driver->write(c); +} + + + + /* check if there is a character available to read. returns 1 if there * is a character available, 0 if not, and negative error number on * failure */ int serial_poll(void) { return serial_driver->poll(); +} + + + + +/* flush serial input queue. returns 0 on success or negative error + * number otherwise + */ +int serial_flush_input(void) +{ + return serial_driver->flush_input(); +} + + + + +/* flush output queue. returns 0 on success or negative error number + * otherwise + */ +int serial_flush_output(void) +{ + return serial_driver->flush_output(); } |
From: Erik M. <er...@us...> - 2002-01-05 20:14:38
|
Update of /cvsroot/blob/blob/include/blob In directory usw-pr-cvs1:/tmp/cvs-serv5126/include/blob Modified Files: serial.h Log Message: - Add serial_write_raw() that doesn't interpret \n as \n\r - Add serial_flush_input() and serial_flush_output() to flush serial in or output Index: serial.h =================================================================== RCS file: /cvsroot/blob/blob/include/blob/serial.h,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- serial.h 2002/01/03 16:07:17 1.4 +++ serial.h 2002/01/05 20:14:34 1.5 @@ -84,7 +84,10 @@ int serial_init(serial_baud_t baudrate); int serial_read(void); int serial_write(int c); +int serial_write_raw(int c); int serial_poll(void); +int serial_flush_input(void); +int serial_flush_output(void); void SerialOutputString(const char *s); |
From: Erik M. <er...@us...> - 2002-01-03 16:07:21
|
Update of /cvsroot/blob/blob/src/diag In directory usw-pr-cvs1:/tmp/cvs-serv2589/src/diag Modified Files: Makefile.am commands.c initcalls.c lcd.c main.c system3.c Added Files: assabet.c badge4.c brutus.c clart.c h3600.c idr.c jornada720.c lart.c nesa.c pleb.c shannon.c Log Message: The serial port driver rewrite, part two. This looks quite intrusive, but it's not that large: - rewrite src/lib/serial.c to use the low level serial driver - change semantics for SerialInputByte() and SerialOutputByte(), so rename them to serial_read() and serial_write(). this makes the patch huge - add new INIT_LEVEL for driver selection (has to be done before hardware initialisation) - add machine specific files for all architectures in diag - clean up odds and ends. --- NEW FILE: assabet.c --- /* * assabet.c: Assabet specific stuff * * Copyright (C) 2002 Erik Mouw <J.A...@it...> * * $Id: assabet.c,v 1.1 2002/01/03 16:07:18 erikm Exp $ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ #ident "$Id: assabet.c,v 1.1 2002/01/03 16:07:18 erikm Exp $" #ifdef HAVE_CONFIG_H # include <blob/config.h> #endif #include <blob/init.h> #include <blob/serial.h> static void assabet_init_hardware(void) { /* select serial driver */ serial_driver = &sa11x0_serial_driver; } __initlist(assabet_init_hardware, INIT_LEVEL_DRIVER_SELECTION); --- NEW FILE: badge4.c --- /* * badge4.c: Badge4 specific stuff * * Copyright (C) 2002 Erik Mouw <J.A...@it...> * * $Id: badge4.c,v 1.1 2002/01/03 16:07:18 erikm Exp $ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ #ident "$Id: badge4.c,v 1.1 2002/01/03 16:07:18 erikm Exp $" #ifdef HAVE_CONFIG_H # include <blob/config.h> #endif #include <blob/init.h> #include <blob/serial.h> static void badge4_init_hardware(void) { /* select serial driver */ serial_driver = &sa11x0_serial_driver; } __initlist(badge4_init_hardware, INIT_LEVEL_DRIVER_SELECTION); --- NEW FILE: brutus.c --- /* * brutus.c: Brutus specific stuff * * Copyright (C) 2002 Erik Mouw <J.A...@it...> * * $Id: brutus.c,v 1.1 2002/01/03 16:07:18 erikm Exp $ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ #ident "$Id: brutus.c,v 1.1 2002/01/03 16:07:18 erikm Exp $" #ifdef HAVE_CONFIG_H # include <blob/config.h> #endif #include <blob/init.h> #include <blob/serial.h> static void brutus_init_hardware(void) { /* select serial driver */ serial_driver = &sa11x0_serial_driver; } __initlist(brutus_init_hardware, INIT_LEVEL_DRIVER_SELECTION); --- NEW FILE: clart.c --- /* * clart.c: CreditLART specific stuff * * Copyright (C) 2002 Erik Mouw <J.A...@it...> * * $Id: clart.c,v 1.1 2002/01/03 16:07:18 erikm Exp $ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ #ident "$Id: clart.c,v 1.1 2002/01/03 16:07:18 erikm Exp $" #ifdef HAVE_CONFIG_H # include <blob/config.h> #endif #include <blob/init.h> #include <blob/serial.h> static void clart_init_hardware(void) { /* select serial driver */ serial_driver = &sa11x0_serial_driver; } __initlist(clart_init_hardware, INIT_LEVEL_DRIVER_SELECTION); --- NEW FILE: h3600.c --- /* * h3600.c: Ipaq H3600 specific stuff * * Copyright (C) 2002 Erik Mouw <J.A...@it...> * * $Id: h3600.c,v 1.1 2002/01/03 16:07:18 erikm Exp $ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ #ident "$Id: h3600.c,v 1.1 2002/01/03 16:07:18 erikm Exp $" #ifdef HAVE_CONFIG_H # include <blob/config.h> #endif #include <blob/init.h> #include <blob/serial.h> static void h3600_init_hardware(void) { /* select serial driver */ serial_driver = &sa11x0_serial_driver; } __initlist(h3600_init_hardware, INIT_LEVEL_DRIVER_SELECTION); --- NEW FILE: idr.c --- /* * idr.c: Vercel UD-1 (IDR) specific stuff * * Copyright (C) 2002 Erik Mouw <J.A...@it...> * * $Id: idr.c,v 1.1 2002/01/03 16:07:18 erikm Exp $ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ #ident "$Id: idr.c,v 1.1 2002/01/03 16:07:18 erikm Exp $" #ifdef HAVE_CONFIG_H # include <blob/config.h> #endif #include <blob/init.h> #include <blob/serial.h> static void idr_init_hardware(void) { /* select serial driver */ serial_driver = &sa11x0_serial_driver; } __initlist(idr_init_hardware, INIT_LEVEL_DRIVER_SELECTION); --- NEW FILE: jornada720.c --- /* * jornada720.c: Jornada 720 specific stuff * * Copyright (C) 2002 Erik Mouw <J.A...@it...> * * $Id: jornada720.c,v 1.1 2002/01/03 16:07:18 erikm Exp $ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ #ident "$Id: jornada720.c,v 1.1 2002/01/03 16:07:18 erikm Exp $" #ifdef HAVE_CONFIG_H # include <blob/config.h> #endif #include <blob/init.h> #include <blob/serial.h> static void jornada720_init_hardware(void) { /* select serial driver */ serial_driver = &sa11x0_serial_driver; } __initlist(jornada720_init_hardware, INIT_LEVEL_DRIVER_SELECTION); --- NEW FILE: lart.c --- /* * lart.c: LART specific stuff * * Copyright (C) 2002 Erik Mouw <J.A...@it...> * * $Id: lart.c,v 1.1 2002/01/03 16:07:18 erikm Exp $ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ #ident "$Id: lart.c,v 1.1 2002/01/03 16:07:18 erikm Exp $" #ifdef HAVE_CONFIG_H # include <blob/config.h> #endif #include <blob/init.h> #include <blob/serial.h> static void lart_init_hardware(void) { /* select serial driver */ serial_driver = &sa11x0_serial_driver; } __initlist(lart_init_hardware, INIT_LEVEL_DRIVER_SELECTION); --- NEW FILE: nesa.c --- /* * nesa.c: NESA specific stuff * * Copyright (C) 2002 Erik Mouw <J.A...@it...> * * $Id: nesa.c,v 1.1 2002/01/03 16:07:18 erikm Exp $ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ #ident "$Id: nesa.c,v 1.1 2002/01/03 16:07:18 erikm Exp $" #ifdef HAVE_CONFIG_H # include <blob/config.h> #endif #include <blob/init.h> #include <blob/serial.h> static void nesa_init_hardware(void) { /* select serial driver */ serial_driver = &sa11x0_serial_driver; } __initlist(nesa_init_hardware, INIT_LEVEL_DRIVER_SELECTION); --- NEW FILE: pleb.c --- /* * pleb.c: PLEB specific stuff * * Copyright (C) 2002 Erik Mouw <J.A...@it...> * * $Id: pleb.c,v 1.1 2002/01/03 16:07:18 erikm Exp $ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ #ident "$Id: pleb.c,v 1.1 2002/01/03 16:07:18 erikm Exp $" #ifdef HAVE_CONFIG_H # include <blob/config.h> #endif #include <blob/init.h> #include <blob/serial.h> static void pleb_init_hardware(void) { /* select serial driver */ serial_driver = &sa11x0_serial_driver; } __initlist(pleb_init_hardware, INIT_LEVEL_DRIVER_SELECTION); --- NEW FILE: shannon.c --- /* * shannon.c: Shannon specific stuff * * Copyright (C) 2002 Erik Mouw <J.A...@it...> * * $Id: shannon.c,v 1.1 2002/01/03 16:07:18 erikm Exp $ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ #ident "$Id: shannon.c,v 1.1 2002/01/03 16:07:18 erikm Exp $" #ifdef HAVE_CONFIG_H # include <blob/config.h> #endif #include <blob/init.h> #include <blob/serial.h> static void shannon_init_hardware(void) { /* select serial driver */ serial_driver = &sa11x0_serial_driver; } __initlist(shannon_init_hardware, INIT_LEVEL_DRIVER_SELECTION); Index: Makefile.am =================================================================== RCS file: /cvsroot/blob/blob/src/diag/Makefile.am,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- Makefile.am 2001/10/28 22:14:20 1.5 +++ Makefile.am 2002/01/03 16:07:18 1.6 @@ -44,6 +44,17 @@ EXTRA_diag_elf32_SOURCES = \ lcd.c \ + assabet.c \ + badge4.c \ + brutus.c \ + clart.c \ + h3600.c \ + idr.c \ + jornada720.c \ + lart.c \ + nesa.c \ + pleb.c \ + shannon.c \ system3.c diag_elf32_DEPENDENCIES = \ Index: commands.c =================================================================== RCS file: /cvsroot/blob/blob/src/diag/commands.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- commands.c 2001/12/19 20:00:15 1.4 +++ commands.c 2002/01/03 16:07:18 1.5 @@ -30,6 +30,7 @@ #include <blob/command.h> #include <blob/command_hist.h> +#include <blob/error.h> #include <blob/reboot.h> #include <blob/serial.h> #include <blob/terminal.h> @@ -50,7 +51,7 @@ int GetCommand(char *command, int len, int timeout) { u32 startTime, currentTime; - char c; + int c; int i; int numRead; int maxRead = len - 1; @@ -63,7 +64,7 @@ for(numRead = 0, i = 0; numRead < maxRead;) { /* try to get a byte from the serial port */ - while(!SerialInputByte(&c)) { + while(serial_poll() != 0) { currentTime = TimerGetTime(); /* check timeout value */ @@ -76,11 +77,21 @@ } } + c = serial_read(); + + /* check for errors */ + if(c < 0) { + command[i++] = '\0'; + serial_write('\n'); + printerror(c, "can't read command"); + return c; + } + if((c == '\r') || (c == '\n')) { command[i++] = '\0'; /* print newline */ - SerialOutputByte('\n'); + serial_write('\n'); cmdhist_push( command ); return(numRead); } else if(c == '\b') { /* FIXME: is this backspace? */ @@ -125,7 +136,7 @@ numRead++; /* print character */ - SerialOutputByte(c); + serial_write(c); } } Index: initcalls.c =================================================================== RCS file: /cvsroot/blob/blob/src/diag/initcalls.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- initcalls.c 2001/10/15 21:27:05 1.2 +++ initcalls.c 2002/01/03 16:07:18 1.3 @@ -39,7 +39,7 @@ /* default serial initialisation */ static void serial_default_init(void) { - SerialInit(baud9k6); + serial_init(baud_9600); } Index: lcd.c =================================================================== RCS file: /cvsroot/blob/blob/src/diag/lcd.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- lcd.c 2001/10/15 15:02:40 1.4 +++ lcd.c 2002/01/03 16:07:18 1.5 @@ -51,7 +51,7 @@ #define OUTHEX( val ) SerialOutputString( #val"=0x" ); \ SerialOutputHex( val ); \ - SerialOutputByte( '\n' ); + serial_write( '\n' ); /********************************************************************** * program globals @@ -104,8 +104,8 @@ LCCR2 = LCD_LCCR2; LCCR1 = LCD_LCCR1; LCCR0 = LCD_LCCR0 & ~LCCR0_LEN; - DBAR1 = (u32 *)LCD_PALETTE_DMA_ADR; - DBAR2 = (u32 *)LCD_VIDEORAM_DMA_ADR; + DBAR1 = (u32)LCD_PALETTE_DMA_ADR; + DBAR2 = (u32)LCD_VIDEORAM_DMA_ADR; return 0; } @@ -164,7 +164,7 @@ { int ret = 0; int x,y; - char c; + int c; #if LCD_DEBUG OUTHEX( LCD_LCCR0 ); @@ -230,8 +230,7 @@ SerialOutputString( "done\n" ); SerialOutputString( "LCD: press any key to proceed\n" ); - while ( !SerialInputByte( &c ) ) - ; + c = serial_read(); SerialOutputString( "LCD: backlight off ..." ); ret = lcd_backlight_off(); Index: main.c =================================================================== RCS file: /cvsroot/blob/blob/src/diag/main.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- main.c 2001/11/04 23:20:16 1.3 +++ main.c 2002/01/03 16:07:18 1.4 @@ -45,7 +45,7 @@ init_subsystems(); #ifdef H3600 - SerialInit(baud115k2); /* DEBUG */ + serial_init(baud_115200); /* DEBUG */ #endif SerialOutputString("\ndiag version " VERSION " for " BOARD_NAME "\n" Index: system3.c =================================================================== RCS file: /cvsroot/blob/blob/src/diag/system3.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- system3.c 2001/11/13 13:20:31 1.5 +++ system3.c 2002/01/03 16:07:18 1.6 @@ -96,7 +96,7 @@ /********************************************************************** * prototypes */ -void sa1111_init(); +static void sa1111_init(); /*********************************************************************/ /*********************************************************************/ @@ -106,7 +106,7 @@ __initlist(sa1111_init, INIT_LEVEL_INITIAL_HARDWARE); -void sa1111_init() +static void sa1111_init() { /* switch on clock for sa1111 */ GAFR |= GPIO_32_768kHz; @@ -145,6 +145,18 @@ ((FExtr(MDCNFG, MDCNFG_SA1110_TDL0)==3) ? SMCR_CLAT : 0)); } + + + +static void system3_init_hardware(void) +{ + /* select serial driver */ + serial_driver = &sa11x0_serial_driver; +} + +__initlist(system3_init_hardware, INIT_LEVEL_DRIVER_SELECTION); + + /********************************************************************** * Overwrite LCD functions special for this platform */ @@ -281,7 +293,7 @@ SerialOutputString( registers[i].name ); SerialOutputString( "= 0x" ); SerialOutputHex( MEM( registers[i].adr ) ); - SerialOutputByte( '\n' ); + serial_write( '\n' ); i++; } |
From: Erik M. <er...@us...> - 2002-01-03 16:07:21
|
Update of /cvsroot/blob/blob/utils/mkparamblock In directory usw-pr-cvs1:/tmp/cvs-serv2589/utils/mkparamblock Modified Files: mkparamblock.c Log Message: The serial port driver rewrite, part two. This looks quite intrusive, but it's not that large: - rewrite src/lib/serial.c to use the low level serial driver - change semantics for SerialInputByte() and SerialOutputByte(), so rename them to serial_read() and serial_write(). this makes the patch huge - add new INIT_LEVEL for driver selection (has to be done before hardware initialisation) - add machine specific files for all architectures in diag - clean up odds and ends. Index: mkparamblock.c =================================================================== RCS file: /cvsroot/blob/blob/utils/mkparamblock/mkparamblock.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- mkparamblock.c 2001/10/07 16:29:52 1.6 +++ mkparamblock.c 2002/01/03 16:07:18 1.7 @@ -14,36 +14,36 @@ int convert_baud(char *arg) { - eBauds retval; + serial_baud_t retval; if(strcmp(arg, "1200") == 0) { - retval = baud1k2; + retval = baud_1200; } else if(strcmp(arg, "1k2") == 0) { - retval = baud1k2; + retval = baud_1200; } else if(strcmp(arg, "9600") == 0) { - retval = baud9k6; + retval = baud_9600; } else if(strcmp(arg, "9k6") == 0) { - retval = baud9k6; + retval = baud_9600; } else if(strcmp(arg, "19200") == 0) { - retval = baud19k2; + retval = baud_19200; } else if(strcmp(arg, "19k2") == 0) { - retval = baud19k2; + retval = baud_19200; } else if(strcmp(arg, "38400") == 0) { - retval = baud38k4; + retval = baud_38400; } else if(strcmp(arg, "38k4") == 0) { - retval = baud38k4; + retval = baud_38400; } else if(strcmp(arg, "57600") == 0) { - retval = baud57k6; + retval = baud_57600; } else if(strcmp(arg, "57k6") == 0) { - retval = baud57k6; + retval = baud_57600; } else if(strcmp(arg, "115200") == 0) { - retval = baud115k2; + retval = baud_115200; } else if(strcmp(arg, "115k2") == 0) { - retval = baud115k2; + retval = baud_115200; } else if(strcmp(arg, "230400") == 0) { - retval = baud230k4; + retval = baud_230400; } else if(strcmp(arg, "230k4") == 0) { - retval = baud230k4; + retval = baud_230400; } else return -1; return (int) retval; @@ -146,7 +146,7 @@ tag.hdr.conf_mask = 0; tag.hdr.conf = 0; - tag.u.core.terminal = baud9k6; + tag.u.core.terminal = baud_9600; fwrite(&tag, ptag_size(ptag_core), 4, fp); } |
From: Erik M. <er...@us...> - 2002-01-03 16:07:21
|
Update of /cvsroot/blob/blob/include/blob/arch In directory usw-pr-cvs1:/tmp/cvs-serv2589/include/blob/arch Modified Files: system3.h Log Message: The serial port driver rewrite, part two. This looks quite intrusive, but it's not that large: - rewrite src/lib/serial.c to use the low level serial driver - change semantics for SerialInputByte() and SerialOutputByte(), so rename them to serial_read() and serial_write(). this makes the patch huge - add new INIT_LEVEL for driver selection (has to be done before hardware initialisation) - add machine specific files for all architectures in diag - clean up odds and ends. Index: system3.h =================================================================== RCS file: /cvsroot/blob/blob/include/blob/arch/system3.h,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- system3.h 2001/12/27 18:27:37 1.7 +++ system3.h 2002/01/03 16:07:17 1.8 @@ -124,7 +124,7 @@ #ifdef SYSTEM3_DEBUG # define _DBGU32( x ) SerialOutputString( #x"=0x" ); \ SerialOutputHex( (u32)x ); \ - SerialOutputByte( '\n' ); + serial_write( '\n' ); #else # define _DBGU32( x ) #endif |
From: Erik M. <er...@us...> - 2002-01-03 16:07:21
|
Update of /cvsroot/blob/blob/src/lib In directory usw-pr-cvs1:/tmp/cvs-serv2589/src/lib Modified Files: command.c error.c init.c serial-sa11x0.c serial.c terminal.c util.c Log Message: The serial port driver rewrite, part two. This looks quite intrusive, but it's not that large: - rewrite src/lib/serial.c to use the low level serial driver - change semantics for SerialInputByte() and SerialOutputByte(), so rename them to serial_read() and serial_write(). this makes the patch huge - add new INIT_LEVEL for driver selection (has to be done before hardware initialisation) - add machine specific files for all architectures in diag - clean up odds and ends. Index: command.c =================================================================== RCS file: /cvsroot/blob/blob/src/lib/command.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- command.c 2001/12/19 19:03:45 1.8 +++ command.c 2002/01/03 16:07:18 1.9 @@ -130,7 +130,7 @@ SerialOutputDec(i); SerialOutputString("] = "); SerialOutputString(argv[i]); - SerialOutputByte('\n'); + serial_write('\n'); } #endif } @@ -153,7 +153,7 @@ printerrprefix(); SerialOutputString(__FUNCTION__ "(): Address = 0x"); SerialOutputHex((u32)cmd); - SerialOutputByte('\n'); + serial_write('\n'); #endif return -EMAGIC; } @@ -203,7 +203,7 @@ printerrprefix(); SerialOutputString(__FUNCTION__ "(): Address = 0x"); SerialOutputHex((u32)cmd); - SerialOutputByte('\n'); + serial_write('\n'); #endif return -EMAGIC; @@ -280,7 +280,7 @@ int __attribute__((weak)) GetCommand(char *command, int len, int timeout) { u32 startTime, currentTime; - char c; + int c; int i; int numRead; int maxRead = len - 1; @@ -291,7 +291,7 @@ for(numRead = 0, i = 0; numRead < maxRead;) { /* try to get a byte from the serial port */ - while(!SerialInputByte(&c)) { + while(serial_poll() != 0) { currentTime = TimerGetTime(); /* check timeout value */ @@ -303,11 +303,21 @@ } } + c = serial_read(); + + /* check for errors */ + if(c < 0) { + command[i++] = '\0'; + serial_write('\n'); + printerror(c, "can't read command"); + return c; + } + if((c == '\r') || (c == '\n')) { command[i++] = '\0'; /* print newline */ - SerialOutputByte('\n'); + serial_write('\n'); return(numRead); } else if(c == '\b') { /* FIXME: is this backspace? */ if(i > 0) { @@ -321,7 +331,7 @@ numRead++; /* print character */ - SerialOutputByte(c); + serial_write(c); } } Index: error.c =================================================================== RCS file: /cvsroot/blob/blob/src/lib/error.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- error.c 2002/01/02 01:21:41 1.5 +++ error.c 2002/01/03 16:07:18 1.6 @@ -87,5 +87,5 @@ SerialOutputString(s); } - SerialOutputByte('\n'); + serial_write('\n'); } Index: init.c =================================================================== RCS file: /cvsroot/blob/blob/src/lib/init.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- init.c 2001/10/07 19:34:17 1.2 +++ init.c 2002/01/03 16:07:18 1.3 @@ -53,7 +53,7 @@ printerrprefix(); SerialOutputString("Address = 0x"); SerialOutputHex((u32)item); - SerialOutputByte('\n'); + serial_write('\n'); #endif return; } Index: serial-sa11x0.c =================================================================== RCS file: /cvsroot/blob/blob/src/lib/serial-sa11x0.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- serial-sa11x0.c 2002/01/02 01:18:57 1.1 +++ serial-sa11x0.c 2002/01/03 16:07:18 1.2 @@ -73,7 +73,7 @@ /* flush serial input queue. returns 0 on success or negative error * number otherwise */ -static int sa11x0_serial_flush_in(void) +static int sa11x0_serial_flush_input(void) { volatile u32 tmp; @@ -94,7 +94,7 @@ /* flush output queue. returns 0 on success or negative error number * otherwise */ -static int sa11x0_serial_flush_out(void) +static int sa11x0_serial_flush_output(void) { /* wait until the transmitter is no longer busy */ while(SerialUTSR1 & UTSR1_TBY) { @@ -153,7 +153,7 @@ Ser1SDCR0 = SDCR0_UART; #endif - sa11x0_serial_flush_out(); + sa11x0_serial_flush_output(); /* switch receiver and transmitter off */ SerialUTCR3 = 0x00; @@ -240,6 +240,6 @@ read: sa11x0_serial_read, write: sa11x0_serial_write, poll: sa11x0_serial_poll, - flush_in: sa11x0_serial_flush_in, - flush_out: sa11x0_serial_flush_out + flush_input: sa11x0_serial_flush_input, + flush_output: sa11x0_serial_flush_output }; Index: serial.c =================================================================== RCS file: /cvsroot/blob/blob/src/lib/serial.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- serial.c 2002/01/02 01:18:57 1.5 +++ serial.c 2002/01/03 16:07:18 1.6 @@ -37,86 +37,76 @@ #include <blob/arch.h> +#include <blob/errno.h> #include <blob/led.h> #include <blob/sa1100.h> #include <blob/serial.h> #include <blob/time.h> + + serial_driver_t *serial_driver; -/* - * Initialise the serial port with the given baudrate. The settings - * are always 8 data bits, no parity, 1 stop bit, no start bits. - * + + +/* initialise serial port at the request baudrate. returns 0 on + * success, or a negative error number on failure */ -void SerialInit(eBauds baudrate) +int serial_init(serial_baud_t baudrate) { - /* Theory of operations: - * - Flush the output buffer - * - switch receiver and transmitter off - * - clear all sticky bits in control register 3 - * - set the port to sensible defaults (no break, no interrupts, - * no parity, 8 databits, 1 stopbit, transmitter and receiver - * enabled - * - set the baudrate to the requested value - * - turn the receiver and transmitter back on - */ - -#if defined USE_SERIAL1 - /* select UART use for serial port 1 */ - Ser1SDCR0 = SDCR0_UART; - - while(Ser1UTSR1 & UTSR1_TBY) { +#ifdef BLOB_DEBUG + if(serial_driver == NULL) { + /* we can't print anything over here, so just return + * an error and hope the developer will figure out. + */ + return -ERANGE; } +#endif - Ser1UTCR3 = 0x00; - Ser1UTSR0 = 0xff; - Ser1UTCR0 = ( UTCR0_1StpBit | UTCR0_8BitData ); - Ser1UTCR1 = 0; - Ser1UTCR2 = (u32)baudrate; - Ser1UTCR3 = ( UTCR3_RXE | UTCR3_TXE ); -#elif defined USE_SERIAL3 - while(Ser3UTSR1 & UTSR1_TBY) { - } + return serial_driver->init(baudrate); +} - Ser3UTCR3 = 0x00; - Ser3UTSR0 = 0xff; - Ser3UTCR0 = ( UTCR0_1StpBit | UTCR0_8BitData ); - Ser3UTCR1 = 0; - Ser3UTCR2 = (u32)baudrate; - Ser3UTCR3 = ( UTCR3_RXE | UTCR3_TXE ); -#else -#error "Configuration error: No serial port used at all!" -#endif + + + +/* read one character from the serial port. return character (between + * 0 and 255) on success, or negative error number on failure. this + * function is blocking */ +int serial_read(void) +{ + return serial_driver->read(); } -/* - * Output a single byte to the serial port. +/* write character to serial port. return 0 on success, or negative + * error number on failure. this function is blocking */ -void SerialOutputByte(const char c) +int serial_write(int c) { -#if defined USE_SERIAL1 - /* wait for room in the tx FIFO */ - while((Ser1UTSR0 & UTSR0_TFS) == 0) ; + int rv; - Ser1UTDR = c; -#elif defined USE_SERIAL3 - /* wait for room in the tx FIFO */ - while((Ser3UTSR0 & UTSR0_TFS) == 0) ; + rv = serial_driver->write(c); + + /* if \n, also do \r */ + if(c == '\n') + rv = serial_driver->write('\r'); - Ser3UTDR = c; -#else -#error "Configuration error: No serial port used at all!" -#endif + return rv; +} - /* If \n, also do \r */ - if(c == '\n') - SerialOutputByte('\r'); + + + +/* check if there is a character available to read. returns 1 if there + * is a character available, 0 if not, and negative error number on + * failure */ +int serial_poll(void) +{ + return serial_driver->poll(); } @@ -125,11 +115,10 @@ /* * Write a null terminated string to the serial port. */ -void SerialOutputString(const char *s) { - +void SerialOutputString(const char *s) +{ while(*s != 0) - SerialOutputByte(*s++); - + serial_write(*s++); } /* SerialOutputString */ @@ -153,7 +142,7 @@ else c += '0'; - SerialOutputByte(c); + serial_write(c); } } @@ -181,7 +170,7 @@ leading_zero = 0; if(leading_zero == 0) - SerialOutputByte((char)(result) + '0'); + serial_write((char)(result) + '0'); } } @@ -197,58 +186,13 @@ void SerialOutputBlock(const char *buf, int bufsize) { while(bufsize--) - SerialOutputByte(*buf++); + serial_write(*buf++); } /* - * Read a single byte from the serial port. Returns 1 on success, 0 - * otherwise. When the function is succesfull, the character read is - * written into its argument c. - */ -int SerialInputByte(char *c) -{ -#if defined USE_SERIAL1 - if(Ser1UTSR1 & UTSR1_RNE) { - int err = Ser1UTSR1 & (UTSR1_PRE | UTSR1_FRE | UTSR1_ROR); - *c = (char)Ser1UTDR; -#elif defined USE_SERIAL3 - if(Ser3UTSR1 & UTSR1_RNE) { - int err = Ser3UTSR1 & (UTSR1_PRE | UTSR1_FRE | UTSR1_ROR); - *c = (char)Ser3UTDR; -#else -#error "Configuration error: No serial port at all" -#endif - - /* If you're lucky, you should be able to use this as - * debug information ;-) -- Erik - */ - if(err & UTSR1_PRE) - SerialOutputByte('@'); - else if(err & UTSR1_FRE) - SerialOutputByte('#'); - else if(err & UTSR1_ROR) - SerialOutputByte('$'); - - /* We currently only care about framing and parity errors */ - if((err & (UTSR1_PRE | UTSR1_FRE)) != 0) { - return SerialInputByte(c); - } else { - led_toggle(); - return(1); - } - } else { - /* no bit ready */ - return(0); - } -} /* SerialInputByte */ - - - - -/* * read a string with maximum length len from the serial port * using a timeout of timeout seconds * @@ -259,7 +203,7 @@ int SerialInputString(char *s, const int len, const int timeout) { u32 startTime, currentTime; - char c; + int c; int i; int numRead; int skipNewline = 1; @@ -269,7 +213,7 @@ for(numRead = 0, i = 0; numRead < maxRead;) { /* try to get a byte from the serial port */ - while(!SerialInputByte(&c)) { + while(serial_poll() == 0) { currentTime = TimerGetTime(); /* check timeout value */ @@ -281,6 +225,14 @@ } } + c = serial_read(); + + /* check for errors */ + if(c < 0) { + s[i++] = '\0'; + return c; + } + /* eat newline characters at start of string */ if((skipNewline == 1) && (c != '\r') && (c != '\n')) skipNewline = 0; @@ -290,7 +242,7 @@ s[i++] = '\0'; return(numRead); } else { - s[i++] = c; + s[i++] = (char)c; numRead++; } } @@ -310,7 +262,7 @@ int SerialInputBlock(char *buf, int bufsize, const int timeout) { u32 startTime, currentTime; - char c; + int c; int i; int numRead; int maxRead = bufsize; @@ -319,7 +271,7 @@ for(numRead = 0, i = 0; numRead < maxRead;) { /* try to get a byte from the serial port */ - while(!SerialInputByte(&c)) { + while(serial_poll() == 0) { currentTime = TimerGetTime(); /* check timeout value */ @@ -330,6 +282,12 @@ } } + c = serial_read(); + + /* check for errors */ + if(c < 0) + return c; + buf[i++] = c; numRead ++; } Index: terminal.c =================================================================== RCS file: /cvsroot/blob/blob/src/lib/terminal.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- terminal.c 2001/10/07 22:36:11 1.4 +++ terminal.c 2002/01/03 16:07:18 1.5 @@ -45,7 +45,7 @@ SerialOutputString(" c"); for(i = 0; i < 100; i++) - SerialOutputByte('\n'); + serial_write('\n'); SerialOutputString("c"); Index: util.c =================================================================== RCS file: /cvsroot/blob/blob/src/lib/util.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- util.c 2001/10/07 22:58:56 1.3 +++ util.c 2002/01/03 16:07:18 1.4 @@ -51,12 +51,12 @@ SerialOutputHex((int)src); SerialOutputString(" to 0x"); SerialOutputHex((int)dest); - SerialOutputByte('\n'); + serial_write('\n'); #endif while(numWords--) { if((numWords & 0xffff) == 0x0) - SerialOutputByte('.'); + serial_write('.'); *dest++ = *src++; } |
From: Erik M. <er...@us...> - 2002-01-03 16:07:21
|
Update of /cvsroot/blob/blob/include/blob In directory usw-pr-cvs1:/tmp/cvs-serv2589/include/blob Modified Files: init.h main.h serial.h Log Message: The serial port driver rewrite, part two. This looks quite intrusive, but it's not that large: - rewrite src/lib/serial.c to use the low level serial driver - change semantics for SerialInputByte() and SerialOutputByte(), so rename them to serial_read() and serial_write(). this makes the patch huge - add new INIT_LEVEL for driver selection (has to be done before hardware initialisation) - add machine specific files for all architectures in diag - clean up odds and ends. Index: init.h =================================================================== RCS file: /cvsroot/blob/blob/include/blob/init.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- init.h 2001/10/07 15:27:35 1.2 +++ init.h 2002/01/03 16:07:17 1.3 @@ -63,10 +63,11 @@ #define INIT_LEVEL_MAX (99) /* define some useful levels */ -#define INIT_LEVEL_INITIAL_HARDWARE (0) -#define INIT_LEVEL_PARAM_LIST (10) -#define INIT_LEVEL_OTHER_HARDWARE (20) -#define INIT_LEVEL_OTHER_STUFF (30) +#define INIT_LEVEL_DRIVER_SELECTION (0) +#define INIT_LEVEL_INITIAL_HARDWARE (10) +#define INIT_LEVEL_PARAM_LIST (20) +#define INIT_LEVEL_OTHER_HARDWARE (30) +#define INIT_LEVEL_OTHER_STUFF (40) void init_subsystems(void); Index: main.h =================================================================== RCS file: /cvsroot/blob/blob/include/blob/main.h,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- main.h 2001/10/31 16:38:52 1.4 +++ main.h 2002/01/03 16:07:17 1.5 @@ -58,8 +58,8 @@ int blobSize; block_source_t blobType; - eBauds downloadSpeed; - eBauds terminalSpeed; + serial_baud_t downloadSpeed; + serial_baud_t terminalSpeed; int load_ramdisk; int boot_delay; Index: serial.h =================================================================== RCS file: /cvsroot/blob/blob/include/blob/serial.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- serial.h 2002/01/02 01:18:57 1.3 +++ serial.h 2002/01/03 16:07:17 1.4 @@ -55,8 +55,8 @@ typedef int (*serial_read_func_t)(void); typedef int (*serial_write_func_t)(int); typedef int (*serial_poll_func_t)(void); -typedef int (*serial_flush_in_func_t)(void); -typedef int (*serial_flush_out_func_t)(void); +typedef int (*serial_flush_input_func_t)(void); +typedef int (*serial_flush_output_func_t)(void); typedef struct { @@ -67,8 +67,8 @@ serial_poll_func_t poll; - serial_flush_in_func_t flush_in; - serial_flush_out_func_t flush_out; + serial_flush_input_func_t flush_input; + serial_flush_output_func_t flush_output; } serial_driver_t; @@ -80,29 +80,18 @@ extern serial_driver_t *serial_driver; -/* ---- OLD STUFF BELOW ----------------------------------- */ - -typedef enum { /* Some useful SA-1100 baud rates */ - baud1k2 = 191, - baud9k6 = 23, - baud19k2 = 11, - baud38k4 = 5, - baud57k6 = 3, - baud115k2 = 1, - baud230k4 = 0 -} eBauds; - +/* exported functions */ +int serial_init(serial_baud_t baudrate); +int serial_read(void); +int serial_write(int c); +int serial_poll(void); -/* Function protos */ -void SerialInit(eBauds baudrate); -void SerialOutputByte(const char c); void SerialOutputString(const char *s); void SerialOutputHex(const u32 h); void SerialOutputDec(const u32 d); void SerialOutputBlock(const char *buf, int bufsize); -int SerialInputByte(char *c); int SerialInputString(char *s, const int len, const int timeout); int SerialInputBlock(char *buf, int bufsize, const int timeout); |
From: Erik M. <er...@us...> - 2002-01-03 16:07:21
|
Update of /cvsroot/blob/blob/src/blob In directory usw-pr-cvs1:/tmp/cvs-serv2589/src/blob Modified Files: assabet.c badge4.c brutus.c clart.c debug.c flash.c h3600.c idr.c initcalls.c intel16.c intel32.c jornada720.c lart.c main.c memory.c nesa.c param_block.c partition.c pleb.c shannon.c system3.c uucodec.c Log Message: The serial port driver rewrite, part two. This looks quite intrusive, but it's not that large: - rewrite src/lib/serial.c to use the low level serial driver - change semantics for SerialInputByte() and SerialOutputByte(), so rename them to serial_read() and serial_write(). this makes the patch huge - add new INIT_LEVEL for driver selection (has to be done before hardware initialisation) - add machine specific files for all architectures in diag - clean up odds and ends. Index: assabet.c =================================================================== RCS file: /cvsroot/blob/blob/src/blob/assabet.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- assabet.c 2002/01/02 01:18:57 1.5 +++ assabet.c 2002/01/03 16:07:17 1.6 @@ -55,7 +55,7 @@ flash_driver = &intel32_flash_driver; } -__initlist(init_assabet_flash_driver, INIT_LEVEL_OTHER_STUFF); +__initlist(init_assabet_flash_driver, INIT_LEVEL_DRIVER_SELECTION); @@ -75,4 +75,4 @@ } -__initlist(assabet_init_hardware, INIT_LEVEL_INITIAL_HARDWARE); +__initlist(assabet_init_hardware, INIT_LEVEL_DRIVER_SELECTION); Index: badge4.c =================================================================== RCS file: /cvsroot/blob/blob/src/blob/badge4.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- badge4.c 2002/01/02 01:18:57 1.2 +++ badge4.c 2002/01/03 16:07:17 1.3 @@ -62,7 +62,7 @@ flash_driver = &intel16_flash_driver; } -__initlist(init_flash_driver, INIT_LEVEL_OTHER_STUFF); +__initlist(init_flash_driver, INIT_LEVEL_DRIVER_SELECTION); static void init_hardware(void) @@ -79,4 +79,4 @@ } -__initlist(init_hardware, INIT_LEVEL_INITIAL_HARDWARE); +__initlist(init_hardware, INIT_LEVEL_DRIVER_SELECTION); Index: brutus.c =================================================================== RCS file: /cvsroot/blob/blob/src/blob/brutus.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- brutus.c 2002/01/02 01:18:57 1.4 +++ brutus.c 2002/01/03 16:07:17 1.5 @@ -52,7 +52,7 @@ flash_driver = &null_flash_driver; } -__initlist(init_brutus_flash_driver, INIT_LEVEL_OTHER_STUFF); +__initlist(init_brutus_flash_driver, INIT_LEVEL_DRIVER_SELECTION); @@ -63,4 +63,4 @@ serial_driver = &sa11x0_serial_driver; } -__initlist(brutus_init_hardware, INIT_LEVEL_INITIAL_HARDWARE); +__initlist(brutus_init_hardware, INIT_LEVEL_DRIVER_SELECTION); Index: clart.c =================================================================== RCS file: /cvsroot/blob/blob/src/blob/clart.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- clart.c 2002/01/02 01:18:57 1.4 +++ clart.c 2002/01/03 16:07:17 1.5 @@ -55,7 +55,7 @@ flash_driver = &intel16_flash_driver; } -__initlist(init_clart_flash_driver, INIT_LEVEL_OTHER_STUFF); +__initlist(init_clart_flash_driver, INIT_LEVEL_DRIVER_SELECTION); @@ -66,4 +66,4 @@ serial_driver = &sa11x0_serial_driver; } -__initlist(clart_init_hardware, INIT_LEVEL_INITIAL_HARDWARE); +__initlist(clart_init_hardware, INIT_LEVEL_DRIVER_SELECTION); Index: debug.c =================================================================== RCS file: /cvsroot/blob/blob/src/blob/debug.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- debug.c 2001/12/16 18:23:37 1.7 +++ debug.c 2002/01/03 16:07:17 1.8 @@ -99,7 +99,7 @@ SerialOutputHex((int)src); SerialOutputString(" to 0x"); SerialOutputHex((int)dest); - SerialOutputByte('\n'); + serial_write('\n'); MyMemCpy( (u32 *)dest, (const u32 *)src, len); @@ -152,8 +152,8 @@ SerialOutputString(" val=0x"); SerialOutputHex(value); SerialOutputString(" type="); - SerialOutputByte(type); - SerialOutputByte('\n'); + serial_write(type); + serial_write('\n'); #endif /* check memory alignment */ @@ -244,8 +244,8 @@ SerialOutputString("adr=0x"); SerialOutputHex(address); SerialOutputString(" type="); - SerialOutputByte(type); - SerialOutputByte('\n'); + serial_write(type); + serial_write('\n'); #endif /* check memory alignment */ @@ -294,8 +294,8 @@ break; } - SerialOutputByte(type); - SerialOutputByte(' '); + serial_write(type); + serial_write(' '); SerialOutputHex(value); SerialOutputString("\n"); @@ -354,16 +354,16 @@ for (tmpaddress = address; tmpaddress < address + 0x10; tmpaddress += 4) { value = (*((u32 *)tmpaddress)); SerialOutputHex(value); - SerialOutputByte(' '); + serial_write(' '); } for (tmpaddress = address; tmpaddress < address + 0x10; tmpaddress++) { value = (*((u8 *)tmpaddress)) & 0xff; if ((value >= ' ') && (value <= '~')) - SerialOutputByte(value); + serial_write(value); else - SerialOutputByte('.'); + serial_write('.'); } - SerialOutputByte('\n'); + serial_write('\n'); } ret = 0; @@ -457,5 +457,5 @@ } SerialOutputString(strerror(errno)); - SerialOutputByte('\n'); + serial_write('\n'); } Index: flash.c =================================================================== RCS file: /cvsroot/blob/blob/src/blob/flash.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- flash.c 2001/12/31 00:28:53 1.10 +++ flash.c 2002/01/03 16:07:17 1.11 @@ -181,7 +181,7 @@ SerialOutputDec(nwords); SerialOutputString(") words at 0x"); SerialOutputHex((u32)start); - SerialOutputByte('\n'); + serial_write('\n'); #endif flash_driver->enable_vpp(); @@ -190,7 +190,7 @@ if(*cur != 0xffffffff) { SerialOutputString("erasing dirty block at 0x"); SerialOutputHex((u32)cur); - SerialOutputByte('\n'); + serial_write('\n'); /* dirty block */ rv = flash_driver->erase(cur); @@ -199,7 +199,7 @@ printerrprefix(); SerialOutputString("flash erase error at 0x"); SerialOutputHex((u32)cur); - SerialOutputByte('\n'); + serial_write('\n'); flash_driver->disable_vpp(); return rv; } @@ -248,7 +248,7 @@ SerialOutputHex((u32)src); SerialOutputString(" to 0x"); SerialOutputHex((u32)dst); - SerialOutputByte('\n'); + serial_write('\n'); #endif flash_driver->enable_vpp(); @@ -298,7 +298,7 @@ SerialOutputString(" resume writing at 0x"); SerialOutputHex((u32)&dst[i]); - SerialOutputByte('\n'); + serial_write('\n'); } /* there is something seriously wrong if this is true */ @@ -322,7 +322,7 @@ SerialOutputString(" erase operations\n"); SerialOutputDec(nscandown); SerialOutputString(" words scanned down\n"); - SerialOutputByte('\n'); + serial_write('\n'); #endif flash_driver->disable_vpp(); @@ -416,7 +416,7 @@ SerialOutputHex((u32)start); SerialOutputString(", nwords = 0x"); SerialOutputHex(nwords); - SerialOutputByte('\n'); + serial_write('\n'); #endif rv = address_range_to_block_range((u32) start, nwords * sizeof(u32), @@ -452,7 +452,7 @@ printerrprefix(); SerialOutputString("can't (un)lock block at 0x"); SerialOutputHex((u32)addr); - SerialOutputByte('\n'); + serial_write('\n'); #endif return rv; } Index: h3600.c =================================================================== RCS file: /cvsroot/blob/blob/src/blob/h3600.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- h3600.c 2002/01/02 01:18:57 1.4 +++ h3600.c 2002/01/03 16:07:17 1.5 @@ -115,7 +115,7 @@ flash_driver->disable_vpp = h3600_flash_disable_vpp; } -__initlist(init_h3600_flash_driver, INIT_LEVEL_OTHER_STUFF); +__initlist(init_h3600_flash_driver, INIT_LEVEL_DRIVER_SELECTION); @@ -130,4 +130,4 @@ serial_driver = &sa11x0_serial_driver; } -__initlist(h3600_init_hardware, INIT_LEVEL_INITIAL_HARDWARE); +__initlist(h3600_init_hardware, INIT_LEVEL_DRIVER_SELECTION); Index: idr.c =================================================================== RCS file: /cvsroot/blob/blob/src/blob/idr.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- idr.c 2002/01/02 01:18:57 1.3 +++ idr.c 2002/01/03 16:07:17 1.4 @@ -49,7 +49,7 @@ flash_driver = &intel16_flash_driver; } -__initlist(init_idr_flash_driver, INIT_LEVEL_OTHER_STUFF); +__initlist(init_idr_flash_driver, INIT_LEVEL_DRIVER_SELECTION); static void idr_init_hardware(void) @@ -58,4 +58,4 @@ serial_driver = &sa11x0_serial_driver; } -__initlist(idr_init_hardware, INIT_LEVEL_INITIAL_HARDWARE); +__initlist(idr_init_hardware, INIT_LEVEL_DRIVER_SELECTION); Index: initcalls.c =================================================================== RCS file: /cvsroot/blob/blob/src/blob/initcalls.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- initcalls.c 2001/10/15 21:27:05 1.2 +++ initcalls.c 2002/01/03 16:07:17 1.3 @@ -39,7 +39,7 @@ /* default serial initialisation */ static void serial_default_init(void) { - SerialInit(baud9k6); + serial_init(baud_9600); } Index: intel16.c =================================================================== RCS file: /cvsroot/blob/blob/src/blob/intel16.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- intel16.c 2001/12/28 01:06:12 1.3 +++ intel16.c 2002/01/03 16:07:17 1.4 @@ -86,7 +86,7 @@ SerialOutputHex(result); SerialOutputString(", addr=0x"); SerialOutputHex((u32) addr); - SerialOutputByte('\n'); + serial_write('\n'); #endif return -EFLASHERASE; } @@ -135,7 +135,7 @@ SerialOutputHex(*dst); SerialOutputString(", *src=0x"); SerialOutputHex(*src); - SerialOutputByte('\n'); + serial_write('\n'); #endif return -EFLASHPGM; } @@ -228,7 +228,7 @@ SerialOutputHex((u32) blockStart); SerialOutputString(", status=0x"); SerialOutputHex((u32) result); - SerialOutputByte('\n'); + serial_write('\n'); #endif return -EFLASHPGM; } @@ -268,7 +268,7 @@ SerialOutputHex((u32) blockStart); SerialOutputString(", status=0x"); SerialOutputHex((u32) result); - SerialOutputByte('\n'); + serial_write('\n'); #endif return -EFLASHPGM; } @@ -297,7 +297,7 @@ SerialOutputHex((u32) blockStart); SerialOutputString(": 0x"); SerialOutputHex((u32) result); - SerialOutputByte('\n'); + serial_write('\n'); #endif return result & (LOCK_STATUS_LOCKED | LOCK_STATUS_LOCKEDDOWN); Index: intel32.c =================================================================== RCS file: /cvsroot/blob/blob/src/blob/intel32.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- intel32.c 2001/12/28 01:06:12 1.3 +++ intel32.c 2002/01/03 16:07:18 1.4 @@ -87,7 +87,7 @@ SerialOutputHex(result); SerialOutputString(", addr=0x"); SerialOutputHex((u32) addr); - SerialOutputByte('\n'); + serial_write('\n'); #endif return -EFLASHERASE; } @@ -132,7 +132,7 @@ SerialOutputHex(result); SerialOutputString(", addr=0x"); SerialOutputHex((u32) dst); - SerialOutputByte('\n'); + serial_write('\n'); #endif return -EFLASHPGM; } Index: jornada720.c =================================================================== RCS file: /cvsroot/blob/blob/src/blob/jornada720.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- jornada720.c 2002/01/02 01:18:57 1.2 +++ jornada720.c 2002/01/03 16:07:18 1.3 @@ -30,6 +30,7 @@ #include <blob/init.h> #include <blob/sa1100.h> #include <blob/serial.h> +#include <blob/time.h> /* flash descriptor for Jornada720 flash */ @@ -74,7 +75,7 @@ flash_driver->disable_vpp = jornada720_disable_vpp; } -__initlist(init_flash_driver, INIT_LEVEL_OTHER_STUFF); +__initlist(init_flash_driver, INIT_LEVEL_DRIVER_SELECTION); static void init_hardware(void) @@ -99,4 +100,4 @@ serial_driver = &sa11x0_serial_driver; } -__initlist(init_hardware, INIT_LEVEL_INITIAL_HARDWARE); +__initlist(init_hardware, INIT_LEVEL_DRIVER_SELECTION); Index: lart.c =================================================================== RCS file: /cvsroot/blob/blob/src/blob/lart.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- lart.c 2002/01/02 01:18:57 1.5 +++ lart.c 2002/01/03 16:07:18 1.6 @@ -64,7 +64,7 @@ flash_driver = &intel32_flash_driver; } -__initlist(init_lart_flash_driver, INIT_LEVEL_OTHER_STUFF); +__initlist(init_lart_flash_driver, INIT_LEVEL_DRIVER_SELECTION); @@ -75,4 +75,4 @@ serial_driver = &sa11x0_serial_driver; } -__initlist(lart_init_hardware, INIT_LEVEL_INITIAL_HARDWARE); +__initlist(lart_init_hardware, INIT_LEVEL_DRIVER_SELECTION); Index: main.c =================================================================== RCS file: /cvsroot/blob/blob/src/blob/main.c,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- main.c 2001/12/27 18:27:37 1.19 +++ main.c 2002/01/03 16:07:18 1.20 @@ -58,7 +58,7 @@ static int do_reload(char *what); -static void PrintSerialSpeed(eBauds speed); +static void PrintSerialSpeed(serial_baud_t speed); static void print_elf_sections(void); @@ -87,18 +87,18 @@ blob_status.paramType = fromFlash; blob_status.kernelType = fromFlash; blob_status.ramdiskType = fromFlash; - blob_status.downloadSpeed = baud115k2; - blob_status.terminalSpeed = baud9k6; + blob_status.downloadSpeed = baud_115200; + blob_status.terminalSpeed = baud_9600; blob_status.load_ramdisk = 1; blob_status.cmdline[0] = '\0'; blob_status.boot_delay = 10; - /* call SerialInit() because the default 9k6 speed might not + /* call serial_init() because the default 9k6 speed might not be what the user requested */ #if defined(H3600) || defined(SHANNON) || defined(IDR) || defined(BADGE4) || defined(JORNADA720) - blob_status.terminalSpeed = baud115k2; /* DEBUG */ + blob_status.terminalSpeed = baud_115200; /* DEBUG */ #endif - SerialInit(blob_status.terminalSpeed); + serial_init(blob_status.terminalSpeed); /* parse the core tag, for critical things like terminal speed */ #ifdef PARAM_START @@ -128,7 +128,7 @@ SerialOutputString("Current stack pointer: 0x"); asm("mov %0, sp": "=r" (stackptr)); SerialOutputHex(stackptr); - SerialOutputByte('\n'); + serial_write('\n'); } #endif @@ -146,7 +146,7 @@ /* wait 10 seconds before starting autoboot */ SerialOutputString("Autoboot in progress, press any key to stop "); for(i = 0; i < blob_status.boot_delay; i++) { - SerialOutputByte('.'); + serial_write('.'); retval = SerialInputBlock(commandline, 1, 1); @@ -234,7 +234,7 @@ PrintSerialSpeed(blob_status.terminalSpeed); SerialOutputString(" baud.\n"); - SerialInit(blob_status.downloadSpeed); + serial_init(blob_status.downloadSpeed); } else { SerialOutputString("You have 60 seconds to start downloading.\n"); } @@ -254,7 +254,7 @@ /* reload the correct memory */ do_reload(argv[1]); - SerialInit(blob_status.terminalSpeed); + serial_init(blob_status.terminalSpeed); return retval; } SerialOutputString("Received "); @@ -269,7 +269,7 @@ SerialOutputString(".\n"); - SerialInit(blob_status.terminalSpeed); + serial_init(blob_status.terminalSpeed); return 0; } @@ -339,7 +339,7 @@ SerialOutputHex(numBytes); SerialOutputString(" > 0x"); SerialOutputHex(maxSize); - SerialOutputByte('\n'); + serial_write('\n'); return -ETOOLONG; } @@ -370,33 +370,33 @@ return -ENOPARAMS; if(strncmp(argv[1], "1200", 5) == 0) { - blob_status.downloadSpeed = baud1k2; + blob_status.downloadSpeed = baud_1200; } else if(strncmp(argv[1], "1k2", 4) == 0) { - blob_status.downloadSpeed = baud1k2; + blob_status.downloadSpeed = baud_1200; } else if(strncmp(argv[1], "9600", 5) == 0) { - blob_status.downloadSpeed = baud9k6; + blob_status.downloadSpeed = baud_9600; } else if(strncmp(argv[1], "9k6", 4) == 0) { - blob_status.downloadSpeed = baud9k6; + blob_status.downloadSpeed = baud_9600; } else if(strncmp(argv[1], "19200", 6) == 0) { - blob_status.downloadSpeed = baud19k2; + blob_status.downloadSpeed = baud_19200; } else if(strncmp(argv[1], "19k2", 5) == 0) { - blob_status.downloadSpeed = baud19k2; + blob_status.downloadSpeed = baud_19200; } else if(strncmp(argv[1], "38400", 7) == 0) { - blob_status.downloadSpeed = baud38k4; + blob_status.downloadSpeed = baud_38400; } else if(strncmp(argv[1], "38k4", 5) == 0) { - blob_status.downloadSpeed = baud38k4; + blob_status.downloadSpeed = baud_38400; } else if(strncmp(argv[1], "57600", 6) == 0) { - blob_status.downloadSpeed = baud57k6; + blob_status.downloadSpeed = baud_57600; } else if(strncmp(argv[1], "57k6", 5) == 0) { - blob_status.downloadSpeed = baud57k6; + blob_status.downloadSpeed = baud_57600; } else if(strncmp(argv[1], "115200", 7) == 0) { - blob_status.downloadSpeed = baud115k2; + blob_status.downloadSpeed = baud_115200; } else if(strncmp(argv[1], "115k2", 6) == 0) { - blob_status.downloadSpeed = baud115k2; + blob_status.downloadSpeed = baud_115200; } else if(strncmp(argv[1], "230400", 7) == 0) { - blob_status.downloadSpeed = baud230k4; + blob_status.downloadSpeed = baud_230400; } else if(strncmp(argv[1], "230k4", 6) == 0) { - blob_status.downloadSpeed = baud230k4; + blob_status.downloadSpeed = baud_230400; } else { return -EINVAL; } @@ -563,34 +563,34 @@ -static void PrintSerialSpeed(eBauds speed) +static void PrintSerialSpeed(serial_baud_t speed) { switch(speed) { - case baud1k2: + case baud_1200: SerialOutputDec(1200); break; - case baud9k6: + case baud_9600: SerialOutputDec(9600); break; - case baud19k2: + case baud_19200: SerialOutputDec(19200); break; - case baud38k4: + case baud_38400: SerialOutputDec(38400); break; - case baud57k6: + case baud_57600: SerialOutputDec(57600); break; - case baud115k2: + case baud_115200: SerialOutputDec(115200); break; - case baud230k4: + case baud_230400: SerialOutputDec(230400); break; Index: memory.c =================================================================== RCS file: /cvsroot/blob/blob/src/blob/memory.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- memory.c 2001/10/14 20:24:32 1.3 +++ memory.c 2002/01/03 16:07:18 1.4 @@ -70,7 +70,7 @@ SerialOutputHex(addr); SerialOutputString(", aliased from 0x"); SerialOutputHex(* (u32 *)addr); - SerialOutputByte('\n'); + serial_write('\n'); #endif if(memory_map[i].used) i++; @@ -83,7 +83,7 @@ #ifdef BLOB_DEBUG SerialOutputString("Detected memory at 0x"); SerialOutputHex(addr); - SerialOutputByte('\n'); + serial_write('\n'); #endif /* does this start a new block? */ if(memory_map[i].used == 0) { Index: nesa.c =================================================================== RCS file: /cvsroot/blob/blob/src/blob/nesa.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- nesa.c 2002/01/02 01:18:57 1.4 +++ nesa.c 2002/01/03 16:07:18 1.5 @@ -59,7 +59,7 @@ flash_driver = &amd32_flash_driver; } -__initlist(init_nesa_flash_driver, INIT_LEVEL_OTHER_STUFF); +__initlist(init_nesa_flash_driver, INIT_LEVEL_DRIVER_SELECTION); @@ -70,4 +70,4 @@ serial_driver = &sa11x0_serial_driver; } -__initlist(nesa_init_hardware, INIT_LEVEL_INITIAL_HARDWARE); +__initlist(nesa_init_hardware, INIT_LEVEL_DRIVER_SELECTION); Index: param_block.c =================================================================== RCS file: /cvsroot/blob/blob/src/blob/param_block.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- param_block.c 2001/12/19 20:00:15 1.4 +++ param_block.c 2002/01/03 16:07:18 1.5 @@ -53,7 +53,7 @@ static int parse_ptag_core(const struct ptag *ptag) { blob_status.terminalSpeed = ptag->u.core.terminal; - SerialInit(blob_status.terminalSpeed); + serial_init(blob_status.terminalSpeed); return 0; } Index: partition.c =================================================================== RCS file: /cvsroot/blob/blob/src/blob/partition.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- partition.c 2001/12/19 22:53:45 1.1 +++ partition.c 2002/01/03 16:07:18 1.2 @@ -68,7 +68,7 @@ SerialOutputHex(flash_partition_table.partition[i].entry_point); } - SerialOutputByte('\n'); + serial_write('\n'); } return 0; Index: pleb.c =================================================================== RCS file: /cvsroot/blob/blob/src/blob/pleb.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- pleb.c 2002/01/02 01:18:57 1.4 +++ pleb.c 2002/01/03 16:07:18 1.5 @@ -69,7 +69,7 @@ flash_driver = &null_flash_driver; } -__initlist(init_pleb_flash_driver, INIT_LEVEL_OTHER_STUFF); +__initlist(init_pleb_flash_driver, INIT_LEVEL_DRIVER_SELECTION); @@ -80,4 +80,4 @@ serial_driver = &sa11x0_serial_driver; } -__initlist(pleb_init_hardware, INIT_LEVEL_INITIAL_HARDWARE); +__initlist(pleb_init_hardware, INIT_LEVEL_DRIVER_SELECTION); Index: shannon.c =================================================================== RCS file: /cvsroot/blob/blob/src/blob/shannon.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- shannon.c 2002/01/02 01:18:57 1.5 +++ shannon.c 2002/01/03 16:07:18 1.6 @@ -58,7 +58,7 @@ flash_driver = &amd32_flash_driver; } -__initlist(init_shannon_flash_driver, INIT_LEVEL_OTHER_STUFF); +__initlist(init_shannon_flash_driver, INIT_LEVEL_DRIVER_SELECTION); @@ -69,4 +69,4 @@ serial_driver = &sa11x0_serial_driver; } -__initlist(shannon_init_hardware, INIT_LEVEL_INITIAL_HARDWARE); +__initlist(shannon_init_hardware, INIT_LEVEL_DRIVER_SELECTION); Index: system3.c =================================================================== RCS file: /cvsroot/blob/blob/src/blob/system3.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- system3.c 2002/01/02 01:18:57 1.8 +++ system3.c 2002/01/03 16:07:18 1.9 @@ -96,7 +96,7 @@ flash_driver = &intel32_flash_driver; } -__initlist(init_system3_flash_driver, INIT_LEVEL_OTHER_STUFF); +__initlist(init_system3_flash_driver, INIT_LEVEL_DRIVER_SELECTION); @@ -107,7 +107,7 @@ serial_driver = &sa11x0_serial_driver; } -__initlist(system3_init_hardware, INIT_LEVEL_INITIAL_HARDWARE); +__initlist(system3_init_hardware, INIT_LEVEL_DRIVER_SELECTION); @@ -140,7 +140,7 @@ SerialOutputString("You have 60 seconds to switch your terminal emulator to the same speed and\n"); SerialOutputString("start downloading. After that " PACKAGE " will switch back to term speed.\n"); - SerialInit(blob_status.downloadSpeed); + serial_init(blob_status.downloadSpeed); } else { SerialOutputString("You have 60 seconds to start downloading.\n"); } @@ -159,7 +159,7 @@ if (blob_status.terminalSpeed != blob_status.downloadSpeed) { SerialOutputString("\n(Please switch your terminal emulator back to terminal speed\n"); - SerialInit(blob_status.terminalSpeed); + serial_init(blob_status.terminalSpeed); } DONE: Index: uucodec.c =================================================================== RCS file: /cvsroot/blob/blob/src/blob/uucodec.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- uucodec.c 2001/10/07 19:34:17 1.2 +++ uucodec.c 2002/01/03 16:07:18 1.3 @@ -58,9 +58,9 @@ /* #define IS_DEC(c) (1) */ #define OUT_OF_RANGE do { \ - SerialOutputByte('\n'); \ + serial_write('\n'); \ SerialOutputString(buf); \ - SerialOutputByte('\n'); \ + serial_write('\n'); \ return -ERANGE; \ } while(0) @@ -98,7 +98,7 @@ } /* Status print to show where we are at right now */ if((linesReceived++ & 0x007F) == 0) { - SerialOutputByte('.'); + serial_write('.'); } /* * `n' is used to avoid writing out all the characters @@ -144,7 +144,7 @@ } } } - SerialOutputByte('\n'); + serial_write('\n'); if (SerialInputString(p = buf, sizeof(buf), 2) == 0 || (strncmp(buf, "end", 3))) { /* no "end" line */ return -ETOOSHORT; @@ -171,26 +171,26 @@ bufBase += n; bufLen -= n; ch = ENC(n); - SerialOutputByte(ch); + serial_write(ch); for (p = buf; n > 0; n -= 3, p += 3) { ch = *p >> 2; ch = ENC(ch); - SerialOutputByte(ch); + serial_write(ch); ch = ((*p << 4) & 060) | ((p[1] >> 4) & 017); ch = ENC(ch); - SerialOutputByte(ch); + serial_write(ch); ch = ((p[1] << 2) & 074) | ((p[2] >> 6) & 03); ch = ENC(ch); - SerialOutputByte(ch); + serial_write(ch); ch = p[2] & 077; ch = ENC(ch); - SerialOutputByte(ch); + serial_write(ch); } - SerialOutputByte('\n'); + serial_write('\n'); } ch = ENC('\0'); - SerialOutputByte(ch); - SerialOutputByte('\n'); + serial_write(ch); + serial_write('\n'); SerialOutputString("end\n"); } /* UUEncode */ |
From: Erik M. <er...@us...> - 2002-01-03 16:07:21
|
Update of /cvsroot/blob/blob In directory usw-pr-cvs1:/tmp/cvs-serv2589 Modified Files: configure.in Log Message: The serial port driver rewrite, part two. This looks quite intrusive, but it's not that large: - rewrite src/lib/serial.c to use the low level serial driver - change semantics for SerialInputByte() and SerialOutputByte(), so rename them to serial_read() and serial_write(). this makes the patch huge - add new INIT_LEVEL for driver selection (has to be done before hardware initialisation) - add machine specific files for all architectures in diag - clean up odds and ends. Index: configure.in =================================================================== RCS file: /cvsroot/blob/blob/configure.in,v retrieving revision 1.31 retrieving revision 1.32 diff -u -d -r1.31 -r1.32 --- configure.in 2001/12/27 18:27:37 1.31 +++ configure.in 2002/01/03 16:07:17 1.32 @@ -99,6 +99,7 @@ BLOB_PLATFORM_OBJ="assabet.o" AC_MSG_WARN([Please check assabet memory config in arch/assabet.h]) BLOB_FLASH_OBJS="intel32.o" + DIAG_PLATFORM_OBJ="assabet.o" use_cpu="sa1110" use_lcd="no" ;; @@ -109,6 +110,7 @@ BLOB_PLATFORM_OBJ="assabet.o" AC_MSG_WARN([Please check assabet memory config in arch/assabet.h]) BLOB_FLASH_OBJS="intel32.o" + DIAG_PLATFORM_OBJ="assabet.o" use_cpu="sa1110" use_lcd="no" ;; @@ -118,6 +120,7 @@ BLOB_PLATFORM_OBJ="brutus.o" AC_MSG_WARN([Please check Brutus flash]) BLOB_FLASH_OBJS="nullflash.o" + DIAG_PLATFORM_OBJ="brutus.o" use_cpu="sa1100" use_lcd="no" ;; @@ -127,6 +130,7 @@ BLOB_PLATFORM_OBJ="clart.o" AC_MSG_WARN([Please check creditlart memory config in arch/clart.h]) BLOB_FLASH_OBJS="intel16.o" + DIAG_PLATFORM_OBJ="clart.o" use_cpu="sa1110" use_lcd="no" ;; @@ -137,6 +141,7 @@ AC_MSG_WARN([Warning: untested platform!]) AC_MSG_WARN([Please check h3600 memory config in arch/h3600.h]) BLOB_FLASH_OBJS="intel32.o" + DIAG_PLATFORM_OBJ="h3600.o" use_cpu="sa1110" use_lcd="no" ;; @@ -145,6 +150,7 @@ AC_DEFINE(IDR) BLOB_PLATFORM_OBJ="idr.o" BLOB_FLASH_OBJS="intel16.o" + DIAG_PLATFORM_OBJ="idr.o" use_cpu="sa1110" use_lcd="no" ;; @@ -153,6 +159,7 @@ AC_DEFINE(LART) BLOB_PLATFORM_OBJ="lart.o" BLOB_FLASH_OBJS="intel32.o" + DIAG_PLATFORM_OBJ="lart.o" use_cpu="sa1100" use_lcd="no" ;; @@ -161,6 +168,7 @@ AC_DEFINE(NESA) BLOB_PLATFORM_OBJ="nesa.o" BLOB_FLASH_OBJS="amd32.o" + DIAG_PLATFORM_OBJ="nesa.o" use_cpu="sa1100" use_lcd="no" ;; @@ -170,6 +178,7 @@ BLOB_PLATFORM_OBJ="pleb.o" AC_MSG_WARN([Please check PLEB flash]) BLOB_FLASH_OBJS="nullflash.o" + DIAG_PLATFORM_OBJ="pleb.o" use_cpu="sa1100" use_lcd="no" ;; @@ -178,6 +187,7 @@ AC_DEFINE(SHANNON) BLOB_PLATFORM_OBJ="shannon.o" BLOB_FLASH_OBJS="amd32.o" + DIAG_PLATFORM_OBJ="shannon.o" use_cpu="sa1100" use_lcd="no" ;; @@ -196,6 +206,7 @@ BLOB_PLATFORM_OBJ="jornada720.o" AC_MSG_WARN([Warning: untested platform!]) BLOB_FLASH_OBJS="intel32.o" + DIAG_PLATFORM_OBJ="jornada720.o" use_cpu="sa1110" use_lcd="no" ;; @@ -204,6 +215,7 @@ AC_DEFINE(BADGE4) BLOB_PLATFORM_OBJ="badge4.o" BLOB_FLASH_OBJS="intel16.o" + DIAG_PLATFORM_OBJ="badge4.o" use_cpu="sa1110" use_lcd="no" ;; |
From: Erik M. <er...@us...> - 2002-01-02 01:23:20
|
Update of /cvsroot/blob/blob/src/blob In directory usw-pr-cvs1:/tmp/cvs-serv9891/src/blob Modified Files: amd32.c Log Message: The Shannon flash functions work, so the AMD flash driver also works. Remove the #warning. Index: amd32.c =================================================================== RCS file: /cvsroot/blob/blob/src/blob/amd32.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- amd32.c 2001/12/28 01:06:12 1.3 +++ amd32.c 2002/01/02 01:23:18 1.4 @@ -53,8 +53,6 @@ -#warning "Please check AMD flash code" - static int flash_erase_amd32(u32 *addr) { u32 result; |
From: Erik M. <er...@us...> - 2002-01-02 01:21:46
|
Update of /cvsroot/blob/blob/src/lib In directory usw-pr-cvs1:/tmp/cvs-serv9714/src/lib Modified Files: error.c Makefile.am Log Message: Happy new year! This is the start of a new serial driver that should make porting blob to non-StrongARM architectures easier. The SA11x0 driver is implemented, but completely untested at the moment. It's trivial to do the rest of the serial code, but I'd better go to bed, or otherwise Jan-Derk will complain that I'm working too late ;) Part two follows tomorrow. Index: error.c =================================================================== RCS file: /cvsroot/blob/blob/src/lib/error.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- error.c 2001/10/15 21:24:39 1.4 +++ error.c 2002/01/02 01:21:41 1.5 @@ -48,6 +48,7 @@ "ambiguous command", /* EAMBIGCMD */ "can't erase flash block", /* EFLASHERASE */ "flash program error", /* EFLASHPGM */ + "serial port error", /* ESERIAL */ }; Index: Makefile.am =================================================================== RCS file: /cvsroot/blob/blob/src/lib/Makefile.am,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- Makefile.am 2001/12/19 20:00:15 1.6 +++ Makefile.am 2002/01/02 01:21:41 1.7 @@ -33,6 +33,7 @@ led.c \ reboot.c \ serial.c \ + serial-sa11x0.c \ strncpy.c \ strlen.c \ strncmp.c \ |
From: Erik M. <er...@us...> - 2002-01-02 01:21:45
|
Update of /cvsroot/blob/blob/include/blob In directory usw-pr-cvs1:/tmp/cvs-serv9714/include/blob Modified Files: errno.h Log Message: Happy new year! This is the start of a new serial driver that should make porting blob to non-StrongARM architectures easier. The SA11x0 driver is implemented, but completely untested at the moment. It's trivial to do the rest of the serial code, but I'd better go to bed, or otherwise Jan-Derk will complain that I'm working too late ;) Part two follows tomorrow. Index: errno.h =================================================================== RCS file: /cvsroot/blob/blob/include/blob/errno.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- errno.h 2001/10/15 21:24:39 1.3 +++ errno.h 2002/01/02 01:21:41 1.4 @@ -41,6 +41,7 @@ #define EAMBIGCMD 11 /* ambiguous command */ #define EFLASHERASE 12 /* can't erase flash block */ #define EFLASHPGM 13 /* flash program error */ +#define ESERIAL 14 /* serial port error */ #endif |
From: Erik M. <er...@us...> - 2002-01-02 01:19:01
|
Update of /cvsroot/blob/blob/include/blob In directory usw-pr-cvs1:/tmp/cvs-serv8566/include/blob Modified Files: serial.h Log Message: Happy new year! This is the start of a new serial driver that should make porting blob to non-StrongARM architectures easier. The SA11x0 driver is implemented, but completely untested at the moment. It's trivial to do the rest of the serial code, but I'd better go to bed, or otherwise Jan-Derk will complain that I'm working too late ;) Part two follows tomorrow. Index: serial.h =================================================================== RCS file: /cvsroot/blob/blob/include/blob/serial.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- serial.h 2001/10/07 15:27:35 1.2 +++ serial.h 2002/01/02 01:18:57 1.3 @@ -11,7 +11,7 @@ /* * serial.h: Serial utilities for blob * - * Copyright (C) 1999 Erik Mouw (J.A...@it...) + * Copyright (C) 1999 2002 Erik Mouw (J.A...@it...) * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -37,6 +37,50 @@ #include <blob/types.h> + +typedef enum { + baud_1200, + baud_2400, + baud_4800, + baud_9600, + baud_19200, + baud_38400, + baud_57600, + baud_115200, + baud_230400 +} serial_baud_t; + + +typedef int (*serial_init_func_t)(serial_baud_t); +typedef int (*serial_read_func_t)(void); +typedef int (*serial_write_func_t)(int); +typedef int (*serial_poll_func_t)(void); +typedef int (*serial_flush_in_func_t)(void); +typedef int (*serial_flush_out_func_t)(void); + + +typedef struct { + serial_init_func_t init; + + serial_read_func_t read; + serial_write_func_t write; + + serial_poll_func_t poll; + + serial_flush_in_func_t flush_in; + serial_flush_out_func_t flush_out; +} serial_driver_t; + + +/* implemented serial drivers */ +extern serial_driver_t sa11x0_serial_driver; + + +/* should be filled out by the architecture dependent files */ +extern serial_driver_t *serial_driver; + + +/* ---- OLD STUFF BELOW ----------------------------------- */ typedef enum { /* Some useful SA-1100 baud rates */ baud1k2 = 191, |
Update of /cvsroot/blob/blob/src/blob In directory usw-pr-cvs1:/tmp/cvs-serv8566/src/blob Modified Files: assabet.c badge4.c brutus.c clart.c h3600.c idr.c jornada720.c lart.c nesa.c pleb.c shannon.c system3.c Log Message: Happy new year! This is the start of a new serial driver that should make porting blob to non-StrongARM architectures easier. The SA11x0 driver is implemented, but completely untested at the moment. It's trivial to do the rest of the serial code, but I'd better go to bed, or otherwise Jan-Derk will complain that I'm working too late ;) Part two follows tomorrow. Index: assabet.c =================================================================== RCS file: /cvsroot/blob/blob/src/blob/assabet.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- assabet.c 2001/10/25 09:28:04 1.4 +++ assabet.c 2002/01/02 01:18:57 1.5 @@ -27,6 +27,7 @@ #include <blob/flash.h> #include <blob/init.h> +#include <blob/serial.h> @@ -62,12 +63,16 @@ #define RS232_ENABLE 0x00001000 #define GREEN_LED_ENABLE 0x00004000 -static void assabet_init_bcr(void) +static void assabet_init_hardware(void) { u32 *bcr = (u32 *)0x12000000; + /* enable RS232 tranceiver and green LED */ *bcr = RS232_ENABLE | GREEN_LED_ENABLE; + + /* select serial driver */ + serial_driver = &sa11x0_serial_driver; } -__initlist(assabet_init_bcr, INIT_LEVEL_INITIAL_HARDWARE); +__initlist(assabet_init_hardware, INIT_LEVEL_INITIAL_HARDWARE); Index: badge4.c =================================================================== RCS file: /cvsroot/blob/blob/src/blob/badge4.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- badge4.c 2001/12/27 18:27:37 1.1 +++ badge4.c 2002/01/02 01:18:57 1.2 @@ -29,6 +29,7 @@ #include <blob/flash.h> #include <blob/init.h> #include <blob/sa1100.h> +#include <blob/serial.h> /* flash descriptor for Badge4 flash */ /* 1 x Intel 28F320C3BA100 Advanced+ Boot Block Flash (32 Mbit) */ @@ -72,6 +73,9 @@ GPDR |= (GPIO_GPIO19 | GPIO_GPIO20); GPSR = GPIO_GPIO19; GPCR = GPIO_GPIO20; + + /* select serial driver */ + serial_driver = &sa11x0_serial_driver; } Index: brutus.c =================================================================== RCS file: /cvsroot/blob/blob/src/blob/brutus.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- brutus.c 2001/10/21 21:38:34 1.3 +++ brutus.c 2002/01/02 01:18:57 1.4 @@ -27,6 +27,7 @@ #include <blob/flash.h> #include <blob/init.h> +#include <blob/serial.h> @@ -52,3 +53,14 @@ } __initlist(init_brutus_flash_driver, INIT_LEVEL_OTHER_STUFF); + + + + +static void brutus_init_hardware(void) +{ + /* select serial driver */ + serial_driver = &sa11x0_serial_driver; +} + +__initlist(brutus_init_hardware, INIT_LEVEL_INITIAL_HARDWARE); Index: clart.c =================================================================== RCS file: /cvsroot/blob/blob/src/blob/clart.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- clart.c 2001/10/21 21:38:34 1.3 +++ clart.c 2002/01/02 01:18:57 1.4 @@ -27,6 +27,7 @@ #include <blob/flash.h> #include <blob/init.h> +#include <blob/serial.h> @@ -55,3 +56,14 @@ } __initlist(init_clart_flash_driver, INIT_LEVEL_OTHER_STUFF); + + + + +static void clart_init_hardware(void) +{ + /* select serial driver */ + serial_driver = &sa11x0_serial_driver; +} + +__initlist(clart_init_hardware, INIT_LEVEL_INITIAL_HARDWARE); Index: h3600.c =================================================================== RCS file: /cvsroot/blob/blob/src/blob/h3600.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- h3600.c 2001/10/31 16:44:18 1.3 +++ h3600.c 2002/01/02 01:18:57 1.4 @@ -29,6 +29,7 @@ #include <blob/flash.h> #include <blob/init.h> +#include <blob/serial.h> @@ -118,13 +119,15 @@ -static void h3600_init_egpio(void) +static void h3600_init_hardware(void) { shadow_egpio = 0; /* enable RS232 tranceiver */ h3600_set_egpio(EGPIO_H3600_RS232_ON); -} + /* select serial driver */ + serial_driver = &sa11x0_serial_driver; +} -__initlist(h3600_init_egpio, INIT_LEVEL_INITIAL_HARDWARE); +__initlist(h3600_init_hardware, INIT_LEVEL_INITIAL_HARDWARE); Index: idr.c =================================================================== RCS file: /cvsroot/blob/blob/src/blob/idr.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- idr.c 2001/12/16 07:39:22 1.2 +++ idr.c 2002/01/02 01:18:57 1.3 @@ -27,6 +27,7 @@ #include <blob/flash.h> #include <blob/init.h> +#include <blob/serial.h> /* flash descriptor for IDR flash */ /* 1x Intel 28F128J3A strataflash (16MB) */ @@ -49,3 +50,12 @@ } __initlist(init_idr_flash_driver, INIT_LEVEL_OTHER_STUFF); + + +static void idr_init_hardware(void) +{ + /* select serial driver */ + serial_driver = &sa11x0_serial_driver; +} + +__initlist(idr_init_hardware, INIT_LEVEL_INITIAL_HARDWARE); Index: jornada720.c =================================================================== RCS file: /cvsroot/blob/blob/src/blob/jornada720.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- jornada720.c 2001/12/27 18:27:37 1.1 +++ jornada720.c 2002/01/02 01:18:57 1.2 @@ -29,6 +29,7 @@ #include <blob/flash.h> #include <blob/init.h> #include <blob/sa1100.h> +#include <blob/serial.h> /* flash descriptor for Jornada720 flash */ @@ -81,10 +82,21 @@ PPSR &= ~(GPIO_GPIO10 | GPIO_GPIO7); PPDR |= (GPIO_GPIO10 | GPIO_GPIO7); +#warning "Please check this code!" + /* Careful over here! the timer might not yet be initialised + * at this point, so calling msleep() is unsafe! The best way + * to make sure that it is, is to put the GPIO stuff in a + * separate init function that runs at + * INIT_LEVEL_INITIAL_HARDWARE+1. The serial port stuff can be + * called without problems at INIT_LEVEL_INITIAL_HARDWARE -- Erik + */ msleep(10 * 1000); /* Take the MCU out of reset mode */ PPSR |= GPIO_GPIO10; + + /* select serial driver */ + serial_driver = &sa11x0_serial_driver; } __initlist(init_hardware, INIT_LEVEL_INITIAL_HARDWARE); Index: lart.c =================================================================== RCS file: /cvsroot/blob/blob/src/blob/lart.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- lart.c 2001/11/04 23:13:44 1.4 +++ lart.c 2002/01/02 01:18:57 1.5 @@ -27,6 +27,7 @@ #include <blob/flash.h> #include <blob/init.h> +#include <blob/serial.h> @@ -64,3 +65,14 @@ } __initlist(init_lart_flash_driver, INIT_LEVEL_OTHER_STUFF); + + + + +static void lart_init_hardware(void) +{ + /* select serial driver */ + serial_driver = &sa11x0_serial_driver; +} + +__initlist(lart_init_hardware, INIT_LEVEL_INITIAL_HARDWARE); Index: nesa.c =================================================================== RCS file: /cvsroot/blob/blob/src/blob/nesa.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- nesa.c 2001/10/21 21:38:34 1.3 +++ nesa.c 2002/01/02 01:18:57 1.4 @@ -27,6 +27,7 @@ #include <blob/flash.h> #include <blob/init.h> +#include <blob/serial.h> @@ -59,3 +60,14 @@ } __initlist(init_nesa_flash_driver, INIT_LEVEL_OTHER_STUFF); + + + + +static void nesa_init_hardware(void) +{ + /* select serial driver */ + serial_driver = &sa11x0_serial_driver; +} + +__initlist(nesa_init_hardware, INIT_LEVEL_INITIAL_HARDWARE); Index: pleb.c =================================================================== RCS file: /cvsroot/blob/blob/src/blob/pleb.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- pleb.c 2001/10/21 21:38:34 1.3 +++ pleb.c 2002/01/02 01:18:57 1.4 @@ -28,6 +28,7 @@ #include <blob/flash.h> #include <blob/init.h> #include <blob/led.h> +#include <blob/serial.h> @@ -69,3 +70,14 @@ } __initlist(init_pleb_flash_driver, INIT_LEVEL_OTHER_STUFF); + + + + +static void pleb_init_hardware(void) +{ + /* select serial driver */ + serial_driver = &sa11x0_serial_driver; +} + +__initlist(pleb_init_hardware, INIT_LEVEL_INITIAL_HARDWARE); Index: shannon.c =================================================================== RCS file: /cvsroot/blob/blob/src/blob/shannon.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- shannon.c 2001/12/14 01:33:21 1.4 +++ shannon.c 2002/01/02 01:18:57 1.5 @@ -27,6 +27,7 @@ #include <blob/flash.h> #include <blob/init.h> +#include <blob/serial.h> @@ -58,3 +59,14 @@ } __initlist(init_shannon_flash_driver, INIT_LEVEL_OTHER_STUFF); + + + + +static void shannon_init_hardware(void) +{ + /* select serial driver */ + serial_driver = &sa11x0_serial_driver; +} + +__initlist(shannon_init_hardware, INIT_LEVEL_INITIAL_HARDWARE); Index: system3.c =================================================================== RCS file: /cvsroot/blob/blob/src/blob/system3.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- system3.c 2001/11/21 02:14:44 1.7 +++ system3.c 2002/01/02 01:18:57 1.8 @@ -41,6 +41,7 @@ #include <blob/init.h> #include <blob/command.h> #include <blob/uucodec.h> +#include <blob/serial.h> /********************************************************************** * defines @@ -96,6 +97,18 @@ } __initlist(init_system3_flash_driver, INIT_LEVEL_OTHER_STUFF); + + + + +static void system3_init_hardware(void) +{ + /* select serial driver */ + serial_driver = &sa11x0_serial_driver; +} + +__initlist(system3_init_hardware, INIT_LEVEL_INITIAL_HARDWARE); + |
From: Erik M. <er...@us...> - 2002-01-02 01:19:00
|
Update of /cvsroot/blob/blob/src/lib In directory usw-pr-cvs1:/tmp/cvs-serv8566/src/lib Modified Files: serial.c Added Files: serial-sa11x0.c Log Message: Happy new year! This is the start of a new serial driver that should make porting blob to non-StrongARM architectures easier. The SA11x0 driver is implemented, but completely untested at the moment. It's trivial to do the rest of the serial code, but I'd better go to bed, or otherwise Jan-Derk will complain that I'm working too late ;) Part two follows tomorrow. --- NEW FILE: serial-sa11x0.c --- /* * serial-sa11x0.c: StrongARM SA11x0 serial port driver * * Copyright (C) 2002 Erik Mouw <J.A...@it...> * * $Id: serial-sa11x0.c,v 1.1 2002/01/02 01:18:57 erikm Exp $ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ #ident "$Id: serial-sa11x0.c,v 1.1 2002/01/02 01:18:57 erikm Exp $" #ifdef HAVE_CONFIG_H # include <blob/config.h> #endif #include <blob/arch.h> #include <blob/errno.h> #include <blob/sa1100.h> #include <blob/serial.h> #include <blob/types.h> #if defined USE_SERIAL1 # define SerialUTSR0 Ser1UTSR0 # define SerialUTSR1 Ser1UTSR1 # define SerialUTDR Ser1UTDR # define SerialUTCR0 Ser1UTCR0 # define SerialUTCR1 Ser1UTCR1 # define SerialUTCR2 Ser1UTCR2 # define SerialUTCR3 Ser1UTCR3 #else /* defined USE_SERIAL3 */ /* using an SA11x0 CPU and not having any serial port defined is an * error, but because we're using the driver in the library we can't * bail out over here */ # define SerialUTSR0 Ser3UTSR0 # define SerialUTSR1 Ser3UTSR1 # define SerialUTDR Ser3UTDR # define SerialUTCR0 Ser3UTCR0 # define SerialUTCR1 Ser3UTCR1 # define SerialUTCR2 Ser3UTCR2 # define SerialUTCR3 Ser3UTCR3 #endif /* flush serial input queue. returns 0 on success or negative error * number otherwise */ static int sa11x0_serial_flush_in(void) { volatile u32 tmp; /* keep on reading as long as the receiver is not empty */ while(SerialUTSR1 & UTSR1_RNE) { if(SerialUTSR1 & (UTSR1_PRE | UTSR1_FRE | UTSR1_ROR)) return -ESERIAL; tmp = SerialUTDR; } return 0; } /* flush output queue. returns 0 on success or negative error number * otherwise */ static int sa11x0_serial_flush_out(void) { /* wait until the transmitter is no longer busy */ while(SerialUTSR1 & UTSR1_TBY) { } return 0; } /* initialise serial port at the request baudrate. returns 0 on * success, or a negative error number otherwise */ static int sa11x0_serial_init(serial_baud_t baud) { u32 divisor; /* get correct divisor */ switch(baud) { case baud_1200: divisor = 191; break; case baud_9600: divisor = 23; break; case baud_19200: divisor = 11; break; case baud_38400: divisor = 5; break; case baud_57600: divisor = 3; break; case baud_115200: divisor = 1; break; case baud_230400: divisor = 0; break; default: return -ERANGE; } #if defined USE_SERIAL1 /* select UART use for serial port 1 or otherwise we won't see * anything at all */ Ser1SDCR0 = SDCR0_UART; #endif sa11x0_serial_flush_out(); /* switch receiver and transmitter off */ SerialUTCR3 = 0x00; /* clear sticky bits in control register 3 */ SerialUTSR0 = 0xff; /* set the port to sensible defaults (no break, no interrupts, * no parity, 8 databits, 1 stopbit, transmitter and receiver * enabled) */ SerialUTCR0 = ( UTCR0_1StpBit | UTCR0_8BitData ); SerialUTCR1 = 0; SerialUTCR2 = divisor; /* turn the receiver and transmitter back on */ SerialUTCR3 = ( UTCR3_RXE | UTCR3_TXE ); return 0; } /* check if there is a character available to read. returns 1 if there * is a character available, 0 if not, and negative error number on * failure */ static int sa11x0_serial_poll(void) { /* check for errors */ if(SerialUTSR1 & (UTSR1_PRE | UTSR1_FRE | UTSR1_ROR)) return -ESERIAL; if(SerialUTSR1 & UTSR1_RNE) return 1; else return 0; } /* read one character from the serial port. return character (between * 0 and 255) on success, or negative error number on failure. this * function is blocking */ static int sa11x0_serial_read(void) { int rv; for(;;) { rv = sa11x0_serial_poll(); if(rv < 0) return rv; if(rv > 0) return SerialUTDR & 0xff; } } /* write character to serial port. return 0 on success, or negative * error number on failure. this function is blocking */ static int sa11x0_serial_write(int c) { /* wait for room in the transmit FIFO */ while((SerialUTSR0 & UTSR0_TFS) == 0) { } SerialUTDR = c & 0xff; return 0; } /* export serial driver */ serial_driver_t sa11x0_serial_driver = { init: sa11x0_serial_init, read: sa11x0_serial_read, write: sa11x0_serial_write, poll: sa11x0_serial_poll, flush_in: sa11x0_serial_flush_in, flush_out: sa11x0_serial_flush_out }; Index: serial.c =================================================================== RCS file: /cvsroot/blob/blob/src/lib/serial.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- serial.c 2001/10/31 16:45:52 1.4 +++ serial.c 2002/01/02 01:18:57 1.5 @@ -35,11 +35,16 @@ # include <blob/config.h> #endif + #include <blob/arch.h> #include <blob/led.h> #include <blob/sa1100.h> #include <blob/serial.h> #include <blob/time.h> + + +serial_driver_t *serial_driver; + /* * Initialise the serial port with the given baudrate. The settings |
From: Erik M. <er...@us...> - 2001-12-31 00:28:56
|
Update of /cvsroot/blob/blob/include/blob In directory usw-pr-cvs1:/tmp/cvs-serv31353/include/blob Modified Files: flash.h Log Message: Flesh out the lock/unlock and query lock functions. Add some more comments to the header file. Index: flash.h =================================================================== RCS file: /cvsroot/blob/blob/include/blob/flash.h,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- flash.h 2001/12/28 01:06:12 1.8 +++ flash.h 2001/12/31 00:28:53 1.9 @@ -53,6 +53,8 @@ typedef struct { + /* the following functions should be implemented by all flash + * drivers*/ flash_erase_func_t erase; flash_write_func_t write; @@ -60,6 +62,9 @@ flash_unlock_block_func_t unlock_block; flash_query_block_lock_func_t query_block_lock; + /* this is platform specific, so it should be implemented by + * the platform specific code. a flash driver can leave these + * functions unimplemented, blob will safely work around it */ flash_enable_vpp_func_t enable_vpp; flash_disable_vpp_func_t disable_vpp; } flash_driver_t; @@ -87,6 +92,7 @@ int flash_write_region(u32 *dst, const u32 *src, u32 nwords); int flash_lock_region(u32 *start, u32 nwords); int flash_unlock_region(u32 *start, u32 nwords); +int flash_query_region(u32 *start, u32 nwords); #endif |
From: Erik M. <er...@us...> - 2001-12-31 00:28:56
|
Update of /cvsroot/blob/blob/src/blob In directory usw-pr-cvs1:/tmp/cvs-serv31353/src/blob Modified Files: flash.c Log Message: Flesh out the lock/unlock and query lock functions. Add some more comments to the header file. Index: flash.c =================================================================== RCS file: /cvsroot/blob/blob/src/blob/flash.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- flash.c 2001/12/16 07:36:42 1.9 +++ flash.c 2001/12/31 00:28:53 1.10 @@ -329,3 +329,186 @@ return 0; } + + + + +/* given an address, return the flash block index number (or negative + * error number otherwise + */ +static int find_block(u32 address) +{ + int i; + + for (i = 0; i < num_flash_blocks; i++) { + u32 start = flash_blocks[i].start; + int length = flash_blocks[i].size; + u32 endIncl = start + length - 1; + + if (address >= start && address <= endIncl) + return i; + } + + return -ERANGE; +} + + + + +/* convert address range to range of flash blocks. returns 0 on + * success or negative error number on failure. + */ +static int address_range_to_block_range(u32 startAddress, int length, + int *startBlock, int *endInclBlock) +{ + int sb, eib; + +#ifdef FLASH_DEBUG + SerialOutputString(__FUNCTION__ ": startAddress = 0x"); + SerialOutputHex(startAddress); + SerialOutputString(", length = 0x"); + SerialOutputHex(length); + SerialOutputString("\n"); +#endif + + sb = find_block(startAddress); + eib = find_block(startAddress + length - 1); + + if(sb < 0) + return sb; + + if(eib < 0) + return eib; + +#ifdef FLASH_DEBUG + SerialOutputString("sb: "); + SerialOutputDec(sb); + SerialOutputString(", eib: "); + SerialOutputDec(eib); + SerialOutputString("\n"); +#endif + + // would be nice to warn if sb isn't at the beginning of + // its block or eib isn't at the very end of its block. + + *startBlock = sb; + *endInclBlock = eib; + + return 0; +} + + + + +static int do_flash_lock(u32 *start, u32 nwords, int lock) +{ + int sb, eib; + int rv; + int i; + u32 *addr; + +#ifdef BLOB_DEBUG + SerialOutputString(__FUNCTION__ "(): "); + if(lock == 0) + SerialOutputString("un"); + + SerialOutputString("lock at 0x"); + SerialOutputHex((u32)start); + SerialOutputString(", nwords = 0x"); + SerialOutputHex(nwords); + SerialOutputByte('\n'); +#endif + + rv = address_range_to_block_range((u32) start, nwords * sizeof(u32), + &sb, &eib); + + if(rv < 0) + return rv; + + /* check if it is lockable at all */ + for(i = sb; i <= eib; i++) { + if(!flash_blocks[i].lockable) { +#ifdef BLOB_DEBUG + printerrprefix(); + SerialOutputString("can't (un)lock unlockable blocks\n"); +#endif + return -EFLASHPGM; + } + } + + flash_driver->enable_vpp(); + + for(i = sb; i <= eib; i++) { + addr = (u32 *)flash_blocks[i].start; + + if(lock) + rv = flash_driver->lock_block(addr); + else + rv = flash_driver->unlock_block(addr); + + if(rv < 0) { + flash_driver->disable_vpp(); +#ifdef BLOB_DEBUG + printerrprefix(); + SerialOutputString("can't (un)lock block at 0x"); + SerialOutputHex((u32)addr); + SerialOutputByte('\n'); +#endif + return rv; + } + } + + flash_driver->disable_vpp(); + + return 0; +} + + + + +int flash_lock_region(u32 *start, u32 nwords) +{ + return do_flash_lock(start, nwords, 1); +} + + + + +int flash_unlock_region(u32 *start, u32 nwords) +{ + return do_flash_lock(start, nwords, 0); +} + + + + +/* return number of blocks in the region locked, 0 if everything is + * unlocked, or negative error number otherwise */ +int flash_query_region(u32 *start, u32 nwords) +{ + int sb, eib, rv, i; + int cnt = 0; + u32 *addr; + + rv = address_range_to_block_range((u32) start, nwords * sizeof(u32), + &sb, &eib); + + if(rv < 0) + return rv; + + for(i = sb; i <= eib; i++) { + addr = (u32 *)flash_blocks[i].start; + + if(flash_blocks[i].lockable) { + rv = flash_driver->query_block_lock(addr); + + if(rv < 0) + return rv; + + if(rv > 0) + cnt++; + } + } + + return cnt; +} |
From: Erik M. <er...@us...> - 2001-12-28 01:06:17
|
Update of /cvsroot/blob/blob/src/blob In directory usw-pr-cvs1:/tmp/cvs-serv15022/src/blob Modified Files: amd32.c intel16.c intel32.c nullflash.c Log Message: Flash update from Chris Hoover. This part only applies the mechanisms. Also updated the AMD and null flash drivers. Index: amd32.c =================================================================== RCS file: /cvsroot/blob/blob/src/blob/amd32.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- amd32.c 2001/10/25 09:59:23 1.2 +++ amd32.c 2001/12/28 01:06:12 1.3 @@ -29,6 +29,7 @@ #include <blob/errno.h> #include <blob/flash.h> #include <blob/util.h> +#include <blob/serial.h> /* flash commands for two 16 bit AMD flash chips */ @@ -184,8 +185,44 @@ +static int flash_lock_block_amd32(u32 *blockStart) +{ + /* FIXME: if AMD flash can be locked, this function should be + * fleshed out -- Erik + */ + return 0; +} + + + + +static int flash_unlock_block_amd32(u32 *blockStart) +{ + /* FIXME: if AMD flash can be unlocked, this function should + * be fleshed out -- Erik + */ + return 0; +} + + + + +static int flash_query_block_lock_amd32(u32 *blockStart) +{ + /* FIXME: if AMD flash can be queried, this function should be + * fleshed out -- Erik + */ + return 0; +} + + + + /* flash driver structure */ flash_driver_t amd32_flash_driver = { - erase: flash_erase_amd32, - write: flash_write_amd32, + erase: flash_erase_amd32, + write: flash_write_amd32, + lock_block: flash_lock_block_amd32, + unlock_block: flash_unlock_block_amd32, + query_block_lock: flash_query_block_lock_amd32 }; Index: intel16.c =================================================================== RCS file: /cvsroot/blob/blob/src/blob/intel16.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- intel16.c 2001/10/25 09:59:23 1.2 +++ intel16.c 2001/12/28 01:06:12 1.3 @@ -29,6 +29,7 @@ #include <blob/errno.h> #include <blob/flash.h> #include <blob/util.h> +#include <blob/serial.h> /* flash commands for a single 16 bit intel flash chip */ @@ -42,6 +43,13 @@ #define STATUS_ERASE_ERR 0x00000020 #define STATUS_PGM_ERR 0x00000010 +#define CONFIG_SETUP 0x00000060 +#define LOCK_SECTOR 0x00000001 +#define UNLOCK_SECTOR 0x000000D0 +#define READ_CONFIG 0x00000090 +#define LOCK_STATUS_LOCKED 0x00000001 +#define LOCK_STATUS_LOCKEDDOWN 0x00000002 + @@ -49,6 +57,9 @@ { u16 result; + *addr = STATUS_CLEAR; + barrier(); + /* prepare for erase */ *addr = ERASE_SETUP; barrier(); @@ -69,8 +80,16 @@ *addr = READ_ARRAY; barrier(); - if((result & STATUS_ERASE_ERR) != 0) + if((result & STATUS_ERASE_ERR) != 0) { +#ifdef BLOB_DEBUG + SerialOutputString(__FUNCTION__ " failed, result=0x"); + SerialOutputHex(result); + SerialOutputString(", addr=0x"); + SerialOutputHex((u32) addr); + SerialOutputByte('\n'); +#endif return -EFLASHERASE; + } return 0; } @@ -82,6 +101,9 @@ { u16 result; + *dst = STATUS_CLEAR; + barrier(); + /* setup flash for writing */ *dst = PGM_SETUP; barrier(); @@ -103,9 +125,21 @@ *dst = READ_ARRAY; barrier(); - if(((result & STATUS_PGM_ERR) != 0) || (*dst != *src)) + if(((result & STATUS_PGM_ERR) != 0) || (*dst != *src)) { +#ifdef BLOB_DEBUG + SerialOutputString(__FUNCTION__ " failed, result=0x"); + SerialOutputHex(result); + SerialOutputString(", dst=0x"); + SerialOutputHex((u32) dst); + SerialOutputString(", *dst=0x"); + SerialOutputHex(*dst); + SerialOutputString(", *src=0x"); + SerialOutputHex(*src); + SerialOutputByte('\n'); +#endif return -EFLASHPGM; - + } + return 0; } @@ -165,8 +199,115 @@ +static int flash_lock_block_intel16(u32 *blockStart) +{ + u16 *p = (u16 *) blockStart; + u16 result; + + *p = STATUS_CLEAR; + barrier(); + + *p = CONFIG_SETUP; + barrier(); + *p = LOCK_SECTOR; + barrier(); + + /* status check */ + *p = STATUS_READ; + barrier(); + + result = *p; + barrier(); + + *p = READ_ARRAY; + barrier(); + + if ((result & STATUS_PGM_ERR) != 0) { +#ifdef BLOB_DEBUG + SerialOutputString(__FUNCTION__ " failed at 0x"); + SerialOutputHex((u32) blockStart); + SerialOutputString(", status=0x"); + SerialOutputHex((u32) result); + SerialOutputByte('\n'); +#endif + return -EFLASHPGM; + } + + return 0; +} + + + + +static int flash_unlock_block_intel16(u32 *blockStart) +{ + u16 *p = (u16 *) blockStart; + u16 result; + + *p = STATUS_CLEAR; + barrier(); + + *p = CONFIG_SETUP; + barrier(); + *p = UNLOCK_SECTOR; + barrier(); + + /* status check */ + *p = STATUS_READ; + barrier(); + + result = *p; + barrier(); + + *p = READ_ARRAY; + barrier(); + + if ((result & STATUS_PGM_ERR) != 0) { +#ifdef BLOB_DEBUG + SerialOutputString(__FUNCTION__ " failed at 0x"); + SerialOutputHex((u32) blockStart); + SerialOutputString(", status=0x"); + SerialOutputHex((u32) result); + SerialOutputByte('\n'); +#endif + return -EFLASHPGM; + } + + return 0; +} + + + + +static int flash_query_block_lock_intel16(u32 *blockStart) +{ + u16 *p = (u16 *) blockStart; + u16 result; + + *p = READ_CONFIG; + barrier(); + result = *(p + 2); + barrier(); + + *blockStart = READ_ARRAY; + barrier(); + +#ifdef BLOB_DEBUG + SerialOutputString(__FUNCTION__ ": status of block starting at 0x"); + SerialOutputHex((u32) blockStart); + SerialOutputString(": 0x"); + SerialOutputHex((u32) result); + SerialOutputByte('\n'); +#endif + + return result & (LOCK_STATUS_LOCKED | LOCK_STATUS_LOCKEDDOWN); +} + /* flash driver structure */ flash_driver_t intel16_flash_driver = { - erase: flash_erase_intel16, - write: flash_write_intel16, + erase: flash_erase_intel16, + write: flash_write_intel16, + lock_block: flash_lock_block_intel16, + unlock_block: flash_unlock_block_intel16, + query_block_lock: flash_query_block_lock_intel16 }; Index: intel32.c =================================================================== RCS file: /cvsroot/blob/blob/src/blob/intel32.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- intel32.c 2001/10/25 09:59:23 1.2 +++ intel32.c 2001/12/28 01:06:12 1.3 @@ -29,6 +29,7 @@ #include <blob/errno.h> #include <blob/flash.h> #include <blob/util.h> +#include <blob/serial.h> /* flash commands for two 16 bit intel flash chips */ @@ -42,6 +43,13 @@ #define STATUS_ERASE_ERR 0x00200020 #define STATUS_PGM_ERR 0x00100010 +#define CONFIG_SETUP 0x00600060 +#define LOCK_SECTOR 0x00010001 +#define UNLOCK_SECTOR 0x00D000D0 +#define READ_CONFIG 0x00900090 +#define LOCK_STATUS_LOCKED 0x00010001 +#define LOCK_STATUS_LOCKEDDOWN 0x00020002 + @@ -50,6 +58,9 @@ { u32 result; + *addr = data_to_flash(STATUS_CLEAR); + barrier(); + /* prepare for erase */ *addr = data_to_flash(ERASE_SETUP); barrier(); @@ -70,8 +81,16 @@ *addr = data_to_flash(READ_ARRAY); barrier(); - if((result & STATUS_ERASE_ERR) != 0) + if((result & STATUS_ERASE_ERR) != 0) { +#ifdef BLOB_DEBUG + SerialOutputString(__FUNCTION__ " failed, result=0x"); + SerialOutputHex(result); + SerialOutputString(", addr=0x"); + SerialOutputHex((u32) addr); + SerialOutputByte('\n'); +#endif return -EFLASHERASE; + } return 0; } @@ -83,6 +102,9 @@ { u32 result; + *dst = data_to_flash(STATUS_CLEAR); + barrier(); + /* setup flash for writing */ *dst = data_to_flash(PGM_SETUP); barrier(); @@ -104,17 +126,134 @@ *dst = data_to_flash(READ_ARRAY); barrier(); - if(((result & STATUS_PGM_ERR) != 0) || (*dst != *src)) + if(((result & STATUS_PGM_ERR) != 0) || (*dst != *src)) { +#ifdef BLOB_DEBUG + SerialOutputString(__FUNCTION__ "failed, result=0x"); + SerialOutputHex(result); + SerialOutputString(", addr=0x"); + SerialOutputHex((u32) dst); + SerialOutputByte('\n'); +#endif return -EFLASHPGM; - + } + return 0; } +static int flash_lock_block_intel32(u32 *blockStart) +{ + u32 result; + + *blockStart = data_to_flash(STATUS_CLEAR); + barrier(); + + *blockStart = data_to_flash(CONFIG_SETUP); + barrier(); + *blockStart = data_to_flash(LOCK_SECTOR); + barrier(); + + *blockStart = data_to_flash(READ_ARRAY); + barrier(); + + /* status check */ + *blockStart = data_to_flash(STATUS_READ); + barrier(); + + result = data_from_flash(*blockStart); + barrier(); + + *blockStart = data_to_flash(READ_ARRAY); + barrier(); + + if ((result & STATUS_PGM_ERR) != 0) { +#ifdef FLASH_DEBUG + SerialOutputString(__FUNCTION__ " failed at 0x"); + SerialOutputHex((u32) blockStart); + SerialOutputString(", status=0x"); + SerialOutputHex((u32) result); + SerialOutputByte('\n'); +#endif + return -EFLASHPGM; + } + + return 0; +} + + + + +static int flash_unlock_block_intel32(u32 *blockStart) +{ + u32 result; + + *blockStart = data_to_flash(STATUS_CLEAR); + barrier(); + + *blockStart = data_to_flash(CONFIG_SETUP); + barrier(); + *blockStart = data_to_flash(UNLOCK_SECTOR); + barrier(); + + *blockStart = data_to_flash(STATUS_READ); + barrier(); + + result = data_from_flash(*blockStart); + barrier(); + + *blockStart = data_to_flash(READ_ARRAY); + barrier(); + + if ((result & STATUS_PGM_ERR) != 0) { +#ifdef FLASH_DEBUG + SerialOutputString(__FUNCTION__ " failed at 0x"); + SerialOutputHex((u32) blockStart); + SerialOutputString(", status=0x"); + SerialOutputHex((u32) result); + SerialOutputByte('\n'); +#endif + return -EFLASHPGM; + } + + return 0; +} + + + + +static int flash_query_block_lock_intel32(u32 *blockStart) +{ + u32 result; + + *blockStart = data_to_flash(READ_CONFIG); + barrier(); + result = data_from_flash(*(blockStart + 2)); + barrier(); + + *blockStart = data_to_flash(READ_ARRAY); + barrier(); + +#ifdef FLASH_DEBUG + SerialOutputString(__FUNCTION__ ": status of block starting at 0x"); + SerialOutputHex((u32) blockStart); + SerialOutputString(": 0x"); + SerialOutputHex((u32) result); + SerialOutputByte('\n'); +#endif + + return result & (LOCK_STATUS_LOCKED | LOCK_STATUS_LOCKEDDOWN); +} + + + + /* flash driver structure */ flash_driver_t intel32_flash_driver = { - erase: flash_erase_intel32, - write: flash_write_intel32, + erase: flash_erase_intel32, + write: flash_write_intel32, + lock_block: flash_lock_block_intel32, + unlock_block: flash_unlock_block_intel32, + query_block_lock: flash_query_block_lock_intel32 }; Index: nullflash.c =================================================================== RCS file: /cvsroot/blob/blob/src/blob/nullflash.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- nullflash.c 2001/10/25 09:59:23 1.3 +++ nullflash.c 2001/12/28 01:06:12 1.4 @@ -57,8 +57,46 @@ +static int flash_lock_block_null(u32 *blockStart) +{ +#ifdef BLOB_DEBUG + printerrprefix(); + SerialOutputString("No flash lock_block() function\n"); +#endif + return -EFLASHPGM; +} + + + +static int flash_unlock_block_null(u32 *blockStart) +{ +#ifdef BLOB_DEBUG + printerrprefix(); + SerialOutputString("No flash unlock_block() function\n"); +#endif + return -EFLASHPGM; +} + + + + +static int flash_query_block_lock_null(u32 *blockStart) +{ +#ifdef BLOB_DEBUG + printerrprefix(); + SerialOutputString("No flash query_block_lock() function\n"); +#endif + return 0; +} + + + + /* flash driver structure */ flash_driver_t null_flash_driver = { - erase: flash_erase_null, - write: flash_write_null, + erase: flash_erase_null, + write: flash_write_null, + lock_block: flash_lock_block_null, + unlock_block: flash_unlock_block_null, + query_block_lock: flash_query_block_lock_null }; |
From: Erik M. <er...@us...> - 2001-12-28 01:06:16
|
Update of /cvsroot/blob/blob/include/blob In directory usw-pr-cvs1:/tmp/cvs-serv15022/include/blob Modified Files: flash.h Log Message: Flash update from Chris Hoover. This part only applies the mechanisms. Also updated the AMD and null flash drivers. Index: flash.h =================================================================== RCS file: /cvsroot/blob/blob/include/blob/flash.h,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- flash.h 2001/10/31 16:38:20 1.7 +++ flash.h 2001/12/28 01:06:12 1.8 @@ -45,8 +45,9 @@ typedef int (*flash_erase_func_t)(u32 *); typedef int (*flash_write_func_t)(u32 *, const u32 *); -typedef int (*flash_lock_func_t)(u32 *); -typedef int (*flash_unlock_func_t)(u32 *); +typedef int (*flash_lock_block_func_t)(u32 *); +typedef int (*flash_unlock_block_func_t)(u32 *); +typedef int (*flash_query_block_lock_func_t)(u32 *); typedef int (*flash_enable_vpp_func_t)(void); typedef int (*flash_disable_vpp_func_t)(void); @@ -55,8 +56,9 @@ flash_erase_func_t erase; flash_write_func_t write; - flash_lock_func_t lock; - flash_unlock_func_t unlock; + flash_lock_block_func_t lock_block; + flash_unlock_block_func_t unlock_block; + flash_query_block_lock_func_t query_block_lock; flash_enable_vpp_func_t enable_vpp; flash_disable_vpp_func_t disable_vpp; @@ -83,6 +85,8 @@ /* exported functions */ int flash_erase_region(u32 *start, u32 nwords); int flash_write_region(u32 *dst, const u32 *src, u32 nwords); +int flash_lock_region(u32 *start, u32 nwords); +int flash_unlock_region(u32 *start, u32 nwords); #endif |
From: Erik M. <er...@us...> - 2001-12-27 18:28:29
|
Update of /cvsroot/blob/blob/utils/build In directory usw-pr-cvs1:/tmp/cvs-serv30778/utils/build Modified Files: build_Makefile build_all Log Message: - Add HP Jornada 720 port (Chris Hoover) - Add HP Labs Badge4 port (Chris Hoover) - Slightly change the SA1110 memory setup or otherwise the HP machines won't work - Move SA1111 base address into machine specific include files Index: build_Makefile =================================================================== RCS file: /cvsroot/blob/blob/utils/build/build_Makefile,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- build_Makefile 2001/12/16 22:05:59 1.6 +++ build_Makefile 2001/12/27 18:28:27 1.7 @@ -13,8 +13,9 @@ # archs = \ - assabet brutus creditlart h3600 idr lart\ - nesa neponset pleb system3 shannon + assabet badge4 brutus creditlart h3600 idr\ + jornada720 lart neponset nesa pleb system3\ + shannon debug-archs = $(foreach a, $(archs), $(a)-debug) all-archs = $(archs) $(debug-archs) Index: build_all =================================================================== RCS file: /cvsroot/blob/blob/utils/build/build_all,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- build_all 2001/12/16 22:05:59 1.6 +++ build_all 2001/12/27 18:28:27 1.7 @@ -12,7 +12,7 @@ # published by the Free Software Foundation. # -archs="assabet brutus creditlart h3600 idr lart neponset nesa pleb system3 shannon" +archs="assabet badge4 brutus creditlart h3600 idr jornada720 lart neponset nesa pleb system3 shannon" linux_prefix=~/LART/build/linux/elinux blob_src=~/src/sourceforge/blob extra_flags="--enable-all-features" |
From: Erik M. <er...@us...> - 2001-12-27 18:27:40
|
Update of /cvsroot/blob/blob/include/blob In directory usw-pr-cvs1:/tmp/cvs-serv30527/include/blob Modified Files: arch.h linux.h memsetup.h sa1111.h Log Message: - Add HP Jornada 720 port (Chris Hoover) - Add HP Labs Badge4 port (Chris Hoover) - Slightly change the SA1110 memory setup or otherwise the HP machines won't work - Move SA1111 base address into machine specific include files Index: arch.h =================================================================== RCS file: /cvsroot/blob/blob/include/blob/arch.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- arch.h 2001/12/16 04:34:03 1.3 +++ arch.h 2001/12/27 18:27:37 1.4 @@ -39,6 +39,8 @@ /* architecture specific include files */ #if defined ASSABET # include <blob/arch/assabet.h> +#elif defined BADGE4 +# include <blob/arch/badge4.h> #elif defined BRUTUS # include <blob/arch/brutus.h> #elif defined CLART @@ -47,6 +49,8 @@ # include <blob/arch/h3600.h> #elif defined IDR # include <blob/arch/idr.h> +#elif defined JORNADA720 +# include <blob/arch/jornada720.h> #elif defined LART # include <blob/arch/lart.h> #elif defined NESA Index: linux.h =================================================================== RCS file: /cvsroot/blob/blob/include/blob/linux.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- linux.h 2001/12/16 04:34:03 1.3 +++ linux.h 2001/12/27 18:27:37 1.4 @@ -34,6 +34,8 @@ #if defined ASSABET # define ARCH_NUMBER (25) +#elif defined BADGE4 +# define ARCH_NUMBER (138) #elif defined BRUTUS # define ARCH_NUMBER (16) #elif defined CLART @@ -42,6 +44,8 @@ # define ARCH_NUMBER (22) #elif defined IDR # define ARCH_NUMBER (147) +#elif defined JORNADA720 +# define ARCH_NUMBER (48) #elif defined LART # define ARCH_NUMBER (27) #elif defined NESA Index: memsetup.h =================================================================== RCS file: /cvsroot/blob/blob/include/blob/memsetup.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- memsetup.h 2001/10/29 11:39:07 1.3 +++ memsetup.h 2001/12/27 18:27:37 1.4 @@ -54,6 +54,16 @@ * MDCNFG masks */ +#define MDCNFG_BANK0_ENABLE (1 << 0) +#define MDCNFG_BANK1_ENABLE (1 << 1) +#define MDCNFG_DTIM0_SDRAM (1 << 2) +#define MDCNFG_DWID0_32B (0 << 3) +#define MDCNFG_DWID0_16B (1 << 3) +#define MDCNFG_DRAC0(n_) (((n_) & 7) << 4) +#define MDCNFG_TRP0(n_) (((n_) & 0xF) << 8) +#define MDCNFG_TDL0(n_) (((n_) & 3) << 12) +#define MDCNFG_TWR0(n_) (((n_) & 3) << 14) + /********************************************************************** * MDREFR masks */ Index: sa1111.h =================================================================== RCS file: /cvsroot/blob/blob/include/blob/sa1111.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- sa1111.h 2001/10/09 19:24:54 1.2 +++ sa1111.h 2001/12/27 18:27:37 1.3 @@ -26,10 +26,10 @@ #ifndef BLOB_SA1111_H #define BLOB_SA1111_H -#ifdef PT_SYSTEM3 -# define SA1111_BASE (0x40000000) -#else -# error "DEFINE SA1111 BASE ADDRESS!" +#include <blob/arch.h> + +#ifndef SA1111_BASE +# error "Define SA1111_BASE address in architecture specific include file" #endif #define SA1111_p2v(x) (x) |