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...> - 2001-10-07 20:53:59
|
Update of /cvsroot/blob/blob/src/blob In directory usw-pr-cvs1:/tmp/cvs-serv13775/src/blob Modified Files: linux.c Log Message: Remove unused variable Index: linux.c =================================================================== RCS file: /cvsroot/blob/blob/src/blob/linux.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- linux.c 2001/10/07 19:34:17 1.2 +++ linux.c 2001/10/07 20:53:56 1.3 @@ -50,7 +50,6 @@ static int boot_linux(int argc, char *argv[]) { - register u32 i; void (*theKernel)(int zero, int arch) = (void (*)(int, int))KERNEL_RAM_BASE; setup_start_tag(); |
From: Erik M. <er...@us...> - 2001-10-07 20:29:41
|
Update of /cvsroot/blob/blob/src/lib In directory usw-pr-cvs1:/tmp/cvs-serv10121 Modified Files: Makefile.am command.c Removed Files: help.c Log Message: Move help command into command.c and remove help.c Index: Makefile.am =================================================================== RCS file: /cvsroot/blob/blob/src/lib/Makefile.am,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- Makefile.am 2001/10/07 19:04:25 1.2 +++ Makefile.am 2001/10/07 20:29:38 1.3 @@ -28,7 +28,6 @@ libblob_a_SOURCES = \ command.c \ error.c \ - help.c \ icache.c \ init.c \ led.c \ Index: command.c =================================================================== RCS file: /cvsroot/blob/blob/src/lib/command.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- command.c 2001/10/07 19:34:17 1.2 +++ command.c 2001/10/07 20:29:38 1.3 @@ -172,6 +172,47 @@ +/* help command */ +static int help(int argc, char *argv[]) +{ + commandlist_t *cmd; + + /* help on a command? */ + if(argc >= 2) { + for(cmd = commands; cmd != NULL; cmd = cmd->next) { + if(strcmp(cmd->name, argv[1]) == 0) { + SerialOutputString("Help for '"); + SerialOutputString(argv[1]); + SerialOutputString("':\n\nUsage: "); + SerialOutputString(cmd->help); + return 0; + } + } + + return -EINVAL; + } + + SerialOutputString("The following commands are supported:"); + + for(cmd = commands; cmd != NULL; cmd = cmd->next) { + SerialOutputString("\n* "); + SerialOutputString(cmd->name); + } + + SerialOutputString("\nUse \"help command\" to get help on a specific command\n"); + + return 0; +} + +static char helphelp[] = "help [command]\n" +"Get help on [command], " +"or a list of supported commands if a command is omitted.\n"; + +__commandlist(help, "help", helphelp); + + + + /* display a prompt, or the standard prompt if prompt == NULL */ void DisplayPrompt(char *prompt) { --- help.c DELETED --- |
From: Erik M. <er...@us...> - 2001-10-07 20:17:01
|
Update of /cvsroot/blob/blob/include/blob In directory usw-pr-cvs1:/tmp/cvs-serv7633/include/blob Modified Files: Makefile.am time.h Added Files: icache.h Log Message: Move initcalls to separate file because other the linker will not pick them up. --- NEW FILE: icache.h --- /* * icache.h: header file for icache.c * * Copyright (C) 2001 Erik Mouw (J.A...@it...) * * $Id: icache.h,v 1.1 2001/10/07 20:16: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: icache.h,v 1.1 2001/10/07 20:16:57 erikm Exp $" #ifndef BLOB_ICACHE_H #define BLOB_ICACHE_H void enable_icache(void); void disable_icache(void); #endif Index: Makefile.am =================================================================== RCS file: /cvsroot/blob/blob/include/blob/Makefile.am,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- Makefile.am 2001/10/07 15:17:49 1.2 +++ Makefile.am 2001/10/07 20:16:57 1.3 @@ -16,6 +16,7 @@ errno.h \ error.h \ flash.h \ + icache.h \ init.h \ led.h \ linux.h \ Index: time.h =================================================================== RCS file: /cvsroot/blob/blob/include/blob/time.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- time.h 2001/10/07 15:17:49 1.1 +++ time.h 2001/10/07 20:16:57 1.2 @@ -37,7 +37,7 @@ -#include "types.h" +#include <blob/types.h> @@ -45,6 +45,9 @@ #define TICKS_PER_SECOND 3686400 + + +void TimerInit(void); /* returns the time in 1/TICKS_PER_SECOND seconds */ u32 TimerGetTime(void); |
From: Erik M. <er...@us...> - 2001-10-07 20:17:00
|
Update of /cvsroot/blob/blob/src/blob In directory usw-pr-cvs1:/tmp/cvs-serv7633/src/blob Modified Files: Makefile.am Added Files: initcalls.c Log Message: Move initcalls to separate file because other the linker will not pick them up. --- NEW FILE: initcalls.c --- /* * initcalls.c: init and exit calls for blob * * Copyright (C) 2001 Erik Mouw <J.A...@it...> * * $Id: initcalls.c,v 1.1 2001/10/07 20:16: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: initcalls.c,v 1.1 2001/10/07 20:16:57 erikm Exp $" #ifdef HAVE_CONFIG_H # include <blob/config.h> #endif #include <blob/init.h> #include <blob/icache.h> #include <blob/led.h> #include <blob/serial.h> #include <blob/time.h> /* default serial initialisation */ static void serial_default_init(void) { SerialInit(baud9k6); } /* init calls */ __initlist(serial_default_init, INIT_LEVEL_INITIAL_HARDWARE); __initlist(enable_icache, INIT_LEVEL_INITIAL_HARDWARE); __initlist(led_on, INIT_LEVEL_INITIAL_HARDWARE); __initlist(TimerInit, INIT_LEVEL_OTHER_HARDWARE); /* exit calls */ __exitlist(disable_icache, INIT_LEVEL_INITIAL_HARDWARE); __exitlist(led_off, INIT_LEVEL_INITIAL_HARDWARE); Index: Makefile.am =================================================================== RCS file: /cvsroot/blob/blob/src/blob/Makefile.am,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- Makefile.am 2001/10/07 19:04:25 1.3 +++ Makefile.am 2001/10/07 20:16:57 1.4 @@ -78,6 +78,7 @@ flashasm.S \ testmem2.S \ flash.c \ + initcalls.c \ linux.c \ main.c \ memory.c \ |
From: Erik M. <er...@us...> - 2001-10-07 20:17:00
|
Update of /cvsroot/blob/blob/src/lib In directory usw-pr-cvs1:/tmp/cvs-serv7633/src/lib Modified Files: icache.c led.c serial.c time.c Log Message: Move initcalls to separate file because other the linker will not pick them up. Index: icache.c =================================================================== RCS file: /cvsroot/blob/blob/src/lib/icache.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- icache.c 2001/10/07 19:34:17 1.2 +++ icache.c 2001/10/07 20:16:57 1.3 @@ -27,12 +27,12 @@ # include <blob/config.h> #endif -#include <blob/init.h> +#include <blob/icache.h> #include <blob/types.h> -static void enable_icache(void) +void enable_icache(void) { register u32 i; @@ -49,7 +49,7 @@ -static void disable_icache(void) +void disable_icache(void) { register u32 i; @@ -65,10 +65,3 @@ /* flush i-cache */ asm ("mcr p15, 0, %0, c7, c5, 0": : "r" (i)); } - - - - -/* init and exit calls */ -__initlist(enable_icache, INIT_LEVEL_INITIAL_HARDWARE); -__exitlist(disable_icache, INIT_LEVEL_INITIAL_HARDWARE); Index: led.c =================================================================== RCS file: /cvsroot/blob/blob/src/lib/led.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- led.c 2001/10/07 19:34:17 1.2 +++ led.c 2001/10/07 20:16:57 1.3 @@ -76,8 +76,3 @@ else led_on(); } - - -/* init and exit calls */ -__initlist(led_on, INIT_LEVEL_INITIAL_HARDWARE); -__exitlist(led_off, INIT_LEVEL_INITIAL_HARDWARE); Index: serial.c =================================================================== RCS file: /cvsroot/blob/blob/src/lib/serial.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- serial.c 2001/10/07 19:34:17 1.2 +++ serial.c 2001/10/07 20:16:57 1.3 @@ -331,13 +331,3 @@ return(numRead); } - - -/* default initialisation */ -static void serial_default_init(void) -{ - SerialInit(baud9k6); -} - - -__initlist(serial_default_init, INIT_LEVEL_INITIAL_HARDWARE); Index: time.c =================================================================== RCS file: /cvsroot/blob/blob/src/lib/time.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- time.c 2001/10/07 19:34:17 1.2 +++ time.c 2001/10/07 20:16:57 1.3 @@ -48,7 +48,7 @@ -static void TimerInit(void) +void TimerInit(void) { /* clear counter */ OSCR = 0; @@ -68,8 +68,6 @@ numOverflows = 0; } - -__initlist(TimerInit, INIT_LEVEL_OTHER_HARDWARE); |
From: Erik M. <er...@us...> - 2001-10-07 20:14:03
|
Update of /cvsroot/blob/blob In directory usw-pr-cvs1:/tmp/cvs-serv6958 Modified Files: configure.in Log Message: Add a nice trick to allow the configure script to detect a cross compiler Index: configure.in =================================================================== RCS file: /cvsroot/blob/blob/configure.in,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- configure.in 2001/10/07 15:20:17 1.14 +++ configure.in 2001/10/07 20:14:00 1.15 @@ -9,7 +9,7 @@ dnl Init autoconf -AC_INIT(src/start.S) +AC_INIT(src/blob/start.S) AC_CONFIG_AUX_DIR(tools) @@ -40,13 +40,23 @@ +dnl Do some basic checks to see if we are cross compiling +dnl Hint: if we find arm-linux-whatever, we are cross compiling +AC_CHECK_PROGS(CC, arm-linux-gcc gcc, echo) +AC_CHECK_PROGS(OBJCOPY, arm-linux-objcopy objcopy, echo) +AC_CHECK_PROGS(RANLIB, arm-linux-ranlib ranlib, echo) +AC_CHECK_PROGS(AR, arm-linux-ar ar, echo) + + + + dnl Checks for programs. AC_PROG_CC if test "x$ac_cv_prog_gcc" != "xyes" ; then AC_MSG_WARN("C compiler is not gcc. This may lead to problems!"); AC_MSG_WARN("Trying to continue with $CC ..."); fi -AC_CHECK_PROGS(OBJCOPY, arm-linux-objcopy objcopy, echo) +AC_PROG_RANLIB AC_PROG_INSTALL AC_PROG_LN_S |
From: Erik M. <er...@us...> - 2001-10-07 19:37:10
|
Update of /cvsroot/blob/blob/src/lib In directory usw-pr-cvs1:/tmp/cvs-serv699/lib Added Files: .cvsignore Log Message: add and adjust .cvsignore files --- NEW FILE: .cvsignore --- Makefile.in Makefile *.o *.a |
From: Erik M. <er...@us...> - 2001-10-07 19:37:10
|
Update of /cvsroot/blob/blob/src/diag In directory usw-pr-cvs1:/tmp/cvs-serv699/diag Added Files: .cvsignore Log Message: add and adjust .cvsignore files --- NEW FILE: .cvsignore --- Makefile.in Makefile diag *.o |
From: Erik M. <er...@us...> - 2001-10-07 19:37:10
|
Update of /cvsroot/blob/blob/src In directory usw-pr-cvs1:/tmp/cvs-serv699 Modified Files: .cvsignore Log Message: add and adjust .cvsignore files Index: .cvsignore =================================================================== RCS file: /cvsroot/blob/blob/src/.cvsignore,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- .cvsignore 2001/09/16 15:41:25 1.2 +++ .cvsignore 2001/10/07 19:37:07 1.3 @@ -1,4 +1,2 @@ Makefile.in Makefile -blob* -*.o |
From: Erik M. <er...@us...> - 2001-10-07 19:37:10
|
Update of /cvsroot/blob/blob/src/blob In directory usw-pr-cvs1:/tmp/cvs-serv699/blob Added Files: .cvsignore Log Message: add and adjust .cvsignore files --- NEW FILE: .cvsignore --- Makefile.in Makefile blob* *.o |
Update of /cvsroot/blob/blob/src/blob In directory usw-pr-cvs1:/tmp/cvs-serv32578/blob Modified Files: chkmem.c clock.c debug.c flash.c flashasm.S linux.c main.c memory.c param_block.c reboot.c testmem2.S trampoline.S uucodec.c Log Message: Fix include files Index: chkmem.c =================================================================== RCS file: /cvsroot/blob/blob/src/blob/chkmem.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- chkmem.c 2001/10/07 19:04:25 1.1 +++ chkmem.c 2001/10/07 19:34:17 1.2 @@ -32,18 +32,18 @@ #ident "$Id$" #ifdef HAVE_CONFIG_H -# include "config.h" +# include <blob/config.h> #endif -#include "main.h" -#include "command.h" -#include "types.h" -#include "sa1100.h" -#include "serial.h" -#include "time.h" -#include "util.h" +#include <blob/main.h> +#include <blob/command.h> +#include <blob/types.h> +#include <blob/sa1100.h> +#include <blob/serial.h> +#include <blob/time.h> +#include <blob/util.h> -#include "memory.h" +#include <blob/memory.h> /*********************************************************************/ /** DEFINES *********************************************************/ Index: clock.c =================================================================== RCS file: /cvsroot/blob/blob/src/blob/clock.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- clock.c 2001/10/07 19:04:25 1.1 +++ clock.c 2001/10/07 19:34:17 1.2 @@ -32,17 +32,17 @@ #ident "$Id$" #ifdef HAVE_CONFIG_H -# include "config.h" +# include <blob/config.h> #endif -#include "command.h" -#include "errno.h" -#include "error.h" -#include "types.h" -#include "sa1100.h" -#include "serial.h" -#include "time.h" -#include "util.h" +#include <blob/command.h> +#include <blob/errno.h> +#include <blob/error.h> +#include <blob/types.h> +#include <blob/sa1100.h> +#include <blob/serial.h> +#include <blob/time.h> +#include <blob/util.h> /* Struct with the SA-1100 PLL + DRAM parameter registers */ Index: debug.c =================================================================== RCS file: /cvsroot/blob/blob/src/blob/debug.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- debug.c 2001/10/07 19:04:25 1.1 +++ debug.c 2001/10/07 19:34:17 1.2 @@ -26,15 +26,15 @@ */ #ifdef HAVE_CONFIG_H -# include "config.h" +# include <blob/config.h> #endif -#include "errno.h" -#include "error.h" -#include "types.h" -#include "util.h" -#include "serial.h" -#include "command.h" +#include <blob/errno.h> +#include <blob/error.h> +#include <blob/types.h> +#include <blob/util.h> +#include <blob/serial.h> +#include <blob/command.h> /********************************************************************** * defines Index: flash.c =================================================================== RCS file: /cvsroot/blob/blob/src/blob/flash.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- flash.c 2001/10/07 19:04:25 1.1 +++ flash.c 2001/10/07 19:34:17 1.2 @@ -32,16 +32,16 @@ #ident "$Id$" #ifdef HAVE_CONFIG_H -# include "config.h" +# include <blob/config.h> #endif -#include "errno.h" -#include "error.h" -#include "led.h" -#include "main.h" -#include "util.h" -#include "serial.h" -#include "flash.h" +#include <blob/errno.h> +#include <blob/error.h> +#include <blob/led.h> +#include <blob/main.h> +#include <blob/util.h> +#include <blob/serial.h> +#include <blob/flash.h> /* define for advanced flash functionality (not that it works) -- Erik */ /* #define ADVANCED_FLASH 1 */ Index: flashasm.S =================================================================== RCS file: /cvsroot/blob/blob/src/blob/flashasm.S,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- flashasm.S 2001/10/07 19:04:25 1.1 +++ flashasm.S 2001/10/07 19:34:17 1.2 @@ -22,7 +22,7 @@ .ident "$Id$" #ifdef HAVE_CONFIG_H -# include <config.h> +# include <blob/config.h> #endif .text @@ -107,7 +107,7 @@ mov r0, r1 #endif - mov pc, r14 + mov pc, lr /* Takes data received from the flash, and unshuffles it. */ data_from_flash: @@ -184,7 +184,4 @@ mov r0, r1 #endif - mov pc, r14 - - - + mov pc, lr Index: linux.c =================================================================== RCS file: /cvsroot/blob/blob/src/blob/linux.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- linux.c 2001/10/07 19:04:25 1.1 +++ linux.c 2001/10/07 19:34:17 1.2 @@ -22,17 +22,17 @@ #ident "$Id$" #ifdef HAVE_CONFIG_H -# include "config.h" +# include <blob/config.h> #endif -#include "linux.h" -#include "command.h" -#include "main.h" -#include "flash.h" -#include "init.h" -#include "memory.h" -#include "serial.h" -#include "util.h" +#include <blob/linux.h> +#include <blob/command.h> +#include <blob/main.h> +#include <blob/flash.h> +#include <blob/init.h> +#include <blob/memory.h> +#include <blob/serial.h> +#include <blob/util.h> #include <asm-arm/setup.h> Index: main.c =================================================================== RCS file: /cvsroot/blob/blob/src/blob/main.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- main.c 2001/10/07 19:04:25 1.1 +++ main.c 2001/10/07 19:34:17 1.2 @@ -35,23 +35,23 @@ #ident "$Id$" #ifdef HAVE_CONFIG_H -# include "config.h" +# include <blob/config.h> #endif -#include "command.h" -#include "errno.h" -#include "error.h" -#include "flash.h" -#include "init.h" -#include "led.h" -#include "main.h" -#include "memory.h" -#include "param_block.h" -#include "sa1100.h" -#include "serial.h" -#include "time.h" -#include "util.h" -#include "uucodec.h" +#include <blob/command.h> +#include <blob/errno.h> +#include <blob/error.h> +#include <blob/flash.h> +#include <blob/init.h> +#include <blob/led.h> +#include <blob/main.h> +#include <blob/memory.h> +#include <blob/param_block.h> +#include <blob/sa1100.h> +#include <blob/serial.h> +#include <blob/time.h> +#include <blob/util.h> +#include <blob/uucodec.h> Index: memory.c =================================================================== RCS file: /cvsroot/blob/blob/src/blob/memory.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- memory.c 2001/10/07 19:04:25 1.1 +++ memory.c 2001/10/07 19:34:17 1.2 @@ -22,12 +22,12 @@ #ident "$Id$" #ifdef HAVE_CONFIG_H -# include "config.h" +# include <blob/config.h> #endif -#include "main.h" -#include "memory.h" -#include "serial.h" +#include <blob/main.h> +#include <blob/memory.h> +#include <blob/serial.h> /* test in 1MB chunks */ #define TEST_BLOCK_SIZE (1024 * 1024) Index: param_block.c =================================================================== RCS file: /cvsroot/blob/blob/src/blob/param_block.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- param_block.c 2001/10/07 19:04:25 1.1 +++ param_block.c 2001/10/07 19:34:17 1.2 @@ -32,15 +32,15 @@ #ident "$Id$" #ifdef HAVE_CONFIG_H -# include "config.h" +# include <blob/config.h> #endif -#include "types.h" -#include "param_block.h" -#include "main.h" -#include "flash.h" -#include "util.h" -#include "sa1100.h" +#include <blob/types.h> +#include <blob/param_block.h> +#include <blob/main.h> +#include <blob/flash.h> +#include <blob/util.h> +#include <blob/sa1100.h> Index: reboot.c =================================================================== RCS file: /cvsroot/blob/blob/src/blob/reboot.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- reboot.c 2001/10/07 19:04:25 1.1 +++ reboot.c 2001/10/07 19:34:17 1.2 @@ -24,14 +24,14 @@ #ident "$Id$" #ifdef HAVE_CONFIG_H -# include "config.h" +# include <blob/config.h> #endif -#include "command.h" -#include "main.h" -#include "serial.h" -#include "sa1100.h" -#include "time.h" +#include <blob/command.h> +#include <blob/main.h> +#include <blob/serial.h> +#include <blob/sa1100.h> +#include <blob/time.h> Index: testmem2.S =================================================================== RCS file: /cvsroot/blob/blob/src/blob/testmem2.S,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- testmem2.S 2001/10/07 19:04:25 1.1 +++ testmem2.S 2001/10/07 19:34:17 1.2 @@ -26,7 +26,7 @@ .ident "$Id$" #ifdef HAVE_CONFIG_H -# include <config.h> +# include <blob/config.h> #endif .text Index: trampoline.S =================================================================== RCS file: /cvsroot/blob/blob/src/blob/trampoline.S,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- trampoline.S 2001/10/07 19:04:25 1.1 +++ trampoline.S 2001/10/07 19:34:17 1.2 @@ -22,7 +22,7 @@ .ident "$Id$" #ifdef HAVE_CONFIG_H -# include <config.h> +# include <blob/config.h> #endif .text Index: uucodec.c =================================================================== RCS file: /cvsroot/blob/blob/src/blob/uucodec.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- uucodec.c 2001/10/07 19:04:25 1.1 +++ uucodec.c 2001/10/07 19:34:17 1.2 @@ -34,12 +34,12 @@ #ident "$Id$" #ifdef HAVE_CONFIG_H -# include "config.h" +# include <blob/config.h> #endif -#include "errno.h" -#include "serial.h" -#include "util.h" +#include <blob/errno.h> +#include <blob/serial.h> +#include <blob/util.h> |
From: Erik M. <er...@us...> - 2001-10-07 19:34:20
|
Update of /cvsroot/blob/blob/src/lib In directory usw-pr-cvs1:/tmp/cvs-serv32578/lib Modified Files: command.c error.c help.c icache.c init.c led.c serial.c terminal.c time.c util.c Log Message: Fix include files Index: command.c =================================================================== RCS file: /cvsroot/blob/blob/src/lib/command.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- command.c 2001/10/07 19:04:25 1.1 +++ command.c 2001/10/07 19:34:17 1.2 @@ -32,16 +32,16 @@ #ident "$Id$" #ifdef HAVE_CONFIG_H -# include "config.h" +# include <blob/config.h> #endif -#include "command.h" -#include "errno.h" -#include "init.h" -#include "serial.h" -#include "time.h" -#include "types.h" -#include "util.h" +#include <blob/command.h> +#include <blob/errno.h> +#include <blob/init.h> +#include <blob/serial.h> +#include <blob/time.h> +#include <blob/types.h> +#include <blob/util.h> /* command list start and end. filled in by the linker */ extern u32 __commandlist_start; Index: error.c =================================================================== RCS file: /cvsroot/blob/blob/src/lib/error.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- error.c 2001/10/07 19:04:25 1.1 +++ error.c 2001/10/07 19:34:17 1.2 @@ -24,13 +24,13 @@ #ident "$Id$" #ifdef HAVE_CONFIG_H -# include "config.h" +# include <blob/config.h> #endif -#include "errno.h" -#include "error.h" -#include "serial.h" -#include "types.h" +#include <blob/errno.h> +#include <blob/error.h> +#include <blob/serial.h> +#include <blob/types.h> typedef struct { Index: help.c =================================================================== RCS file: /cvsroot/blob/blob/src/lib/help.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- help.c 2001/10/07 19:04:25 1.1 +++ help.c 2001/10/07 19:34:17 1.2 @@ -24,14 +24,14 @@ #ident "$Id$" #ifdef HAVE_CONFIG_H -# include "config.h" +# include <blob/config.h> #endif -#include "command.h" -#include "errno.h" -#include "error.h" -#include "serial.h" -#include "util.h" +#include <blob/command.h> +#include <blob/errno.h> +#include <blob/error.h> +#include <blob/serial.h> +#include <blob/util.h> Index: icache.c =================================================================== RCS file: /cvsroot/blob/blob/src/lib/icache.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- icache.c 2001/10/07 19:04:25 1.1 +++ icache.c 2001/10/07 19:34:17 1.2 @@ -24,11 +24,11 @@ #ident "$Id$" #ifdef HAVE_CONFIG_H -# include "config.h" +# include <blob/config.h> #endif -#include "init.h" -#include "types.h" +#include <blob/init.h> +#include <blob/types.h> Index: init.c =================================================================== RCS file: /cvsroot/blob/blob/src/lib/init.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- init.c 2001/10/07 19:04:25 1.1 +++ init.c 2001/10/07 19:34:17 1.2 @@ -24,14 +24,14 @@ #ident "$Id$" #ifdef HAVE_CONFIG_H -# include "config.h" +# include <blob/config.h> #endif -#include "errno.h" -#include "error.h" -#include "init.h" -#include "serial.h" -#include "types.h" +#include <blob/errno.h> +#include <blob/error.h> +#include <blob/init.h> +#include <blob/serial.h> +#include <blob/types.h> /* int and exit list start and end. filled in by the linker */ Index: led.c =================================================================== RCS file: /cvsroot/blob/blob/src/lib/led.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- led.c 2001/10/07 19:04:25 1.1 +++ led.c 2001/10/07 19:34:17 1.2 @@ -37,12 +37,12 @@ #ident "$Id$" #ifdef HAVE_CONFIG_H -# include "config.h" +# include <blob/config.h> #endif -#include "led.h" -#include "sa1100.h" -#include "init.h" +#include <blob/led.h> +#include <blob/sa1100.h> +#include <blob/init.h> Index: serial.c =================================================================== RCS file: /cvsroot/blob/blob/src/lib/serial.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- serial.c 2001/10/07 19:04:25 1.1 +++ serial.c 2001/10/07 19:34:17 1.2 @@ -32,14 +32,14 @@ #ident "$Id$" #ifdef HAVE_CONFIG_H -# include "config.h" +# include <blob/config.h> #endif -#include "init.h" -#include "led.h" -#include "sa1100.h" -#include "serial.h" -#include "time.h" +#include <blob/init.h> +#include <blob/led.h> +#include <blob/sa1100.h> +#include <blob/serial.h> +#include <blob/time.h> /* * Initialise the serial port with the given baudrate. The settings Index: terminal.c =================================================================== RCS file: /cvsroot/blob/blob/src/lib/terminal.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- terminal.c 2001/10/07 19:04:25 1.1 +++ terminal.c 2001/10/07 19:34:17 1.2 @@ -24,12 +24,12 @@ #ident "$Id$" #ifdef HAVE_CONFIG_H -# include "config.h" +# include <blob/config.h> #endif -#include "command.h" -#include "main.h" -#include "serial.h" +#include <blob/command.h> +#include <blob/main.h> +#include <blob/serial.h> Index: time.c =================================================================== RCS file: /cvsroot/blob/blob/src/lib/time.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- time.c 2001/10/07 19:04:25 1.1 +++ time.c 2001/10/07 19:34:17 1.2 @@ -32,13 +32,13 @@ #ident "$Id$" #ifdef HAVE_CONFIG_H -# include "config.h" +# include <blob/config.h> #endif -#include "init.h" -#include "led.h" -#include "sa1100.h" -#include "time.h" +#include <blob/init.h> +#include <blob/led.h> +#include <blob/sa1100.h> +#include <blob/time.h> Index: util.c =================================================================== RCS file: /cvsroot/blob/blob/src/lib/util.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- util.c 2001/10/07 19:04:25 1.1 +++ util.c 2001/10/07 19:34:17 1.2 @@ -32,12 +32,12 @@ #ident "$Id$" #ifdef HAVE_CONFIG_H -# include "config.h" +# include <blob/config.h> #endif -#include "types.h" -#include "util.h" -#include "serial.h" +#include <blob/types.h> +#include <blob/util.h> +#include <blob/serial.h> |
From: Erik M. <er...@us...> - 2001-10-07 19:29:30
|
Update of /cvsroot/blob/blob/src In directory usw-pr-cvs1:/tmp/cvs-serv31118 Removed Files: chkmem.c clock.c command.c Log Message: these files were moved, forgot to remove them from this directory --- chkmem.c DELETED --- --- clock.c DELETED --- --- command.c DELETED --- |
From: Erik M. <er...@us...> - 2001-10-07 19:04:28
|
Update of /cvsroot/blob/blob/src/blob In directory usw-pr-cvs1:/tmp/cvs-serv26965/blob Modified Files: Makefile.am Added Files: chkmem.c clock.c debug.c flash.c flashasm.S linux.c main.c memory.c param_block.c reboot.c rest-ld-script testmem2.S trampoline.S uucodec.c Log Message: Move all files to either blob/ or lib/ --- NEW FILE: chkmem.c --- /*------------------------------------------------------------------------- * Filename: chkmem.c * Version: $Id: chkmem.c,v 1.1 2001/10/07 19:04:25 erikm Exp $ * Copyright: Copyright (C) 2001, Stefan Eletzhofer * Author: Stefan Eletzhofer <ste...@ww...> * Description: memory test functions * Created at: Mit Sep 26 19:20:24 CEST 2001 * Modified by: * Modified at: *-----------------------------------------------------------------------*/ /* * chkmem.c: Utility to test memory integrity * * Copyright (C) 2001 Stefan Eletzhofer <ste...@ww...> * * 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: chkmem.c,v 1.1 2001/10/07 19:04:25 erikm Exp $" #ifdef HAVE_CONFIG_H # include "config.h" #endif #include "main.h" #include "command.h" #include "types.h" #include "sa1100.h" #include "serial.h" #include "time.h" #include "util.h" #include "memory.h" /*********************************************************************/ /** DEFINES *********************************************************/ /*********************************************************************/ /* define this to 1 for debug */ #define CHKMEM_DEBUG 1 /* show every X bytes of memory during test */ #define CHKMEM_SHOWEVERY (1<<14) /* more readable IMHO */ #define MEM( x ) (*((u32 *)x)) /* Optimization barrier */ /* The "volatile" is due to gcc bugs */ #define barrier() __asm__ __volatile__("": : :"memory") #define MAKE32FROM8(X) (u32) (X | X << 8 | X << 16 | X << 24) #define CHKMEM_ERR (-1) #define CHKMEM_OK (0) #if CHKMEM_DEBUG # define SHOWFUNC() SerialOutputString("chkmem: method: "__FUNCTION__ "\n" ); \ SerialOutputString(" p1=0x"); \ SerialOutputHex((u32)bp1); \ SerialOutputString(" p2=0x"); \ SerialOutputHex((u32)bp2); \ SerialOutputString(" count=0x"); \ SerialOutputHex((u32)count); \ SerialOutputString("\n"); #else # define SHOWFUNC() SerialOutputString("chkmem: method: "__FUNCTION__ "\n" ); #endif #define SKIPBLOBMEM( STARTADR ) while ( STARTADR < (BLOB_RAM_BASE + 0x00100000) ) STARTADR++; #define CHKMEM_MAXERR 64 #define CHKMEM_PUSHERR( ADR ) { chkmem_errlist[ chkmem_errs % CHKMEM_MAXERR ] = ADR; \ chkmem_errs++; } /*********************************************************************/ /** MODULE GLOBALS *************************************************/ /*********************************************************************/ static u32 showevery; /* list of failed adresses */ static u32 chkmem_errlist[ CHKMEM_MAXERR ]; static int chkmem_errs; /*********************************************************************/ /** TYPES *********************************************************/ /*********************************************************************/ typedef int (*memtestfunc_t)( u32, u32, u32, u32 *); /*********************************************************************/ /** FORWARDS *******************************************************/ /*********************************************************************/ static int ChkMemErr( void ); static int ChkMemMovInv( u32 start, u32 end, u32 pattern, u32 *badadr ); static int ChkMemAdrTst( u32 start, u32 end, u32 pattern, u32 *badadr ); static int ChkMemHardcore( u32 start, u32 end, u32 pattern, u32 *badadr ); static void showrun( u32 run ); static void showadr( volatile u32 *adr ); /* Charles Cazabon test methods */ static int test_or_comparison (u32 *bp1, u32 *bp2, u32 count); static int test_and_comparison (u32 *bp1, u32 *bp2, u32 count); static int test_seqinc_comparison (u32 *bp1, u32 *bp2, u32 count); static int test_checkerboard_comparison (u32 *bp1, u32 *bp2, u32 count); static int test_solidbits_comparison (u32 *bp1, u32 *bp2, u32 count); static int test_blockseq_comparison (u32 *bp1, u32 *bp2, u32 count); static int test_walkbits_comparison (u32 *bp1, u32 *bp2, u32 count, int mode); static int test_bitspread_comparison (u32 *bp1, u32 *bp2, u32 count); static int test_bitflip_comparison (u32 *bp1, u32 *bp2, u32 count); static int test_stuck_address (u32 *bp1, u32 *bp2, u32 count); /*********************************************************************/ /** EXPORTED FUNCTIONS ***********************************************/ /*********************************************************************/ /********************************************************************* * ChkMem * * AUTOR: Stefan Eletzhofer * REVISED: * * Command entry, memory test method dispatcher * */ int ChkMem( int argc, char *argv[] ) { memtestfunc_t method; int area; u32 start = 0L; u32 end = 0L; u32 badaddr = 0L; u32 repcount = 0L; /* check args */ if ( argc < 2 ) { SerialOutputString("*** not enough arguments\n"); return CHKMEM_ERR; } /* reset error counter */ chkmem_errs = 0; /* get verbosity level */ showevery = CHKMEM_SHOWEVERY; if ( argc > 2 ) { if(strtoval(argv[2], &showevery) < 0) { SerialOutputString("*** not a value\n"); return CHKMEM_ERR; } if ( showevery > 0 ) { showevery = 1<<showevery; } else { /* never show address */ showevery = 0xffffffff; } } /* get repeat count */ repcount = 1; if ( argc > 3 ) { if ( strtoval(argv[3], &repcount ) < 0 ) { SerialOutputString("*** not a value\n"); return CHKMEM_ERR; } } SerialOutputString(argv[0]); SerialOutputString(": display every 0x"); SerialOutputHex(showevery); SerialOutputString(" bytes\n"); /* set memory test method */ switch ( *argv[1] ) { case '0': method = ChkMemMovInv; break; case '1': method = ChkMemAdrTst; break; case '2': method = ChkMemHardcore; break; default: SerialOutputString("*** unknown method\n"); return CHKMEM_ERR; break; } while ( repcount-- ) { /* test all known memory areas */ for (area = 0; area < NUM_MEM_AREAS; area++) { if(memory_map[area].used) { start = memory_map[area].start; end = start + memory_map[area].len; if ( method(start, end, 0x5555aaaa, &badaddr) != CHKMEM_OK ) { CHKMEM_PUSHERR( badaddr ); } } } } if ( chkmem_errs == 0 ) { SerialOutputString("\n*** no error found\n"); } else { ChkMemErr(); } return CHKMEM_OK; } static char chkmemhelp[] = "chkmem [method] {verbosity:1..F} {repeat-count}\nmethod=0: move-inverse test\n" "method=1: address test\n" "method=2: hardcore test\n" "verbosity: display every 2^n address during test\n"; __commandlist(ChkMem, "chkmem", chkmemhelp); /*********************************************************************/ /** STATIC FUNCTIONS ************************************************/ /*********************************************************************/ /********************************************************************* * showrun * * AUTOR: SELETZ * REVISED: * * Shows current memory test run * */ static void showrun( u32 run ) { SerialOutputString( "\r\nrun " ); SerialOutputHex( run ); SerialOutputString( "\n" ); } /********************************************************************* * showadr * * AUTOR: SELETZ * REVISED: * * display <adr> every <showevery> bytes. * */ static void showadr( volatile u32 *adr ) { if ( ((u32)adr) % showevery == 0 ) { SerialOutputString("\r"); SerialOutputHex( (u32)adr ); } } /********************************************************************* * ChkMemErr * * AUTOR: Stefan Eletzhofer * REVISED: * * Reports memory check errors * */ static int ChkMemErr( void ) { int i; SerialOutputString("\n*** memory errors:\n"); for ( i=0; i< chkmem_errs % CHKMEM_MAXERR; i++ ) { SerialOutputHex( i ); SerialOutputString(": 0x"); SerialOutputHex(chkmem_errlist[i]); SerialOutputString("\n"); } return CHKMEM_OK; } /********************************************************************* * ChkMemMovInv * * AUTOR: Stefan Eletzhofer * REVISED: * * Moving-Inverse Memory Test * * Test method (from GNU/memtest86 utility): * 1) Fill memory with a pattern * 2) Starting at the lowest address * 2a check that the pattern has not changed * 2b write the patterns complement * 2c increment the address * repeat 2a - 2c * 3) Starting at the highest address * 3a check that the pattern has not changed * 3b write the patterns complement * 3c decrement the address * repeat 3a - 3c * * returns 1 if memory failure, returns failed * address in badadr * */ static int ChkMemMovInv( u32 start, u32 end, u32 pattern, u32 *badadr ) { int ret = 1; register u32 p; register u32 tst; SerialOutputString("\nchkmem: move-inverse method\n"); SKIPBLOBMEM( start ); #if CHKMEM_DEBUG SerialOutputString("ChkMem: start(0x"); SerialOutputHex(start); SerialOutputString(") - end(0x"); SerialOutputHex(end); SerialOutputString(")\n"); #endif #if CHKMEM_DEBUG SerialOutputString("ChkMem: fillup\n"); #endif /* fill mem with pattern */ p=start; while ( p<end ) { MEM( p ) = pattern; barrier(); p += 4; } #if CHKMEM_DEBUG SerialOutputString("\rChkMem: bottom-up\n"); #endif /* bottom-up test */ p=start; while ( p<end ) { showadr( (u32*)p ); tst = MEM( p ); if ( tst != pattern ) { goto DONE; } MEM( p ) = ~pattern; barrier(); p += 4; } pattern = ~pattern; #if CHKMEM_DEBUG SerialOutputString("\rChkMem: top-down\n"); #endif /* top-down test */ p=end-4; while ( p>=start ) { showadr( (u32*)p ); tst = MEM( p ); if ( tst != pattern ) { goto DONE; } MEM( p ) = ~pattern; barrier(); p -= 4; } /* no error if we reach this point */ ret = 0; DONE: if ( ret != 0 && badadr ) { *badadr = p; } return ret; } /********************************************************************* * ChkMemAdrTst * * AUTOR: Stefan Eletzhofer * REVISED: * * Writes every memory location with its adress, then checks address * * returns 1 if memory failure, returns failed * address in badadr * */ static int ChkMemAdrTst( u32 start, u32 end, u32 pattern, u32 *badadr ) { int ret = 1; register u32 p; register u32 tst; SerialOutputString("\nchkmem: address test method\n"); SKIPBLOBMEM( start ); #if CHKMEM_DEBUG SerialOutputString("ChkMem: start(0x"); SerialOutputHex(start); SerialOutputString(") - end(0x"); SerialOutputHex(end); SerialOutputString(")\n"); #endif #if CHKMEM_DEBUG SerialOutputString("ChkMem: fillup\n"); #endif /* fill mem with pattern */ p=start; while ( p<end ) { MEM( p ) = p; barrier(); p += 4; } #if CHKMEM_DEBUG SerialOutputString("\rChkMem: bottom-up\n"); #endif /* bottom-up test */ p=start; while ( p<end ) { showadr( (u32*)p ); tst = MEM( p ); if ( tst != p ) { goto DONE; } p += 4; } /* no error if we reach this point */ ret = 0; DONE: if ( ret != 0 && badadr ) { *badadr = p; } return ret; } /********************************************************************* * ChkMemHardcore * * AUTOR: Stefan Eletzhofer * REVISED: * * Hardcore memory test. Test methods based on memtest * by Charles Cazabon <me...@di...> * * returns 1 if memory failure, returns failed * address in badadr * */ static int ChkMemHardcore( u32 start, u32 end, u32 pattern, u32 *badadr ) { register u32 count; SerialOutputString("\nchkmem: hardcore test method\n"); SKIPBLOBMEM( start ); #if CHKMEM_DEBUG SerialOutputString("ChkMem: start(0x"); SerialOutputHex(start); SerialOutputString(") - end(0x"); SerialOutputHex(end); SerialOutputString(")\n"); #endif count = end - start; SerialOutputHex(count); SerialOutputString("\n"); count = (count >> 1); SerialOutputHex(count); SerialOutputString("\n"); test_or_comparison((u32 *)start, (u32 *)(start+count), count>>2); test_and_comparison((u32 *)start, (u32 *)(start+count), count>>2); test_seqinc_comparison((u32 *)start, (u32 *)(start+count), count>>2); test_checkerboard_comparison ((u32 *)start, (u32 *)(start+count), count>>2); test_solidbits_comparison((u32 *)start, (u32 *)(start+count), count>>2); test_blockseq_comparison((u32 *)start, (u32 *)(start+count), count>>2); test_walkbits_comparison((u32 *)start, (u32 *)(start+count), count>>2, 0); test_walkbits_comparison((u32 *)start, (u32 *)(start+count), count>>2, 1); test_bitspread_comparison((u32 *)start, (u32 *)(start+count), count>>2); test_bitflip_comparison((u32 *)start, (u32 *)(start+count), count>>2); test_stuck_address((u32 *)start, (u32 *)(start+count), count>>2); /* no error if we reach this point */ if ( badadr ) { *badadr = 0L; } return 0; } /*********************************************************************/ /** MEMTESTER FUNCTIONS *********************************************/ /*********************************************************************/ /********************************************************************** * Original Authors of following memory test functions: * * Charles Cazabon <me...@di...> * * Copyright © 1999 Simon Kirby. * Version 2 Copyright © 1999 Charles Cazabon. * */ int test_verify_success (u32 *bp1, u32 *bp2, u32 count) { volatile u32 *p1 = (volatile u32 *) bp1; volatile u32 *p2 = (volatile u32 *) bp2; u32 i; for (i = 0; i < count; i++, p1++, p2++) { if ( MEM( p1 ) != MEM( p2 ) ) { SerialOutputString("\nchkmem: contents differ:\n"); SerialOutputHex((u32)p1); SerialOutputString("\n"); SerialOutputHex((u32)p2); SerialOutputString("\n"); CHKMEM_PUSHERR( (u32)p1 ); CHKMEM_PUSHERR( (u32)p2 ); } } return (CHKMEM_OK); } int test_or_comparison (u32 *bp1, u32 *bp2, u32 count) { volatile u32 *p1 = (volatile u32 *) bp1; volatile u32 *p2 = (volatile u32 *) bp2; u32 i; u32 q = 0xdeadbeef; SHOWFUNC(); for (i = 0; i < count; i++) { showadr( p2 ); MEM( p1++ ) |= q; barrier(); MEM( p2++ ) |= q; barrier(); } return (test_verify_success (bp1, bp2, count)); } int test_and_comparison (u32 *bp1, u32 *bp2, u32 count) { volatile u32 *p1 = (volatile u32 *) bp1; volatile u32 *p2 = (volatile u32 *) bp2; u32 i; u32 q = 0xdeadbeef; SHOWFUNC(); for (i = 0; i < count; i++) { showadr( p1 ); MEM( p1++ ) &= q; barrier(); MEM( p2++ ) &= q; barrier(); } return (test_verify_success (bp1, bp2, count)); } int test_seqinc_comparison (u32 *bp1, u32 *bp2, u32 count) { volatile u32 *p1 = (volatile u32 *) bp1; volatile u32 *p2 = (volatile u32 *) bp2; u32 i; u32 q = 0xdeadbeef; SHOWFUNC(); for (i = 0; i < count; i++) { showadr( p1 ); MEM( p1++ ) = MEM( p2++ ) = (i + q); barrier(); } return (test_verify_success (bp1, bp2, count)); } int test_solidbits_comparison (u32 *bp1, u32 *bp2, u32 count) { volatile u32 *p1 = (volatile u32 *) bp1; volatile u32 *p2 = (volatile u32 *) bp2; u32 q, i, j; SHOWFUNC(); for (j = 0; j < 64; j++) { showrun( j ); q = (j % 2) == 0 ? 0xFFFFFFFF : 0x00000000; p1 = (volatile u32 *) bp1; p2 = (volatile u32 *) bp2; for (i = 0; i < count; i++) { showadr( p1 ); MEM( p1++ ) = MEM( p2++ ) = (i % 2) == 0 ? q : ~q; barrier(); } if (test_verify_success (bp1, bp2, count) == CHKMEM_ERR) { return (CHKMEM_ERR); } } return (CHKMEM_OK); } int test_checkerboard_comparison (u32 *bp1, u32 *bp2, u32 count) { volatile u32 *p1 = (volatile u32 *) bp1; volatile u32 *p2 = (volatile u32 *) bp2; u32 q, i, j; SHOWFUNC(); for (j = 0; j < 64; j++) { showrun( j ); q = (j % 2) == 0 ? 0x55555555 : 0xAAAAAAAA; p1 = (volatile u32 *) bp1; p2 = (volatile u32 *) bp2; for (i = 0; i < count; i++) { showadr( p1 ); MEM( p1++ ) = MEM( p2++ ) = (i % 2) == 0 ? q : ~q; barrier(); } if (test_verify_success (bp1, bp2, count) == CHKMEM_ERR) { return (CHKMEM_ERR); } } return (CHKMEM_OK); } int test_blockseq_comparison (u32 *bp1, u32 *bp2, u32 count) { volatile u32 *p1 = (volatile u32 *) bp1; volatile u32 *p2 = (volatile u32 *) bp2; u32 i, j; SHOWFUNC(); for (j = 0; j < 256; j++) { showrun( j ); p1 = (volatile u32 *) bp1; p2 = (volatile u32 *) bp2; for (i = 0; i < count; i++) { showadr( p1 ); MEM( p1++ ) = MEM( p2++ ) = MAKE32FROM8 (j); barrier(); } if (test_verify_success (bp1, bp2, count) == CHKMEM_ERR) { return (CHKMEM_ERR); } } return (CHKMEM_OK); } int test_walkbits_comparison (u32 *bp1, u32 *bp2, u32 count, int m) { volatile u32 *p1 = (volatile u32 *) bp1; volatile u32 *p2 = (volatile u32 *) bp2; u32 i, j; SHOWFUNC(); for (j = 0; j < 64; j++) { showrun( j ); p1 = (volatile u32 *) bp1; p2 = (volatile u32 *) bp2; for (i = 0; i < count; i++) { if (j < 32) /* Walk it up. */ { showadr( p1 ); MEM( p1++ ) = MEM( p2++ ) = (m == 0) ? 0x00000001 << j : 0xFFFFFFFF ^ (0x00000001 << j); barrier(); } else /* Walk it back down. */ { MEM( p1++ ) = MEM( p2++ ) = (m == 0) ? 0x00000001 << (64 - j - 1) : 0xFFFFFFFF ^ (0x00000001 << (64 - j - 1)); barrier(); } } if (test_verify_success (bp1, bp2, count) == CHKMEM_ERR) { return (CHKMEM_ERR); } } return (CHKMEM_OK); } int test_bitspread_comparison (u32 *bp1, u32 *bp2, u32 count) { volatile u32 *p1 = (volatile u32 *) bp1; volatile u32 *p2 = (volatile u32 *) bp2; u32 i, j; SHOWFUNC(); for (j = 0; j < 64; j++) { showrun( j ); p1 = (volatile u32 *) bp1; p2 = (volatile u32 *) bp2; for (i = 0; i < count; i++) { showadr( p1 ); if (j < 32) /* Walk it up. */ { MEM( p1++ ) = MEM( p2++ ) = (i % 2 == 0) ? (0x00000001 << j) | (0x00000001 << (j + 2)) : 0xFFFFFFFF ^ ((0x00000001 << j) | (0x00000001 << (j + 2))); barrier(); } else /* Walk it back down. */ { MEM( p1++ ) = MEM( p2++ ) = (i % 2 == 0) ? (0x00000001 << (63 - j)) | (0x00000001 << (65 - j)) : 0xFFFFFFFF ^ (0x00000001 << (63 - j) | (0x00000001 << (65 - j))); barrier(); } } if (test_verify_success (bp1, bp2, count) == CHKMEM_ERR) { return (CHKMEM_ERR); } } return (CHKMEM_OK); } int test_bitflip_comparison (u32 *bp1, u32 *bp2, u32 count) { volatile u32 *p1 = (volatile u32 *) bp1; volatile u32 *p2 = (volatile u32 *) bp2; u32 i, j, k; u32 q; SHOWFUNC(); for (k = 0; k < 32; k++) { showrun( k*8 ); q = 0x00000001 << k; for (j = 0; j < 8; j++) { q = ~q; p1 = (volatile u32 *) bp1; p2 = (volatile u32 *) bp2; for (i = 0; i < count; i++) { showadr( p1 ); MEM( p1++ ) = MEM( p2++ ) = (i % 2) == 0 ? q : ~q; barrier(); } if (test_verify_success (bp1, bp2, count) == CHKMEM_ERR) { return (CHKMEM_ERR); } } } return (CHKMEM_OK); } int test_stuck_address (u32 *bp1, u32 *bp2, u32 count) { volatile u32 *p1; /* second argument is not used; just gives it a compatible signature. */ u32 i, j; SHOWFUNC(); count <<= 1; for (j = 0; j < 16; j++) { showrun( j ); p1 = (volatile u32 *) bp1; for (i = 0; i < count; i++) { showadr( p1 ); MEM( p1++ ) = ((j + i) % 2) == 0 ? (u32) p1 : ~((u32) p1); barrier(); } p1 = (volatile u32 *) bp1; for (i = 0; i < count; i++, p1++) { showadr( p1 ); if (*p1 != (((j + i) % 2) == 0 ? (u32) p1 : ~((u32) p1))) { return (CHKMEM_ERR); } } } return (CHKMEM_OK); } --- NEW FILE: clock.c --- /*------------------------------------------------------------------------- * Filename: clock.c * Version: $Id: clock.c,v 1.1 2001/10/07 19:04:25 erikm Exp $ * Copyright: Copyright (C) 2000, Johan Pouwelse * Author: Johan Pouwelse <pou...@tw...> * Description: Clock switching functions * Created at: Sat Mar 25 14:11:22 2000 * Modified by: Erik Mouw <J.A...@it...> * Modified at: Sat Mar 25 14:12:42 2000 *-----------------------------------------------------------------------*/ /* * clock.c: Utility to set clock speed and DRAM parameters * * Copyright (C) 2000 Johan Pouwelse (pou...@tw...) * * 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: clock.c,v 1.1 2001/10/07 19:04:25 erikm Exp $" #ifdef HAVE_CONFIG_H # include "config.h" #endif #include "command.h" #include "errno.h" #include "error.h" #include "types.h" #include "sa1100.h" #include "serial.h" #include "time.h" #include "util.h" /* Struct with the SA-1100 PLL + DRAM parameter registers */ enum { SA_PPCR, SA_MDCNFG, SA_MDCAS0, SA_MDCAS1, SA_MDCAS2 }; int SetClock(int argc, char *argv[]) { int i; u32 regs[5]; u32 startTime, currentTime; if(argc < 6) return -ENOPARAMS; for(i = 0; i < 5; i++) { if(strtoval(argv[i + 1], ®s[i]) < 0) { printerror(ENAN, argv[i + 1]); return 0; } } /* we go slower, so first set PLL register */ PPCR = regs[SA_PPCR]; MDCNFG = regs[SA_MDCNFG]; MDCAS0 = regs[SA_MDCAS0]; MDCAS1 = regs[SA_MDCAS1]; MDCAS2 = regs[SA_MDCAS2]; /* sleep for a second */ startTime = TimerGetTime(); for(;;) { currentTime = TimerGetTime(); if((currentTime - startTime) > (u32)TICKS_PER_SECOND) return 0; } } /* SetClock */ static char clockhelp[] = "clock PPCR MDCNFG MDCAS0 MDCAS1 MDCAS2\n" "Set the SA1100 core clock and DRAM timings\n" "WARNING: dangerous command!\n"; __commandlist(SetClock, "clock", clockhelp); --- NEW FILE: debug.c --- /* * debug.c: Debugging command functions * * Copyright (C) 2001 Stefan Eletzhofer <ste...@ww...> * * 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: debug.c,v 1.1 2001/10/07 19:04:25 erikm Exp $" /********************************************************************** * Includes */ #ifdef HAVE_CONFIG_H # include "config.h" #endif #include "errno.h" #include "error.h" #include "types.h" #include "util.h" #include "serial.h" #include "command.h" /********************************************************************** * defines */ /* this will send a cold shiver through erik's spine ... */ #define ERR( x ) { ret = x; goto DONE; } /* more readable IMHO */ #define MEM( x ) (*((u32 *)x)) /********************************************************************** * program globals */ /********************************************************************** * module globals */ /********************************************************************** * prototypes */ void perror( int errno, char *func ) { printerrprefix(); if ( errno < 0 ) errno = -errno; if ( func != NULL) { SerialOutputString(func); SerialOutputString(": "); } SerialOutputString(strerror(errno)); SerialOutputByte('\n'); } /********************************************************************** * exported functions */ /********************************************************************** * static functions */ /********************************************************************* * CmdMemcpy * * AUTOR: SELETZ * REVISED: * * Command wrapper for memcpy utility function. * */ static int CmdMemcpy( int argc, char *argv[] ) { int ret = 0; u32 src = 0L; u32 dest = 0L; u32 len = 0L; if ( argc < 4 ) ERR( -EINVAL ); ret = strtoval( argv[1], &src ); if ( ret < 0 ) ERR( -EINVAL ); ret = strtoval( argv[2], &dest ); if ( ret < 0 ) ERR( -EINVAL ); ret = strtoval( argv[3], &len ); if ( ret < 0 ) ERR( -EINVAL ); /* counted in words */ if ( len & 0x00000003 ) { len = ( len >> 2 ) + 1; } else { len = len >> 2; } SerialOutputString("\n### Now copying 0x"); SerialOutputHex(len); SerialOutputString(" words from 0x"); SerialOutputHex((int)src); SerialOutputString(" to 0x"); SerialOutputHex((int)dest); SerialOutputByte('\n'); MyMemCpy( (u32 *)dest, (const u32 *)src, len); SerialOutputString(" done\n"); ret = 0; DONE: if ( ret != 0 ) { perror( ret, __FUNCTION__ ); } return ret; } static char memcpyhelp[] = "memcpy [source] [dest] [len]\n" "copy memory blocks\n"; __commandlist(CmdMemcpy, "memcpy", memcpyhelp); /********************************************************************* * Poke * * AUTOR: Stefan Eletzhofer * REVISED: * * Poke values to memory * */ int Poke( int argc, char *argv[] ) { int ret = 0; u32 address; u32 value; if ( argc < 3 ) ERR( -EINVAL ); ret = strtoval(argv[1], &address); if ( ret < 0 ) ERR( -EINVAL ); ret = strtoval(argv[2], &value); if ( ret < 0 ) ERR( -EINVAL ); #if CHKMEM_DEBUG SerialOutputString("adr=0x"); SerialOutputHex(address); SerialOutputString(" val=0x"); SerialOutputHex(value); SerialOutputString("\n"); #endif MEM( address ) = value; ret = 0; DONE: if ( ret != 0 ) { perror( ret, __FUNCTION__ ); } return ret; } static char pokehelp[] = "poke address value\n"; __commandlist(Poke, "poke", pokehelp ); /********************************************************************* * Peek * * AUTOR: Stefan Eletzhofer * REVISED: * * Poke values to memory * */ int Peek( int argc, char *argv[] ) { int ret = 0; u32 address; u32 value; if ( argc < 2 ) ERR( -EINVAL ); ret = strtoval(argv[1], &address); if ( ret < 0 ) ERR( -EINVAL ); #if CHKMEM_DEBUG SerialOutputString("adr=0x"); SerialOutputHex(address); SerialOutputString("\n"); #endif value = MEM( address ); SerialOutputHex(value); SerialOutputString("\n"); ret = 0; DONE: if ( ret != 0 ) { perror( ret, __FUNCTION__ ); } return ret; } static char peekhelp[] = "peek address\n"; __commandlist(Peek, "peek", peekhelp ); /********************************************************************* * BitChange * * AUTOR: SELETZ * REVISED: * * Modifies bits of an given memory location * */ int BitChange( int argc, char *argv[] ) { int ret = 0; u32 adr = 0L; u32 value = 0L; if ( argc < 4 ) ERR( -EINVAL ); ret = strtoval( argv[1], &adr ); if ( ret < 0 ) ERR( -EINVAL ); ret = strtoval( argv[2], &value ); if ( ret < 0 ) ERR( -EINVAL ); SerialOutputHex( MEM( adr ) ); switch ( argv[3][0] & (~0x20) ) { case 'A': MEM( adr ) &= value; break; case 'S': case 'O': MEM( adr ) |= value; break; case 'X': MEM( adr ) ^= value; break; case 'C': MEM( adr ) &= ~value; break; default: ERR( -EINVAL ); break; } SerialOutputString( "->" ); SerialOutputHex( MEM( adr ) ); SerialOutputString( "\n" ); ret = 0; DONE: if ( ret != 0 ) { perror( ret, __FUNCTION__ ); } return ret; } static char bitchghelp[] = "bitchg address value {and|or|xor|set|clear}\n"; __commandlist(BitChange, "bitchg", bitchghelp ); --- NEW FILE: flash.c --- /*------------------------------------------------------------------------- * Filename: flash.c * Version: $Id: flash.c,v 1.1 2001/10/07 19:04:25 erikm Exp $ * Copyright: Copyright (C) 1999, Jan-Derk Bakker * Author: Jan-Derk Bakker <J.D...@it...> * Description: Flash I/O functions for blob * Created at: Mon Aug 23 20:00:00 1999 * Modified by: Erik Mouw <J.A...@it...> * Modified at: Sat Jan 15 19:16:34 2000 *-----------------------------------------------------------------------*/ /* * flash.c: Flash I/O functions for blob * * Copyright (C) 1999 Jan-Derk Bakker (J.D...@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 * 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: flash.c,v 1.1 2001/10/07 19:04:25 erikm Exp $" #ifdef HAVE_CONFIG_H # include "config.h" #endif #include "errno.h" #include "error.h" #include "led.h" #include "main.h" #include "util.h" #include "serial.h" #include "flash.h" /* define for advanced flash functionality (not that it works) -- Erik */ /* #define ADVANCED_FLASH 1 */ /* Static function defs */ static u32 EraseOne(const char *whichOne); #ifdef ADVANCED_FLASH static void GetBlockOrder(tBlkInfo *blocksInfo, u8 which, u8 blockOrder[NUM_FLASH_BLOCKS]); #endif #ifdef ADVANCED_FLASH void ScanFlash(tBlkInfo *blocksInfo) { /* Scans the flash for headers in the main blocks. Maybe in the future we will put the headers in one of the parameter blocks. */ int i,j; j = 0; for(i = 0; i < NUM_FLASH_BLOCKS; i++) { MyMemCpy((u32 *) &(blocksInfo->headers[i]), FLASH_BLOCK_BASE + i * FLASH_BLOCK_SIZE, sizeof(tBlkHdr) / 4); /* Is this a 'first' block ? */ if(BLOCK_IN_USE(blocksInfo->headers[i]) && (blocksInfo->headers[i].seqNum == 0)) blocksInfo->firstBlockIndex[j++] = i; } for(; j < NUM_FLASH_BLOCKS; j++) blocksInfo->firstBlockIndex[j] = NO_BLOCK; } /* ScanFlash */ #endif #ifdef ADVANCED_FLASH void LoadBlocksToMem(tBlkInfo *blocksInfo, u8 which, u32 *baseAddr) { /* Load a series of blocks to memory */ u8 blockOrder[NUM_FLASH_BLOCKS]; int numBlocks = blocksInfo->headers[which].totSeq; int i; u32 *srcAddr, *dstAddr = baseAddr; /* If the block isn't in use, fail silently. */ if(!BLOCK_IN_USE(blocksInfo->headers[which])) return; GetBlockOrder(blocksInfo, which, blockOrder); for(i = 0; i < numBlocks; i++) { srcAddr = FLASH_BLOCK_BASE + blockOrder[i] * FLASH_BLOCK_SIZE + sizeof(tBlkHdr); MyMemCpy(dstAddr, srcAddr, blocksInfo->headers[i].bytesInBlock / 4); dstAddr += blocksInfo->headers[i].bytesInBlock / 4; } } /* LoadBlocksToMem */ #endif /* The spooky functions that write to the same flash that we're executing from */ u32 data_from_flash(u32 what); u32 data_to_flash(u32 what); #if defined SHANNON || defined NESA #define READ_ARRAY 0x00F000F0 #define UNLOCK1 0x00AA00AA #define UNLOCK2 0x00550055 #define ERASE_SETUP 0x00800080 #define ERASE_CONFIRM 0x00300030 #define PGM_SETUP 0x00A000A0 #define UNLOCK_BYPASS 0x00200020 #define FLASH_ADDR1 (0x00000555 << 2) #define FLASH_ADDR2 (0x000002AA << 2) #define ERASE_DONE 0x00800080 #define RDY_MASK 0x00800080 #define STATUS_PGM_ERR 0x00200020 #define STATUS_ERASE_ERR 0x00000001 #else #define READ_ARRAY 0x00FF00FF #define ERASE_SETUP 0x00200020 #define ERASE_CONFIRM 0x00D000D0 #define PGM_SETUP 0x00400040 #define STATUS_READ 0x00700070 #define STATUS_CLEAR 0x00500050 #define STATUS_BUSY 0x00800080 #define STATUS_ERASE_ERR 0x00200020 #define STATUS_PGM_ERR 0x00100010 #endif void EraseBlocks(tBlockType which) { char *thisBlock; int numBlocks, i; switch(which) { case blBlob: thisBlock = (char *)BLOB_START; numBlocks = NUM_BLOB_BLOCKS; break; #ifdef PARAM_START case blParam: thisBlock = (char *)PARAM_START; numBlocks = NUM_PARAM_BLOCKS; break; #endif case blKernel: thisBlock = (char *)KERNEL_START; numBlocks = NUM_KERNEL_BLOCKS; break; case blRamdisk: thisBlock = (char *)INITRD_START; numBlocks = NUM_INITRD_BLOCKS; break; default: /* this should not happen */ return; } for(i = 0; i < numBlocks; i++, thisBlock += MAIN_BLOCK_SIZE) { SerialOutputByte('.'); led_toggle(); if((EraseOne(thisBlock) & STATUS_ERASE_ERR) != 0) { printerrprefix(); SerialOutputString("erase error at address 0x"); SerialOutputHex((u32)thisBlock); SerialOutputByte('\n'); return; } } } /* EraseBlocks */ void WriteBlocksFromMem(tBlockType type, const u32 *source, int length) { volatile u32 *flashBase; u32 result; int maxLength, i; #if defined SHANNON || defined NESA #define READY 1 #define ERR 2 int chip1, chip2; #endif if((u32)source & 0x03) { printerror(EALIGN, NULL); #ifdef BLOB_DEBUG printerrprefix(); SerialOutputString("Address = 0x"); SerialOutputHex((u32)source); SerialOutputByte('\n'); #endif return; } if(length & 0x03) length += 0x04; length &= ~((u32) 0x03); switch(type) { case blBlob: flashBase = (u32 *)BLOB_START; maxLength = BLOB_LEN; break; #ifdef PARAM_START case blParam: flashBase = (u32 *)PARAM_START; maxLength = PARAM_LEN; break; #endif case blKernel: flashBase = (u32 *)KERNEL_START; maxLength = KERNEL_LEN; break; case blRamdisk: flashBase = (u32 *)INITRD_START; maxLength = INITRD_LEN; break; default: /* this should not happen */ return; } if(length > maxLength) length = maxLength; #ifdef BLOB_DEBUG SerialOutputString(__FUNCTION__ "(): Flashing 0x"); SerialOutputHex((u32)length); SerialOutputString(" bytes from 0x"); SerialOutputHex((u32)source); SerialOutputString(" to 0x"); SerialOutputHex((u32)flashBase); SerialOutputByte('\n'); #endif #if defined SHANNON || defined NESA *(u32 *)FLASH_ADDR1 = data_to_flash(UNLOCK1); *(u32 *)FLASH_ADDR2 = data_to_flash(UNLOCK2); *(u32 *)FLASH_ADDR1 = data_to_flash(UNLOCK_BYPASS); #endif for(i = 0; i < length; i+= 4, flashBase++, source++) { if((i % MAIN_BLOCK_SIZE) == 0) { SerialOutputByte('.'); led_toggle(); } *flashBase = data_to_flash(PGM_SETUP); *flashBase = *source; #if defined SHANNON || defined NESA /* This is a pretty similar situation to the erasing status below * Bit 7 is ~(data bit 7) until the flash is complete. If bit 5 * gets set before this happens, there is an error, but this could * happen near the clock edge, and bit 5 could be the actual data * before bit 7 changes, so we have to read again. */ chip1 = chip2 = 0; do { result = data_from_flash(*flashBase); if (!chip1 && ((result & 0x80) == (*source & 0x80))) chip1 = READY; if (!chip1 && ((result & 0xFFFF) & STATUS_PGM_ERR)) { result = data_from_flash(*flashBase); if ((result & 0x80) == (*source & 0x80)) chip1 = READY; else chip1 = ERR; } if (!chip2 && ((result & (0x80 << 16)) == (*source & (0x80 << 16)))) chip2 = READY; if (!chip2 && ((result >> 16) & STATUS_PGM_ERR)) { result = data_from_flash(*flashBase); if ((result & (0x80 << 16)) == (*source & (0x80 << 16))) chip2 = READY; else chip2 = ERR; } } while (!chip1 || !chip2); if (chip1 == ERR || chip2 == ERR || *flashBase != *source) { #else do { *flashBase = data_to_flash(STATUS_READ); result = data_from_flash(*flashBase); } while((~result & STATUS_BUSY) != 0); *flashBase = data_to_flash(READ_ARRAY); if((result & STATUS_PGM_ERR) != 0 || *flashBase != *source) { #endif printerrprefix(); SerialOutputString("Write error at address 0x"); SerialOutputHex((u32)flashBase); SerialOutputByte('\n'); return; } } #if defined SHANNON || defined NESA *(u32 *)FLASH_ADDR1 = data_to_flash(READ_ARRAY); #endif } /* WriteBlocksFromMem */ static u32 EraseOne(const char *whichOne) { /* Routine to erase one block of flash */ volatile u32 *writeMe = (u32 *)whichOne; u32 result; #if defined SHANNON || defined NESA int chip1, chip2; #endif #ifdef BLOB_DEBUG SerialOutputString(__FUNCTION__ "(): erasing block at address 0x"); SerialOutputHex((u32)whichOne); SerialOutputByte('\n'); #endif #if defined SHANNON || defined NESA *(u32 *)FLASH_ADDR1 = data_to_flash(UNLOCK1); *(u32 *)FLASH_ADDR2 = data_to_flash(UNLOCK2); *(u32 *)FLASH_ADDR1 = data_to_flash(ERASE_SETUP); *(u32 *)FLASH_ADDR1 = data_to_flash(UNLOCK1); *(u32 *)FLASH_ADDR2 = data_to_flash(UNLOCK2); *writeMe = data_to_flash(ERASE_CONFIRM); /* I just can't find clean ways of dealing with this flash... * The error bit is a *set* bit, so if its read, and bit 7 is 0, * but bit 5 is 1, its an error, however, after these status reads * are done, erased flash goes to 0xff...sooo...each chip has to * be caught where the bits are the status bits */ chip1 = chip2 = 0; do { result = data_from_flash(*writeMe); if (!chip1 && (result & 0xFFFF) & ERASE_DONE) chip1 = READY; if (!chip1 && (result & 0xFFFF) & STATUS_PGM_ERR) chip1 = ERR; if (!chip2 && (result >> 16) & ERASE_DONE) chip2 = READY; if (!chip2 && (result >> 16) & STATUS_PGM_ERR) chip2 = ERR; } while(!chip1 || !chip2); *(u32 *)FLASH_ADDR1 = data_to_flash(READ_ARRAY); if (chip1 == ERR || chip2 == ERR) return 1; return 0; #else *writeMe = data_to_flash(ERASE_SETUP); *writeMe = data_to_flash(ERASE_CONFIRM); do { *writeMe = data_to_flash(STATUS_READ); result = data_from_flash(*writeMe); } while((~result & STATUS_BUSY) != 0); *writeMe = data_to_flash(READ_ARRAY); return result; #endif } /* EraseOne */ #ifdef ADVANCED_FLASH static void GetBlockOrder(tBlkInfo *blocksInfo, u8 which, u8 blockOrder[NUM_FLASH_BLOCKS]) { tBlockType type = blocksInfo->headers[which].type; char *name = blocksInfo->headers[which].name; int i; /* If the block isn't in use, fail silently. */ if(!BLOCK_IN_USE(blocksInfo->headers[which])) return; for(i = 0; i < NUM_FLASH_BLOCKS; i++) { if(BLOCK_IN_USE(blocksInfo->headers[i]) && (blocksInfo->headers[i].type == type) && !MyStrNCmp(blocksInfo->headers[i].name, name, BLOCK_NAME_LEN)) { blockOrder[blocksInfo->headers[i].seqNum] = i; } } } /* GetBlockOrder */ #endif --- NEW FILE: flashasm.S --- /* * flashasm.S: flash magic for LART * * Copyright (C) 1999 2000 2001 Jan-Derk bakker (J.D...@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 * 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: flashasm.S,v 1.1 2001/10/07 19:04:25 erikm Exp $" #ifdef HAVE_CONFIG_H # include <config.h> #endif .text .globl data_to_flash .globl data_from_flash /* Subroutine that takes data in r0 and formats it so it will be in */ /* the correct order for the internal flash */ /* used for LART only */ data_to_flash: #if defined LART mov r1, #0x0 tst r0, #0x00000001 orrne r1, r1, #0x00001000 tst r0, #0x00000002 orrne r1, r1, #0x00004000 tst r0, #0x00000004 orrne r1, r1, #0x00000800 tst r0, #0x00000008 orrne r1, r1, #0x00000200 tst r0, #0x00000010 orrne r1, r1, #0x00000001 tst r0, #0x00000020 orrne r1, r1, #0x00000004 tst r0, #0x00000040 orrne r1, r1, #0x00000080 tst r0, #0x00000080 orrne r1, r1, #0x00000020 tst r0, #0x00000100 orrne r1, r1, #0x00002000 tst r0, #0x00000200 orrne r1, r1, #0x00008000 tst r0, #0x00000400 orrne r1, r1, #0x00000400 tst r0, #0x00000800 orrne r1, r1, #0x00000100 tst r0, #0x00001000 orrne r1, r1, #0x00000002 tst r0, #0x00002000 orrne r1, r1, #0x00000008 tst r0, #0x00004000 orrne r1, r1, #0x00000040 tst r0, #0x00008000 orrne r1, r1, #0x00000010 tst r0, #0x00010000 orrne r1, r1, #0x00100000 tst r0, #0x00020000 orrne r1, r1, #0x00400000 tst r0, #0x00040000 orrne r1, r1, #0x00080000 tst r0, #0x00080000 orrne r1, r1, #0x00020000 tst r0, #0x00100000 orrne r1, r1, #0x01000000 tst r0, #0x00200000 orrne r1, r1, #0x04000000 tst r0, #0x00400000 orrne r1, r1, #0x80000000 tst r0, #0x00800000 orrne r1, r1, #0x20000000 tst r0, #0x01000000 orrne r1, r1, #0x00200000 tst r0, #0x02000000 orrne r1, r1, #0x00800000 tst r0, #0x04000000 orrne r1, r1, #0x00040000 tst r0, #0x08000000 orrne r1, r1, #0x00010000 tst r0, #0x10000000 orrne r1, r1, #0x02000000 tst r0, #0x20000000 orrne r1, r1, #0x08000000 tst r0, #0x40000000 orrne r1, r1, #0x40000000 tst r0, #0x80000000 orrne r1, r1, #0x10000000 mov r0, r1 #endif mov pc, r14 /* Takes data received from the flash, and unshuffles it. */ data_from_flash: #if defined LART mov r1, #0x00 tst r0, #0x00000001 orrne r1, r1, #0x00000010 tst r0, #0x00000002 orrne r1, r1, #0x00001000 tst r0, #0x00000004 orrne r1, r1, #0x00000020 tst r0, #0x00000008 orrne r1, r1, #0x00002000 tst r0, #0x00000010 orrne r1, r1, #0x00008000 tst r0, #0x00000020 orrne r1, r1, #0x00000080 tst r0, #0x00000040 orrne r1, r1, #0x00004000 tst r0, #0x00000080 orrne r1, r1, #0x00000040 tst r0, #0x00000100 orrne r1, r1, #0x00000800 tst r0, #0x00000200 orrne r1, r1, #0x00000008 tst r0, #0x00000400 orrne r1, r1, #0x00000400 tst r0, #0x00000800 orrne r1, r1, #0x00000004 tst r0, #0x00001000 orrne r1, r1, #0x00000001 tst r0, #0x00002000 orrne r1, r1, #0x00000100 tst r0, #0x00004000 orrne r1, r1, #0x00000002 tst r0, #0x00008000 orrne r1, r1, #0x00000200 tst r0, #0x00010000 orrne r1, r1, #0x08000000 tst r0, #0x00020000 orrne r1, r1, #0x00080000 tst r0, #0x00040000 orrne r1, r1, #0x04000000 tst r0, #0x00080000 orrne r1, r1, #0x00040000 tst r0, #0x00100000 orrne r1, r1, #0x00010000 tst r0, #0x00200000 orrne r1, r1, #0x01000000 tst r0, #0x00400000 orrne r1, r1, #0x00020000 tst r0, #0x00800000 orrne r1, r1, #0x02000000 tst r0, #0x01000000 orrne r1, r1, #0x00100000 tst r0, #0x02000000 orrne r1, r1, #0x10000000 tst r0, #0x04000000 orrne r1, r1, #0x00200000 tst r0, #0x08000000 orrne r1, r1, #0x20000000 tst r0, #0x10000000 orrne r1, r1, #0x80000000 tst r0, #0x20000000 orrne r1, r1, #0x00800000 tst r0, #0x40000000 orrne r1, r1, #0x40000000 tst r0, #0x80000000 orrne r1, r1, #0x00400000 mov r0, r1 #endif mov pc, r14 --- NEW FILE: linux.c --- /* * linux.c: support functions for booting a kernel * * Copyright (C) 2001 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 * 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: linux.c,v 1.1 2001/10/07 19:04:25 erikm Exp $" #ifdef HAVE_CONFIG_H # include "config.h" #endif #include "linux.h" #include "command.h" #include "main.h" #include "flash.h" #include "init.h" #include "memory.h" #include "serial.h" #include "util.h" #include <asm-arm/setup.h> static void setup_start_tag(void); static void setup_memory_tags(void); static void setup_commandline_tag(int argc, char *argv[]); static void setup_ramdisk_tag(void); static void setup_initrd_tag(void); static void setup_end_tag(void); static struct tag *params; static int boot_linux(int argc, char *argv[]) { register u32 i; void (*theKernel)(int zero, int arch) = (void (*)(int, int))KERNEL_RAM_BASE; setup_start_tag(); setup_memory_tags(); setup_commandline_tag(argc, argv); setup_initrd_tag(); setup_ramdisk_tag(); setup_end_tag(); /* we assume that the kernel is in place */ SerialOutputString("\nStarting kernel ...\n\n"); /* disable subsystems that want to be disabled before kernel boot */ exit_subsystems(); /* start kernel */ theKernel(0, ARCH_NUMBER); SerialOutputString("Hey, the kernel returned! This should not happen.\n"); return 0; } static char boothelp[] = "boot [kernel options]\n" "Boot Linux with optional kernel options\n"; __commandlist(boot_linux, "boot", boothelp); static void setup_start_tag(void) { params = (struct tag *)BOOT_PARAMS; params->hdr.tag = ATAG_CORE; params->hdr.size = tag_size(tag_core); params->u.core.flags = 0; params->u.core.pagesize = 0; params->u.core.rootdev = 0; params = tag_next(params); } static void setup_memory_tags(void) { int i; for(i = 0; i < NUM_MEM_AREAS; i++) { if(memory_map[i].used) { params->hdr.tag = ATAG_MEM; params->hdr.size = tag_size(tag_mem32); params->u.mem.start = memory_map[i].start; params->u.mem.size = memory_map[i].len; params = tag_next(params); } } } static void setup_commandline_tag(int argc, char *argv[]) { char *p; int i; /* initialise commandline */ params->u.cmdline.cmdline[0] = '\0'; /* copy default commandline from parameter block */ if(blob_status.cmdline[0] != '\0') strcpy(params->u.cmdline.cmdline, blob_status.cmdline); /* copy commandline */ if(argc >= 2) { p = params->u.cmdline.cmdline; for(i = 1; i < argc; i++) { strcpy(p, argv[i]); p += strlen(argv[i]); *p++ = ' '; } p--; *p = '\0'; } if(strlen(params->u.cmdline.cmdline) > 0) { params->hdr.tag = ATAG_CMDLINE; params->hdr.size = (sizeof(struct tag_header) + strlen(params->u.cmdline.cmdline) + 1 + 4) >> 2; params = tag_next(params); } } static void setup_initrd_tag(void) { /* an ATAG_INITRD node tells the kernel where the compressed * ramdisk can be found. ATAG_RDIMG is a better name, actually. */ params->hdr.tag = ATAG_INITRD; params->hdr.size = tag_size(tag_initrd); params->u.initrd.start = RAMDISK_RAM_BASE; params->u.initrd.size = INITRD_LEN; params = tag_next(params); } static void setup_ramdisk_tag(void) { /* an ATAG_RAMDISK node tells the kernel how large the * decompressed ramdisk will become. */ params->hdr.tag = ATAG_RAMDISK; params->hdr.size = tag_size(tag_ramdisk); params->u.ramdisk.start = 0; params->u.ramdisk.size = RAMDISK_SIZE; params->u.ramdisk.flags = 1; /* automatically load ramdisk */ params = tag_next(params); } static void setup_end_tag(void) { params->hdr.tag = ATAG_NONE; params->hdr.size = 0; } --- NEW FILE: main.c --- /*------------------------------------------------------------------------- * Filename: main.c * Version: $Id: main.c,v 1.1 2001/10/07 19:04:25 erikm Exp $ * Copyright: Copyright (C) 1999, Jan-Derk Bakker * Author: Jan-Derk Bakker <J.D...@it...> * Description: Main file for the trivially simple bootloader for the * LART boards * Created at: Mon Aug 23 20:00:00 1999 * Modified by: Erik Mouw <J.A...@it...> * Modified at: Sat Mar 25 14:31:16 2000 *-----------------------------------------------------------------------*/ /* * main.c: main file for the blob bootloader * * Copyright (C) 1999 2000 2001 * Jan-Derk Bakker (J.D...@it...) and * 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 * 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: main.c,v 1.1 2001/10/07 19:04:25 erikm Exp $" #ifdef HAVE_CONFIG_H # include "config.h" #endif #include "command.h" #include "errno.h" #include "error.h" #include "flash.h" #include "init.h" #include "led.h" #include "main.h" #include "memory.h" #include "param_block.h" #include "sa1100.h" #include "serial.h" #include "time.h" #include "util.h" #include "uucodec.h" static int do_reload(char *what); static void PrintSerialSpeed(eBauds speed); blob_status_t blob_status; int main(void) { u32 blockSize = 0x00800000; int numRead = 0; char commandline[MAX_COMMANDLINE_LENGTH]; int i; int retval = 0; u32 conf; /* call subsystems */ init_subsystems(); /* initialise status */ blob_status.paramSize = 0; blob_status.paramType = fromFlash; blob_status.kernelSize = 0; blob_status.kernelType = fromFlash; blob_status.ramdiskSize = 0; blob_status.ramdiskType = fromFlash; blob_status.blockSize = blockSize; blob_status.downloadSpeed = baud115k2; blob_status.terminalSpeed = baud9k6; blob_status.load_ramdisk = 1; blob_status.cmdline[0] = '\0'; blob_status.boot_delay = 10; /* call SerialInit() because the default 9k6 speed might not be what the user requested */ SerialInit(blob_status.terminalSpeed); /* parse the core tag, for critical things like terminal speed */ #ifdef PARAM_START parse_ptag((void *) PARAM_START, &conf); #endif /* Print the required GPL string */ SerialOutputString("\nConsider yourself LARTed!\n\n"); SerialOutputString(PACKAGE " version " VERSION "\n" "Copyright (C) 1999 2000 2001 " "Jan-Derk Bakker and Erik Mouw\n"); SerialOutputString(PACKAGE " comes with ABSOLUTELY NO WARRANTY; " "read the GNU GPL for details.\n"); SerialOutputString("This is free software, and you are welcome " "to redistribute it\n"); SerialOutputString("under certain conditions; " "read the GNU GPL for details.\n"); /* get the amount of memory */ get_memory_map(); /* Parse all the tags in the paramater block */ #ifdef PARAM_START parse_ptags((void *) PARAM_START, &conf); #endif /* Load kernel and ramdisk from flash to RAM */ do_reload("blob"); do_reload("kernel"); if(blob_status.load_ramdisk) do_reload("ramdisk"); #ifdef BLOB_DEBUG /* print some information */ SerialOutputString("Running from "); if(RunningFromInternal()) SerialOutputString("internal"); else SerialOutputString("external"); SerialOutputString(" flash, blockSize = 0x"); SerialOutputHex(blockSize); SerialOutputByte('\n'); #endif /* 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('.'); retval = SerialInputBlock(commandline, 1, 1); if(retval > 0) break; } /* no key was pressed, so proceed booting the kernel */ if(retval == 0) { commandline[0] = '\0'; parse_command("boot"); } SerialOutputString("\nAutoboot aborted\n"); SerialOutputString("Type \"help\" to get a list of commands\n"); /* the command loop. endless, of course */ for(;;) { DisplayPrompt(NULL); /* wait 10 minutes for a command */ numRead = GetCommand(commandline, MAX_COMMANDLINE_LENGTH, 600); if(numRead > 0) { if((retval = parse_command(commandline)) < 0 ) printerror(retval, NULL); } } return 0; } /* main */ static int Download(int argc, char *argv[]) { u32 startAddress = 0; int bufLen; int *numRead = 0; int retval; if(argc < 2) return -ENOPARAMS; if(strncmp(argv[1], "blob", 4) == 0) { /* download blob */ startAddress = BLOB_RAM_BASE; bufLen = blob_status.blockSize - BLOB_BLOCK_OFFSET; numRead = &blob_status.blobSize; blob_status.blobType = fromDownload; #ifdef PARAM_START } else if(strncmp(argv[1], "param", 5) == 0) { /* download kernel */ startAddress = PARAM_RAM_BASE; bufLen = PARAM_LEN; numRead = &blob_status.paramSize; blob_status.paramType = fromDownload; #endif } else if(strncmp(argv[1], "kernel", 6) == 0) { /* download kernel */ startAddress = KERNEL_RAM_BASE; bufLen = blob_status.blockSize - KERNEL_BLOCK_OFFSET; numRead = &blob_status.kernelSize; blob_status.kernelType = fromDownload; } else if(strncmp(argv[1], "ramdisk", 7) == 0) { /* download ramdisk */ startAddress = RAMDISK_RAM_BASE; bufLen = blob_status.blockSize - RAMDISK_BLOCK_OFFSET; numRead = &blob_status.ramdiskSize; blob_status.ramdiskType = fromDownload; } else { printerror(EINVAL, argv[1]); return 0; } SerialOutputString("Switching to "); PrintSerialSpeed(blob_status.downloadSpeed); SerialOutputString(" baud\n"); 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 "); PrintSerialSpeed(blob_status.terminalSpeed); SerialOutputString(" baud.\n"); SerialInit(blob_status.downloadSpeed); *numRead = UUDecode((char *)startAddress, bufLen); 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]); SerialInit(blob_status.terminalSpeed); return retval; } SerialOutputString("Received "); SerialOutputDec(*numRead); SerialOutputString(" (0x"); SerialOutputHex(*numRead); SerialOutputString(") bytes.\n"); SerialInit(blob_status.terminalSpeed); return 0; } static char downloadhelp[] = "download {blob|param|kernel|ramdisk}\n" "Download <argument> image to RAM\n"; __commandlist(Download, "download", downloadhelp); static int Flash(int argc, char *argv[]) { u32 startAddress = 0; tBlockType block; int numBytes = 0; int maxSize = 0; block_source_t type = fromFlash; if(argc < 2) return -ENOPARAMS; if(strncmp(argv[1], "blob", 4) == 0) { startAddress = BLOB_RAM_BASE; block = blBlob; numBytes = blob_status.blobSize; maxSize = BLOB_LEN; type = blob_status.blobType; #ifdef PARAM_START } else if(strncmp(argv[1], "param", 5) == 0) { startAddress = PARAM_RAM_BASE; block = blParam; numBytes = blob_status.paramSize; maxSize = PARAM_LEN; type = blob_status.paramType; #endif } else if(strncmp(argv[1], "kernel", 6) == 0) { startAddress = KERNEL_RAM_BASE; block = blKernel; numBytes = blob_status.kernelSize; maxSize = KERNEL_LEN; type = blob_status.kernelType; } else if(strncmp(argv[1], "ramdisk", 7) == 0) { startAddress = RAMDISK_RAM_BASE; block = blRamdisk; numBytes = blob_status.ramdiskSize; maxSize = INITRD_LEN; type = blob_status.ramdiskType; } else { printerror(EINVAL, argv[1]); return 0; } if(type == fromFlash) { /* error */ printerrprefix(); SerialOutputString(argv[1]); SerialOutputString(" not downloaded\n"); return -EINVAL; } if(numBytes > maxSize) { printerrprefix(); SerialOutputString("image too large for flash: 0x"); SerialOutputHex(numBytes); SerialOutputString(" > 0x"); SerialOutputHex(maxSize); SerialOutputByte('\n'); return -ETOOLONG; } SerialOutputString("Saving "); SerialOutputString(argv[1]); SerialOutputString(" to flash "); EraseBlocks(block); SerialOutputByte(' '); WriteBlocksFromMem(block, (u32 *)startAddress, numBytes); SerialOutputString(" done\n"); return 0; } static char flashhelp[] = "flash {blob|param|kernel|ramdisk}\n" "Write <argument> image to flash\n"; __commandlist(Flash, "flash", flashhelp); static int SetDownloadSpeed(int argc, char *argv[]) { if(argc < 2) return -ENOPARAMS; if(strcmp(argv[1], "1200") == 0) { blob_status.downloadSpeed = baud1k2; } else if(strcmp(argv[1], "1k2") == 0) { blob_status.downloadSpeed = baud1k2; } else if(strcmp(argv[1], "9600") == 0) { blob_status.downloadSpeed = baud9k6; } else if(strcmp(argv[1], "9k6") == 0) { blob_status.downloadSpeed = baud9k6; } else if(strcmp(argv[1], "19200") == 0) { blob_status.downloadSpeed = baud19k2; } else if(strcmp(argv[1], "19k2") == 0) { blob_status.downloadSpeed = baud19k2; } else if(strcmp(argv[1], "38400") == 0) { blob_status.downloadSpeed = baud38k4; } else if(strcmp(argv[1], "38k4") == 0) { blob_status.downloadSpeed = baud38k4; } else if(strcmp(argv[1], "57600") == 0) { blob_status.downloadSpeed = baud57k6; } else if(strcmp(argv[1], "57k6") == 0) { blob_status.downloadSpeed = baud57k6; } else if(strcmp(argv[1], "115200") == 0) { blob_status.downloadSpeed = baud115k2; } else if(strcmp(argv[1], "115k2") == 0) { blob_status.downloadSpeed = baud115k2; } else if(strcmp(argv[1], "230400") == 0) { blob_status.downloadSpeed = baud230k4; } else if(strcmp(argv[1], "230k4") == 0) { blob_status.downloadSpeed = baud230k4; } else { return -EINVAL; } SerialOutputString("Download speed set to "); PrintSerialSpeed(blob_status.downloadSpeed); SerialOutputString(" baud\n"); return 0; } static char speedhelp[] = "speed [baudrate]\n" "Set download speed. Valid baudrates are:\n" "1200, 9600, 19200, 38400, 57600, 115200, 230400,\n" " 1k2, 9k6, 19k2, 38k4, 57k6, 115k2, 230k4\n"; __commandlist(SetDownloadSpeed, "speed", speedhelp); static int PrintStatus(int argc, char *argv[]) { SerialOutputString("Bootloader : " PACKAGE "\n"); SerialOutputString("Version : " VERSION "\n"); SerialOutputString("Running from : "); if(RunningFromInternal()) SerialOutputString("internal"); else SerialOutputString("external"); SerialOutputString(" flash\nBlocksize : 0x"); SerialOutputHex(blob_status.blockSize); SerialOutputString("\nDownload speed: "); PrintSerialSpeed(blob_status.downloadSpeed); SerialOutputString(" baud\n"); SerialOutputString("Terminal speed: "); PrintSerialSpeed(blob_status.terminalSpeed); SerialOutputString(" baud\n"); SerialOutputString("Blob : "); if(blob_status.blobType == fromFlash) { SerialOutputString("from flash\n"); } else { SerialOutputString("downloaded, "); SerialOutputDec(blob_status.blobSize); SerialOutputString(" bytes\n"); } #ifdef PARAM_START SerialOutputString("Param Block : "); if(blob_status.paramType == fromFlash) { SerialOutputString("from flash\n"); } else { SerialOutputString("downloaded, "); SerialOutputDec(blob_status.blobSize); SerialOutputString(" bytes\n"); } #else SerialOutputString("Param Block : Not available\n"); #endif SerialOutputString("Kernel : "); if(blob_status.kernelType == fromFlash) { SerialOutputString("from flash\n"); } else { SerialOutputString("downloaded, "); SerialOutputDec(blob_status.kernelSize); SerialOutputString(" bytes\n"); } SerialOutputString("Ramdisk : "); if(blob_status.... [truncated message content] |
Update of /cvsroot/blob/blob/src/lib In directory usw-pr-cvs1:/tmp/cvs-serv26965/lib Modified Files: Makefile.am Added Files: command.c error.c help.c icache.c init.c led.c serial.c terminal.c time.c util.c Log Message: Move all files to either blob/ or lib/ --- NEW FILE: command.c --- /*------------------------------------------------------------------------- * Filename: command.c * Version: $Id: command.c,v 1.1 2001/10/07 19:04:25 erikm Exp $ * Copyright: Copyright (C) 1999, Erik Mouw * Author: Erik Mouw <J.A...@it...> * Description: Command line functions for blob * Created at: Sun Aug 29 17:23:40 1999 * Modified by: Erik Mouw <J.A...@it...> * Modified at: Sun Oct 3 21:08:27 1999 *-----------------------------------------------------------------------*/ /* * command.c: Command line functions for blob * * Copyright (C) 1999 2000 2001 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 * 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: command.c,v 1.1 2001/10/07 19:04:25 erikm Exp $" #ifdef HAVE_CONFIG_H # include "config.h" #endif #include "command.h" #include "errno.h" #include "init.h" #include "serial.h" #include "time.h" #include "types.h" #include "util.h" /* command list start and end. filled in by the linker */ extern u32 __commandlist_start; extern u32 __commandlist_end; /* the first command */ commandlist_t *commands; static void init_commands(void) { commandlist_t *lastcommand; commandlist_t *cmd, *next_cmd; commands = (commandlist_t *) &__commandlist_start; lastcommand = (commandlist_t *) &__commandlist_end; /* make a list */ /* FIXME: should sort the list in alphabetical order over here */ cmd = next_cmd = commands; next_cmd++; while(next_cmd < lastcommand) { cmd->next = next_cmd; cmd++; next_cmd++; } } __initlist(init_commands, INIT_LEVEL_OTHER_STUFF); #define STATE_WHITESPACE (0) #define STATE_WORD (1) void parse_args(char *cmdline, int *argc, char **argv) { char *c; int state = STATE_WHITESPACE; int i; *argc = 0; if(strlen(cmdline) == 0) return; /* convert all tabs into single spaces */ c = cmdline; while(*c != '\0') { if(*c == '\t') *c = ' '; c++; } c = cmdline; i = 0; /* now find all words on the command line */ while(*c != '\0') { if(state == STATE_WHITESPACE) { if(*c != ' ') { argv[i] = c; i++; state = STATE_WORD; } } else { /* state == STATE_WORD */ if(*c == ' ') { *c = '\0'; state = STATE_WHITESPACE; } } c++; } *argc = i; #ifdef BLOB_DEBUG for(i = 0; i < *argc; i++) { printerrprefix(); SerialOutputString("argv["); SerialOutputDec(i); SerialOutputString("] = "); SerialOutputString(argv[i]); SerialOutputByte('\n'); } #endif } int parse_command(char *cmdline) { commandlist_t *cmd; int argc; char *argv[MAX_ARGS]; parse_args(cmdline, &argc, argv); /* only whitespace */ if(argc == 0) return 0; for(cmd = commands; cmd != NULL; cmd = cmd->next) { if(cmd->magic != COMMAND_MAGIC) { #ifdef BLOB_DEBUG printerrprefix(); SerialOutputString("Address = 0x"); SerialOutputHex((u32)cmd); SerialOutputString("!\n"); #endif return -EMAGIC; } if(strcmp(cmd->name, cmdline) == 0) { /* call function */ return cmd->callback(argc, argv); } } return -ECOMMAND; } /* display a prompt, or the standard prompt if prompt == NULL */ void DisplayPrompt(char *prompt) { if(prompt == NULL) { SerialOutputString(PACKAGE "> "); } else { SerialOutputString(prompt); } } /* more or less like SerialInputString(), but with echo and backspace */ int GetCommand(char *command, int len, int timeout) { u32 startTime, currentTime; char c; int i; int numRead; int maxRead = len - 1; TimerClearOverflow(); startTime = TimerGetTime(); for(numRead = 0, i = 0; numRead < maxRead;) { /* try to get a byte from the serial port */ while(!SerialInputByte(&c)) { currentTime = TimerGetTime(); /* check timeout value */ if((currentTime - startTime) > (timeout * TICKS_PER_SECOND)) { /* timeout */ command[i++] = '\0'; return(numRead); } } if((c == '\r') || (c == '\n')) { command[i++] = '\0'; /* print newline */ SerialOutputByte('\n'); return(numRead); } else if(c == '\b') { /* FIXME: is this backspace? */ if(i > 0) { i--; numRead--; /* cursor one position back. */ SerialOutputString("\b \b"); } } else { command[i++] = c; numRead++; /* print character */ SerialOutputByte(c); } } return(numRead); } --- NEW FILE: error.c --- /* * error.c: error handling functions * * Copyright (C) 2001 Erik Mouw (J.A...@it...) * * $Id: error.c,v 1.1 2001/10/07 19:04:25 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: error.c,v 1.1 2001/10/07 19:04:25 erikm Exp $" #ifdef HAVE_CONFIG_H # include "config.h" #endif #include "errno.h" #include "error.h" #include "serial.h" #include "types.h" typedef struct { int errno; char *string; } error_t; static error_t errors[] = { { ENOERROR, "no error" }, { EINVAL, "invalid argument" }, { ENOPARAMS, "not enough parameters" }, { EMAGIC, "magic value failed" }, { ECOMMAND, "invalid command" }, { ENAN, "not a number" }, { EALIGN, "alignment error" }, { ERANGE, "out of range" }, { ETIMEOUT, "timeout exceeded" }, { ETOOSHORT, "short file" }, { ETOOLONG, "long file" }, }; static char *unknown = "unknown error"; static char *errprefix = "*** "; char *strerror(int errnum) { int i; int num = sizeof(errors) / sizeof(error_t); /* make positive if it is negative */ if(errnum < 0) errnum = -errnum; for(i = 0; i < num; i++) if(errors[i].errno == errnum) return errors[i].string; return unknown; } void printerrprefix(void) { SerialOutputString(errprefix); } void printerror(int errnum, char *s) { printerrprefix(); SerialOutputString(strerror(errnum)); if(s != NULL) { SerialOutputString(": "); SerialOutputString(s); } SerialOutputByte('\n'); } --- NEW FILE: help.c --- /* * help.c: Help for commands * * Copyright (C) 2001 Erik Mouw (J.A...@it...) * * $Id: help.c,v 1.1 2001/10/07 19:04:25 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: help.c,v 1.1 2001/10/07 19:04:25 erikm Exp $" #ifdef HAVE_CONFIG_H # include "config.h" #endif #include "command.h" #include "errno.h" #include "error.h" #include "serial.h" #include "util.h" static int help(int argc, char *argv[]) { commandlist_t *cmd; /* help on a command? */ if(argc >= 2) { for(cmd = commands; cmd != NULL; cmd = cmd->next) { if(strcmp(cmd->name, argv[1]) == 0) { SerialOutputString("Help for '"); SerialOutputString(argv[1]); SerialOutputString("':\n\nUsage: "); SerialOutputString(cmd->help); return 0; } } printerror(EINVAL, argv[1]); return 0; } /* generic help */ SerialOutputString("Help for " PACKAGE " " VERSION ", the bootloader\n"); SerialOutputString("The following commands are supported:"); for(cmd = commands; cmd != NULL; cmd = cmd->next) { SerialOutputString("\n* "); SerialOutputString(cmd->name); } SerialOutputString("\nUse \"help command\" to get help on a specific command\n"); return 0; } static char helphelp[] = "help\n" "Get this help\n"; __commandlist(help, "help", helphelp); --- NEW FILE: icache.c --- /* * icache.c: i-cache handling * * Copyright (C) 2001 Russ Dill <Rus...@as...> * * $Id: icache.c,v 1.1 2001/10/07 19:04:25 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: icache.c,v 1.1 2001/10/07 19:04:25 erikm Exp $" #ifdef HAVE_CONFIG_H # include "config.h" #endif #include "init.h" #include "types.h" static void enable_icache(void) { register u32 i; /* read control register */ asm ("mrc p15, 0, %0, c1, c0, 0": "=r" (i)); /* set i-cache */ i |= 0x1000; /* write back to control register */ asm ("mcr p15, 0, %0, c1, c0, 0": : "r" (i)); } static void disable_icache(void) { register u32 i; /* read control register */ asm ("mrc p15, 0, %0, c1, c0, 0": "=r" (i)); /* clear i-cache */ i &= ~0x1000; /* write back to control register */ asm ("mcr p15, 0, %0, c1, c0, 0": : "r" (i)); /* flush i-cache */ asm ("mcr p15, 0, %0, c7, c5, 0": : "r" (i)); } /* init and exit calls */ __initlist(enable_icache, INIT_LEVEL_INITIAL_HARDWARE); __exitlist(disable_icache, INIT_LEVEL_INITIAL_HARDWARE); --- NEW FILE: init.c --- /* * init.c: Support for init and exit lists * * Copyright (C) 2001 Erik Mouw (J.A...@it...) * * $Id: init.c,v 1.1 2001/10/07 19:04:25 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: init.c,v 1.1 2001/10/07 19:04:25 erikm Exp $" #ifdef HAVE_CONFIG_H # include "config.h" #endif #include "errno.h" #include "error.h" #include "init.h" #include "serial.h" #include "types.h" /* int and exit list start and end. filled in by the linker */ extern u32 __initlist_start; extern u32 __initlist_end; extern u32 __exitlist_start; extern u32 __exitlist_end; static void call_funcs(initlist_t *start, initlist_t *end, u32 magic, int level) { initlist_t *item; for(item = start; item != end; item++) { if(item->magic != magic) { printerror(EMAGIC, NULL); #ifdef BLOB_DEBUG printerrprefix(); SerialOutputString("Address = 0x"); SerialOutputHex((u32)item); SerialOutputByte('\n'); #endif return; } if(item->level == level) { /* call function */ item->callback(); } } } void init_subsystems(void) { int i; /* call all subsystem init functions */ for(i = INIT_LEVEL_MIN; i <= INIT_LEVEL_MAX; i++) call_funcs((initlist_t *)&__initlist_start, (initlist_t *)&__initlist_end, INIT_MAGIC, i); } void exit_subsystems(void) { int i; /* call all subsystem exit functions */ for(i = INIT_LEVEL_MAX; i >= INIT_LEVEL_MIN; i--) call_funcs((initlist_t *)&__exitlist_start, (initlist_t *)&__exitlist_end, EXIT_MAGIC, i); } --- NEW FILE: led.c --- /*------------------------------------------------------------------------- * Filename: led.c * Version: $Id: led.c,v 1.1 2001/10/07 19:04:25 erikm Exp $ * Copyright: Copyright (C) 1999, Erik Mouw * Author: Erik Mouw <J.A...@it...> * Description: * Created at: Mon Aug 16 15:39:12 1999 * Modified by: Erik Mouw <J.A...@it...> * Modified at: Mon Aug 16 16:55:21 1999 *-----------------------------------------------------------------------*/ /* * led.c: simple LED control functions * * Copyright (C) 1999 2001 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 * 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 * */ /* * All functions assume that the LED is properly initialised by the code * in ledasm.S. * */ #ident "$Id: led.c,v 1.1 2001/10/07 19:04:25 erikm Exp $" #ifdef HAVE_CONFIG_H # include "config.h" #endif #include "led.h" #include "sa1100.h" #include "init.h" static int led_state; void led_on(void) { GPSR = LED_GPIO; led_state = 1; } void led_off(void) { GPCR = LED_GPIO; led_state = 0; } void led_toggle(void) { if(led_state) led_off(); else led_on(); } /* init and exit calls */ __initlist(led_on, INIT_LEVEL_INITIAL_HARDWARE); __exitlist(led_off, INIT_LEVEL_INITIAL_HARDWARE); --- NEW FILE: serial.c --- /*------------------------------------------------------------------------- * Filename: serial.c * Version: $Id: serial.c,v 1.1 2001/10/07 19:04:25 erikm Exp $ * Copyright: Copyright (C) 1999, Erik Mouw * Author: Erik Mouw <J.A...@it...> * Description: Serial utilities for blob * Created at: Tue Aug 24 20:25:00 1999 * Modified by: Erik Mouw <J.A...@it...> * Modified at: Mon Oct 4 20:11:14 1999 *-----------------------------------------------------------------------*/ /* * serial.c: Serial utilities for blob * * Copyright (C) 1999 2000 2001 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 * 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.c,v 1.1 2001/10/07 19:04:25 erikm Exp $" #ifdef HAVE_CONFIG_H # include "config.h" #endif #include "init.h" #include "led.h" #include "sa1100.h" #include "serial.h" #include "time.h" /* * Initialise the serial port with the given baudrate. The settings * are always 8 data bits, no parity, 1 stop bit, no start bits. * */ void SerialInit(eBauds 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) { } 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) { } 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 } /* * Output a single byte to the serial port. */ void SerialOutputByte(const char c) { #if defined USE_SERIAL1 /* wait for room in the tx FIFO */ while((Ser1UTSR0 & UTSR0_TFS) == 0) ; Ser1UTDR = c; #elif defined USE_SERIAL3 /* wait for room in the tx FIFO */ while((Ser3UTSR0 & UTSR0_TFS) == 0) ; Ser3UTDR = c; #else #error "Configuration error: No serial port used at all!" #endif /* If \n, also do \r */ if(c == '\n') SerialOutputByte('\r'); } /* * Write a null terminated string to the serial port. */ void SerialOutputString(const char *s) { while(*s != 0) SerialOutputByte(*s++); } /* SerialOutputString */ /* * Write the argument of the function in hexadecimal to the serial * port. If you want "0x" in front of it, you'll have to add it * yourself. */ void SerialOutputHex(const u32 h) { char c; int i; for(i = NIBBLES_PER_WORD - 1; i >= 0; i--) { c = (char)((h >> (i * 4)) & 0x0f); if(c > 9) c += ('a' - 10); else c += '0'; SerialOutputByte(c); } } /* * Write the argument of the function in decimal to the serial port. * We just assume that each argument is positive (i.e. unsigned). */ void SerialOutputDec(const u32 d) { int leading_zero = 1; u32 divisor, result, remainder; remainder = d; for(divisor = 1000000000; divisor > 0; divisor /= 10) { result = remainder / divisor; remainder %= divisor; if(result != 0 || divisor == 1) leading_zero = 0; if(leading_zero == 0) SerialOutputByte((char)(result) + '0'); } } /* * Write a block of data to the serial port. Similar to * SerialOutputString(), but this function just writes the number of * characters indicated by bufsize and doesn't look at termination * characters. */ void SerialOutputBlock(const char *buf, int bufsize) { while(bufsize--) SerialOutputByte(*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 * * len is the length of array s _including_ the trailing zero, * the function returns the number of bytes read _excluding_ * the trailing zero */ int SerialInputString(char *s, const int len, const int timeout) { u32 startTime, currentTime; char c; int i; int numRead; int skipNewline = 1; int maxRead = len - 1; startTime = TimerGetTime(); for(numRead = 0, i = 0; numRead < maxRead;) { /* try to get a byte from the serial port */ while(!SerialInputByte(&c)) { currentTime = TimerGetTime(); /* check timeout value */ if((currentTime - startTime) > (timeout * TICKS_PER_SECOND)) { /* timeout */ s[i++] = '\0'; return(numRead); } } /* eat newline characters at start of string */ if((skipNewline == 1) && (c != '\r') && (c != '\n')) skipNewline = 0; if(skipNewline == 0) { if((c == '\r') || (c == '\n')) { s[i++] = '\0'; return(numRead); } else { s[i++] = c; numRead++; } } } return(numRead); } /* * SerialInputBlock(): almost the same as SerialInputString(), but * this one just reads a block of characters without looking at * special characters. */ int SerialInputBlock(char *buf, int bufsize, const int timeout) { u32 startTime, currentTime; char c; int i; int numRead; int maxRead = bufsize; startTime = TimerGetTime(); for(numRead = 0, i = 0; numRead < maxRead;) { /* try to get a byte from the serial port */ while(!SerialInputByte(&c)) { currentTime = TimerGetTime(); /* check timeout value */ if((currentTime - startTime) > (timeout * TICKS_PER_SECOND)) { /* timeout! */ return(numRead); } } buf[i++] = c; numRead ++; } return(numRead); } /* default initialisation */ static void serial_default_init(void) { SerialInit(baud9k6); } __initlist(serial_default_init, INIT_LEVEL_INITIAL_HARDWARE); --- NEW FILE: terminal.c --- /* * terminal.c: terminal reset functions * * Copyright (C) 1999 2000 2001 Erik Mouw (J.A...@it...) * * $Id: terminal.c,v 1.1 2001/10/07 19:04:25 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: terminal.c,v 1.1 2001/10/07 19:04:25 erikm Exp $" #ifdef HAVE_CONFIG_H # include "config.h" #endif #include "command.h" #include "main.h" #include "serial.h" static int reset_terminal(int argc, char *argv[]) { int i; SerialInit(blob_status.terminalSpeed); SerialOutputString(" c"); for(i = 0; i < 100; i++) SerialOutputByte('\n'); SerialOutputString("c"); return 0; } static char resethelp[] = "reset\n" "Reset terminal\n"; __commandlist(reset_terminal, "reset", resethelp); --- NEW FILE: time.c --- /*------------------------------------------------------------------------- * Filename: time.c * Version: $Id: time.c,v 1.1 2001/10/07 19:04:25 erikm Exp $ * Copyright: Copyright (C) 1999, Erik Mouw * Author: Erik Mouw <J.A...@it...> * Description: Some easy timer functions for blob * Created at: Tue Aug 24 21:08:25 1999 * Modified by: Erik Mouw <J.A...@it...> * Modified at: Sun Oct 3 21:10:21 1999 *-----------------------------------------------------------------------*/ /* * timer.c: Timer functions for blob * * Copyright (C) 1999 2000 2001 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 * 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: time.c,v 1.1 2001/10/07 19:04:25 erikm Exp $" #ifdef HAVE_CONFIG_H # include "config.h" #endif #include "init.h" #include "led.h" #include "sa1100.h" #include "time.h" static int numOverflows; static void TimerInit(void) { /* clear counter */ OSCR = 0; /* we don't want to be interrupted */ OIER = 0; /* wait until OSCR > 0 */ while(OSCR == 0) ; /* clear match register 0 */ OSMR0 = 0; /* clear match bit for OSMR0 */ OSSR = OSSR_M0; numOverflows = 0; } __initlist(TimerInit, INIT_LEVEL_OTHER_HARDWARE); /* returns the time in 1/TICKS_PER_SECOND seconds */ u32 TimerGetTime(void) { /* turn LED always on after one second so the user knows that * the board is on */ if((OSCR % TICKS_PER_SECOND) < (TICKS_PER_SECOND >>7)) led_on(); return((u32) OSCR); } int TimerDetectOverflow(void) { return(OSSR & OSSR_M0); } void TimerClearOverflow(void) { if(TimerDetectOverflow()) numOverflows++; OSSR = OSSR_M0; } void msleep(unsigned int msec) { u32 ticks, start, end; int will_overflow = 0; int has_overflow = 0; int reached = 0; if(msec == 0) return; ticks = (TICKS_PER_SECOND * msec) / 1000; start = TimerGetTime(); /* this could overflow, but it nicely wraps around which is * exactly what we want */ end = start + ticks; /* detect the overflow */ if(end < start) { TimerClearOverflow(); will_overflow = 1; } do { if(will_overflow && !has_overflow) { if(TimerDetectOverflow()) has_overflow = 1; continue; } if(TimerGetTime() >= end) reached = 1; } while(!reached); } --- NEW FILE: util.c --- /*------------------------------------------------------------------------- * Filename: util.c * Version: $Id: util.c,v 1.1 2001/10/07 19:04:25 erikm Exp $ * Copyright: Copyright (C) 1999, Jan-Derk Bakker * Author: Jan-Derk Bakker <J.D...@it...> * Description: Simple utility functions for blob * Created at: Wed Aug 25 21:00:00 1999 * Modified by: Erik Mouw <J.A...@it...> * Modified at: Sun Oct 3 21:10:43 1999 *-----------------------------------------------------------------------*/ /* * util.c: Simple utility functions for blob * * Copyright (C) 1999 Jan-Derk Bakker (J.D...@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 * 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: util.c,v 1.1 2001/10/07 19:04:25 erikm Exp $" #ifdef HAVE_CONFIG_H # include "config.h" #endif #include "types.h" #include "util.h" #include "serial.h" void MyMemCpy(u32 *dest, const u32 *src, int numWords) { #ifdef BLOB_DEBUG SerialOutputString("\n### Now copying 0x"); SerialOutputHex(numWords); SerialOutputString(" words from 0x"); SerialOutputHex((int)src); SerialOutputString(" to 0x"); SerialOutputHex((int)dest); SerialOutputByte('\n'); #endif while(numWords--) { if((numWords & 0xffff) == 0x0) SerialOutputByte('.'); *dest++ = *src++; } #ifdef BLOB_DEBUG SerialOutputString(" done\n"); #endif } /* MyMemCpy */ void MyMemCpyChar(char *dest, const char *src, int numBytes) { char *destLim = dest + numBytes; while(dest < destLim) *dest++ = *src++; } /* MyMemCpyChar */ void MyMemSet(u32 *dest, const u32 wordToWrite, int numWords) { u32 *limit = dest + numWords; while(dest < limit) *dest++ = wordToWrite; } /* MyMemSet */ int strncmp(const char *s1, const char *s2, int maxlen) { int i; for(i = 0; i < maxlen; i++) { if(s1[i] != s2[i]) return ((int) s1[i]) - ((int) s2[i]); if(s1[i] == 0) return 0; } return 0; } int strlen(const char *s) { int i = 0; for(;*s != '\0'; s++) i++; return i; } char *strcpy(char *dest, const char *src) { while(*src != '\0') *dest++ = *src++; *dest = '\0'; return dest; } /* test for a digit. return value if digit or -1 otherwise */ static int digitvalue(char isdigit) { if (isdigit >= '0' && isdigit <= '9' ) return isdigit - '0'; else return -1; } /* test for a hexidecimal digit. return value if digit or -1 otherwise */ static int xdigitvalue(char isdigit) { if (isdigit >= '0' && isdigit <= '9' ) return isdigit - '0'; if (isdigit >= 'a' && isdigit <= 'f') return 10 + isdigit - 'a'; return -1; } /* convert a string to an u32 value. if the string starts with 0x, it * is a hexidecimal string, otherwise we treat is as decimal. returns * the converted value on success, or -1 on failure. no, we don't care * about overflows if the string is too long. */ int strtoval(const char *str, u32 *value) { int i; *value = 0; if(strncmp(str, "0x", 2) == 0) { /* hexadecimal mode */ str += 2; while(*str != '\0') { if((i = xdigitvalue(*str)) < 0) return -1; *value = (*value << 4) | (u32)i; str++; } } else { /* decimal mode */ while(*str != '\0') { if((i = digitvalue(*str)) < 0) return -1; *value = (*value * 10) + (u32)i; str++; } } return 0; } Index: Makefile.am =================================================================== RCS file: /cvsroot/blob/blob/src/lib/Makefile.am,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- Makefile.am 2001/10/07 15:07:13 1.1 +++ Makefile.am 2001/10/07 19:04:25 1.2 @@ -0,0 +1,50 @@ +# -*- makefile -*- +# +# Makefile.am +# +# Copyright (C) 2001 Erik Mouw (J.A...@it...) +# +# $Id$ +# +# 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 +# + +noinst_LIBRARIES = \ + libblob.a + + +libblob_a_SOURCES = \ + command.c \ + error.c \ + help.c \ + icache.c \ + init.c \ + led.c \ + serial.c \ + terminal.c \ + time.c \ + util.c + + +INCLUDES += \ + -I${top_builddir}/include \ + -I${top_srcdir}/include + + + +CLEANFILES = ${srcdir}/*~ + + +DISTCLEANFILES = ${builddir}/.deps/*.P |
From: Erik M. <er...@us...> - 2001-10-07 19:04:27
|
Update of /cvsroot/blob/blob/src In directory usw-pr-cvs1:/tmp/cvs-serv26965 Modified Files: Makefile.am Removed Files: debug.c error.c flash.c flashasm.S help.c icache.c init.c led.c linux.c main.c memory.c param_block.c reboot.c rest-ld-script serial.c terminal.c testmem2.S time.c trampoline.S util.c uucodec.c Log Message: Move all files to either blob/ or lib/ Index: Makefile.am =================================================================== RCS file: /cvsroot/blob/blob/src/Makefile.am,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- Makefile.am 2001/10/07 15:51:01 1.13 +++ Makefile.am 2001/10/07 19:04:24 1.14 @@ -11,129 +11,9 @@ ########################################################################### SUBDIRS = \ - blob - - -bin_PROGRAMS = \ - blob-start-elf32 \ - blob-start \ - blob-rest-elf32 \ - blob-rest \ - blob - - -# First specify how to build the first stage loader - -# WARNING: start.S *must* be the first file, otherwise the target will -# be linked in the wrong order! -blob_start_elf32_SOURCES = \ - start.S \ - ledasm.S \ - testmem.S - -EXTRA_blob_start_elf32_SOURCES = \ - memsetup-sa1100.S \ - memsetup-sa1110.S - -blob_start_elf32_DEPENDENCIES = \ - @MEMSETUP@ - -blob_start_elf32_LDFLAGS += \ - -Wl,-T,${top_srcdir}/src/start-ld-script - -blob_start_elf32_LDADD += \ - @MEMSETUP@ \ - -lgcc - - -blob_start_SOURCES = - - -blob-start: blob-start-elf32 - $(OBJCOPY) $(OCFLAGS) $< $@ - - -# Now specify how to build the second stage loader - -# WARNING: trampoline.S *must* be the first file, otherwise the target -# will be linked in the wrong order! -blob_rest_elf32_SOURCES = \ - trampoline.S \ - flashasm.S \ - testmem2.S \ - command.c \ - command_hist.c \ - error.c \ - flash.c \ - help.c \ - icache.c \ - init.c \ - led.c \ - linux.c \ - main.c \ - memory.c \ - param_block.c \ - reboot.c \ - serial.c \ - terminal.c \ - time.c \ - util.c \ - uucodec.c - -# conditionally compiled sources -EXTRA_blob_rest_elf32_SOURCES = \ - chkmem.c \ - debug.c \ - clock.c - -blob_rest_elf32_DEPENDENCIES = \ - @CHKMEM@ \ - @DEBUG@ \ - @CLOCK@ - -blob_rest_elf32_LDFLAGS += \ - -Wl,-T,${top_srcdir}/src/rest-ld-script - - -blob_rest_elf32_LDADD += \ - @CHKMEM@ \ - @DEBUG@ \ - @CLOCK@ \ - -lgcc - - -blob_rest_SOURCES = - - -blob-rest: blob-rest-elf32 - $(OBJCOPY) $(OCFLAGS) $< $@ - - -# Finally specify how to build the full binary - -blob_SOURCES = - - -blob: blob-start blob-rest - rm -f $@ - dd if=blob-start of=$@ bs=1k conv=sync - dd if=blob-rest of=$@ bs=1k seek=1 - chmod +x blob - - -# automake administrativia - -EXTRA_DIST = \ - start-ld-script \ - rest-ld-script - - -INCLUDES += \ - -I${top_builddir}/include \ - -I${top_srcdir}/include - - -CLEANFILES = *~ + lib \ + blob \ + diag -DISTCLEANFILES = .deps/*.P +CLEANFILES = ${srcdir}/*~ --- debug.c DELETED --- --- error.c DELETED --- --- flash.c DELETED --- --- flashasm.S DELETED --- --- help.c DELETED --- --- icache.c DELETED --- --- init.c DELETED --- --- led.c DELETED --- --- linux.c DELETED --- --- main.c DELETED --- --- memory.c DELETED --- --- param_block.c DELETED --- --- reboot.c DELETED --- --- rest-ld-script DELETED --- --- serial.c DELETED --- --- terminal.c DELETED --- --- testmem2.S DELETED --- --- time.c DELETED --- --- trampoline.S DELETED --- --- util.c DELETED --- --- uucodec.c DELETED --- |
From: Erik M. <er...@us...> - 2001-10-07 16:30:00
|
Update of /cvsroot/blob/blob/utils/mkparamblock In directory usw-pr-cvs1:/tmp/cvs-serv31449 Modified Files: mkparamblock.c Log Message: fix include files Index: mkparamblock.c =================================================================== RCS file: /cvsroot/blob/blob/utils/mkparamblock/mkparamblock.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- mkparamblock.c 2001/09/02 23:35:28 1.5 +++ mkparamblock.c 2001/10/07 16:29:52 1.6 @@ -4,8 +4,8 @@ #include <string.h> #include <stdlib.h> #include <sys/stat.h> -#include "param_block.h" -#include "serial.h" +#include <blob/param_block.h> +#include <blob/serial.h> struct config_keyword { char keyword[40]; @@ -229,4 +229,4 @@ return 0; } - \ No newline at end of file + |
From: Erik M. <er...@us...> - 2001-10-07 16:04:05
|
Update of /cvsroot/blob/CVSROOT In directory usw-pr-cvs1:/tmp/cvs-serv25938 Modified Files: syncmail loginfo Log Message: update to the latest syncmail version Index: syncmail =================================================================== RCS file: /cvsroot/blob/CVSROOT/syncmail,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- syncmail 2001/07/01 18:11:18 1.3 +++ syncmail 2001/10/07 16:04:03 1.4 @@ -1,17 +1,5 @@ #! /usr/bin/python # -*- Python -*- -# -# PLEASE DO NOT EDIT THIS FILE IN PLACE IN THE CVS TREE!!! -# check out the CVSROOT directory on your local machine, -# make the changes there and commit. Otherwise your changes -# will be lost. --gafton -# -# - updated by gafton to allow for --nodiff option. The nodiff option -# still sends out messages when something changes in a directory, but -# without the diff output. Particularly useful for directories containing -# binary files, such as RPM packages. -# -# $Id$ """Complicated notification for CVS checkins. @@ -22,25 +10,24 @@ This script is run from a CVS loginfo file (see $CVSROOT/CVSROOT/loginfo). To set this up, create a loginfo entry that looks something like this: - mymodule /path/to/syncmail %%s som...@yo...main + mymodule /path/to/this/script %%s som...@yo...main -In this example, whenever a checkin that matches `mymodule' is made, the -syncmail script is invoked, which will generate the diff containing email, and -send it to som...@yo...main. +In this example, whenever a checkin that matches `mymodule' is made, this +script is invoked, which will generate the diff containing email, and send it +to som...@yo...main. Note: This module used to also do repository synchronizations via rsync-over-ssh, but since the repository has been moved to SourceForge, this is no longer necessary. The syncing functionality has been ripped out in the 3.0, which simplifies it considerably. Access the 2.x versions - to refer to this functionality. Because of this, the script's name is - misleading. + to refer to this functionality. Because of this, the script is misnamed. It no longer makes sense to run this script from the command line. Doing so will only print out this usage information. Usage: - syncmail [options] <%%S> email-addr [email-addr ...] + %(PROGRAM)s [options] <%%S> email-addr [email-addr ...] Where options is: @@ -48,14 +35,20 @@ Use <path> as the environment variable CVSROOT. Otherwise this variable must exist in the environment. - --nodiff - Don't bother generating the full diff, just report if the files changed - or not. - --help -h Print this text. + --context=# + -C # + Include # lines of context around lines that differ (default: 2). + + -c + Produce a context diff (default). + + -u + Produce a unified diff (smaller, but harder to read). + <%%S> CVS %%s loginfo expansion. When invoked by CVS, this will be a single string containing the directory the checkin is being made in, relative @@ -75,54 +68,55 @@ import getopt # Notification command -MAILCMD = '/bin/mail -s "%(SUBJECT)s" %(PEOPLE)s 2>&1 > /dev/null' +MAILCMD = '/bin/mail -s "CVS: %(SUBJECT)s" %(PEOPLE)s 2>&1 > /dev/null' # Diff trimming stuff DIFF_HEAD_LINES = 20 DIFF_TAIL_LINES = 20 DIFF_TRUNCATE_IF_LARGER = 1000 -# Operating mode options -optNoDiff = 0 +PROGRAM = sys.argv[0] + -def usage(errcode, msg=''): +def usage(code, msg=''): print __doc__ % globals() - if msg: print msg - sys.exit(errorcode) + if msg: + print msg + sys.exit(code) -def calculate_diff(filespec): - global optNoDiff +def calculate_diff(filespec, contextlines): try: file, oldrev, newrev = string.split(filespec, ',') except ValueError: # No diff to report - return '***** Not enough context to create diff for file: %s' % filespec + return '***** Bogus filespec: %s' % filespec if oldrev == 'NONE': try: - if optNoDiff: - lines = [] - else: + if os.path.exists(file): fp = open(file) - lines = fp.readlines() - fp.close() - lines.insert(0, '--- NEW FILE %s ---\n' % file) + else: + update_cmd = 'cvs -fn update -r %s -p %s' % (newrev, file) + fp = os.popen(update_cmd) + lines = fp.readlines() + fp.close() + lines.insert(0, '--- NEW FILE: %s ---\n' % file) except IOError, e: lines = ['***** Error reading new file: ', - str(e)] + str(e), '\n***** file: ', file, ' cwd: ', os.getcwd()] elif newrev == 'NONE': lines = ['--- %s DELETED ---\n' % file] else: # This /has/ to happen in the background, otherwise we'll run into CVS # lock contention. What a crock. - brief = "" - if optNoDiff: - brief = "--brief" - diffcmd = '/usr/bin/cvs -f diff %s -kk -u -N -r %s -r %s %s' % ( - brief, - oldrev, newrev, file) + if contextlines > 0: + difftype = "-C " + str(contextlines) + else: + difftype = "-u" + diffcmd = "/usr/bin/cvs -f diff -kk %s --minimal -r %s -r %s '%s'" % ( + difftype, oldrev, newrev, file) fp = os.popen(diffcmd) lines = fp.readlines() sts = fp.close() @@ -138,7 +132,7 @@ -def blast_mail(mailcmd, filestodiff): +def blast_mail(mailcmd, filestodiff, contextlines): # cannot wait for child process or that will cause parent to retain cvs # lock for too long. Urg! if not os.fork(): @@ -150,7 +144,7 @@ fp.write('\n') # append the diffs if available for file in filestodiff: - fp.write(calculate_diff(file)) + fp.write(calculate_diff(file, contextlines)) fp.write('\n') fp.close() # doesn't matter what code we return, it isn't waited on @@ -160,10 +154,10 @@ # scan args for options def main(): - global optNoDiff - + contextlines = 2 try: - opts, args = getopt.getopt(sys.argv[1:], 'h', ['cvsroot=', 'nodiff', 'help']) + opts, args = getopt.getopt(sys.argv[1:], 'hC:cu', + ['context=', 'cvsroot=', 'help']) except getopt.error, msg: usage(1, msg) @@ -173,8 +167,13 @@ usage(0) elif opt == '--cvsroot': os.environ['CVSROOT'] = arg - elif opt == '--nodiff': - optNoDiff = 1 + elif opt in ('-C', '--context'): + contextlines = int(arg) + elif opt == '-c': + if contextlines <= 0: + contextlines = 2 + elif opt == '-u': + contextlines = 0 # What follows is the specification containing the files that were # modified. The argument actually must be split, with the first component @@ -195,14 +194,25 @@ mailcmd = MAILCMD % vars() print 'Mailing %s...' % PEOPLE + if specs == ['-', 'Imported', 'sources']: + return if specs[-3:] == ['-', 'New', 'directory']: del specs[-3:] - blast_mail(mailcmd, specs[1:]) + elif len(specs) > 2: + L = specs[:2] + for s in specs[2:]: + prev = L[-1] + if string.count(prev, ",") < 2: + L[-1] = "%s %s" % (prev, s) + else: + L.append(s) + specs = L + print 'Generating notification message...' + blast_mail(mailcmd, specs[1:], contextlines) + print 'Generating notification message... done.' if __name__ == '__main__': - print 'Running syncmail...' main() - print '...syncmail done.' sys.exit(0) Index: loginfo =================================================================== RCS file: /cvsroot/blob/CVSROOT/loginfo,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- loginfo 2001/07/01 18:11:18 1.3 +++ loginfo 2001/10/07 16:04:03 1.4 @@ -25,4 +25,4 @@ # or #DEFAULT (echo ""; id; echo %{sVv}; date; cat) >> $CVSROOT/CVSROOT/commitlog -DEFAULT $CVSROOT/CVSROOT/syncmail %{sVv} blo...@li... +DEFAULT $CVSROOT/CVSROOT/syncmail -u %{sVv} blo...@li... |
From: Erik M. <er...@us...> - 2001-10-07 15:51:03
|
Update of /cvsroot/blob/blob/src/blob In directory usw-pr-cvs1:/tmp/cvs-serv23534/blob Modified Files: Makefile.am Added Files: ledasm.S memsetup-sa1100.S memsetup-sa1110.S start-ld-script start.S testmem.S Log Message: Move first stage loader to src/blob/ ***** Error reading new file: [Errno 2] No such file or directory: 'ledasm.S' ***** Error reading new file: [Errno 2] No such file or directory: 'memsetup-sa1100.S' ***** Error reading new file: [Errno 2] No such file or directory: 'memsetup-sa1110.S' ***** Error reading new file: [Errno 2] No such file or directory: 'start-ld-script' ***** Error reading new file: [Errno 2] No such file or directory: 'start.S' ***** Error reading new file: [Errno 2] No such file or directory: 'testmem.S' Index: Makefile.am =================================================================== RCS file: /cvsroot/blob/blob/src/blob/Makefile.am,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- Makefile.am 2001/10/07 15:07:13 1.1 +++ Makefile.am 2001/10/07 15:51:01 1.2 @@ -0,0 +1,74 @@ +# -*- makefile -*- +# +# Makefile.am +# +# Copyright (C) 2001 Erik Mouw (J.A...@it...) +# +# $Id$ +# +# 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 +# + + +bin_PROGRAMS = \ + blob-start-elf32 \ + blob-start + + +INCLUDES += \ + -I${top_builddir}/include \ + -I${top_srcdir}/include + + +# ---- Blob first stage loader --------------------------------------- + +# WARNING: start.S *must* be the first file, otherwise the target will +# be linked in the wrong order! +blob_start_elf32_SOURCES = \ + start.S \ + ledasm.S \ + testmem.S + +EXTRA_blob_start_elf32_SOURCES = \ + memsetup-sa1100.S \ + memsetup-sa1110.S + +blob_start_elf32_DEPENDENCIES = \ + @MEMSETUP@ + +blob_start_elf32_LDFLAGS += \ + -Wl,-T,${srcdir}/start-ld-script + +blob_start_elf32_LDADD += \ + @MEMSETUP@ \ + -lgcc + + +blob_start_SOURCES = + + +blob-start: blob-start-elf32 + $(OBJCOPY) $(OCFLAGS) $< $@ + + + + + +# ---- Automake administrativia -------------------------------------- + +CLEANFILES = ${srcdir}/*~ + + +DISTCLEANFILES = .deps/*.P |
From: Erik M. <er...@us...> - 2001-10-07 15:51:03
|
Update of /cvsroot/blob/blob/src In directory usw-pr-cvs1:/tmp/cvs-serv23534 Modified Files: Makefile.am Removed Files: ledasm.S memsetup-sa1100.S memsetup-sa1110.S start-ld-script start.S testmem.S Log Message: Move first stage loader to src/blob/ Index: Makefile.am =================================================================== RCS file: /cvsroot/blob/blob/src/Makefile.am,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- Makefile.am 2001/10/05 12:09:35 1.12 +++ Makefile.am 2001/10/07 15:51:01 1.13 @@ -10,6 +10,9 @@ ## Modified at: Tue Sep 28 23:33:26 1999 ########################################################################### +SUBDIRS = \ + blob + bin_PROGRAMS = \ blob-start-elf32 \ --- ledasm.S DELETED --- --- memsetup-sa1100.S DELETED --- --- memsetup-sa1110.S DELETED --- --- start-ld-script DELETED --- --- start.S DELETED --- --- testmem.S DELETED --- |
From: Erik M. <er...@us...> - 2001-10-07 15:27:37
|
Update of /cvsroot/blob/blob/include/blob In directory usw-pr-cvs1:/tmp/cvs-serv19110 Modified Files: command.h flash.h init.h main.h memory.h memsetup.h param_block.h serial.h util.h Log Message: fix include directives in include files Index: command.h =================================================================== RCS file: /cvsroot/blob/blob/include/blob/command.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- command.h 2001/10/07 15:17:49 1.1 +++ command.h 2001/10/07 15:27:35 1.2 @@ -34,7 +34,7 @@ #ifndef BLOB_COMMAND_H #define BLOB_COMMAND_H -#include "types.h" +#include <blob/types.h> #define COMMAND_MAGIC (0x436d6420) /* "Cmd " */ Index: flash.h =================================================================== RCS file: /cvsroot/blob/blob/include/blob/flash.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- flash.h 2001/10/07 15:17:49 1.1 +++ flash.h 2001/10/07 15:27:35 1.2 @@ -34,7 +34,7 @@ #ifndef BLOB_FLASH_H #define BLOB_FLASH_H -#include "types.h" +#include <blob/types.h> #define NUM_FLASH_BLOCKS (31) #define FLASH_BLOCK_BASE ((u32 *) 0x020000) Index: init.h =================================================================== RCS file: /cvsroot/blob/blob/include/blob/init.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- init.h 2001/10/07 15:17:49 1.1 +++ init.h 2001/10/07 15:27:35 1.2 @@ -24,7 +24,7 @@ #ifndef BLOB_INIT_H #define BLOB_INIT_H -#include "types.h" +#include <blob/types.h> #define INIT_MAGIC (0x496e6974) /* "Init" */ #define EXIT_MAGIC (0x45786974) /* "Exit" */ Index: main.h =================================================================== RCS file: /cvsroot/blob/blob/include/blob/main.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- main.h 2001/10/07 15:17:49 1.1 +++ main.h 2001/10/07 15:27:35 1.2 @@ -89,9 +89,9 @@ #define RAMDISK_SIZE (8 * 1024) -#include "types.h" -#include "serial.h" -#include <asm/setup.h> +#include <blob/types.h> +#include <blob/serial.h> +#include <asm-arm/setup.h> typedef enum { Index: memory.h =================================================================== RCS file: /cvsroot/blob/blob/include/blob/memory.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- memory.h 2001/10/07 15:17:49 1.1 +++ memory.h 2001/10/07 15:27:35 1.2 @@ -24,7 +24,7 @@ #ifndef BLOB_MEMORY_H #define BLOB_MEMORY_H -#include "types.h" +#include <blob/types.h> /* The number of memory areas. Needs to be large to be able to detect * aliases. Index: memsetup.h =================================================================== RCS file: /cvsroot/blob/blob/include/blob/memsetup.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- memsetup.h 2001/10/07 15:17:49 1.1 +++ memsetup.h 2001/10/07 15:27:35 1.2 @@ -29,6 +29,9 @@ #ident "$Id$" +#ifndef BLOB_MEMSETUP_H +#define BLOB_MEMSETUP_H + /********************************************************************** * Memory Config Register Indices * based on 0xA0000000 @@ -67,3 +70,5 @@ #define MDREFR_EAPD (1 << 28) #define MDREFR_KAPD (1 << 29) #define MDREFR_SLFRSH (1 << 31) + +#endif Index: param_block.h =================================================================== RCS file: /cvsroot/blob/blob/include/blob/param_block.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- param_block.h 2001/10/07 15:17:49 1.1 +++ param_block.h 2001/10/07 15:27:35 1.2 @@ -35,7 +35,7 @@ #ifndef BLOB_PARAM_BLOCK_H #define BLOB_PARAM_BLOCK_H -#include "types.h" +#include <blob/types.h> #define PTAG_MAGIC 0x32d27000 /* base 26 blob */ Index: serial.h =================================================================== RCS file: /cvsroot/blob/blob/include/blob/serial.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- serial.h 2001/10/07 15:17:49 1.1 +++ serial.h 2001/10/07 15:27:35 1.2 @@ -35,7 +35,7 @@ #define BLOB_SERIAL_H -#include "types.h" +#include <blob/types.h> typedef enum { /* Some useful SA-1100 baud rates */ Index: util.h =================================================================== RCS file: /cvsroot/blob/blob/include/blob/util.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- util.h 2001/10/07 15:17:49 1.1 +++ util.h 2001/10/07 15:27:35 1.2 @@ -35,7 +35,7 @@ #ifndef BLOB_UTIL_H #define BLOB_UTIL_H -#include "types.h" +#include <blob/types.h> void MyMemCpy(u32 *dest, const u32 *src, int numWords); void MyMemCpyChar(char *dest, const char *src, int numBytes); |
From: Erik M. <er...@us...> - 2001-10-07 15:20:20
|
Update of /cvsroot/blob/blob In directory usw-pr-cvs1:/tmp/cvs-serv17625 Modified Files: configure.in Log Message: Add new output files Index: configure.in =================================================================== RCS file: /cvsroot/blob/blob/configure.in,v retrieving revision 1.13 retrieving revision 1.14 diff -u -r1.13 -r1.14 --- configure.in 2001/10/04 14:47:34 1.13 +++ configure.in 2001/10/07 15:20:17 1.14 @@ -24,7 +24,7 @@ VERSION=$BLOB_VERSION AM_INIT_AUTOMAKE($PACKAGE, $VERSION) -AM_CONFIG_HEADER(include/config.h) +AM_CONFIG_HEADER(include/blob/config.h) @@ -286,7 +286,11 @@ AC_OUTPUT(Makefile include/Makefile +include/blob/Makefile src/Makefile +src/blob/Makefile +src/diag/Makefile +src/lib/Makefile tools/Makefile utils/Makefile utils/build/Makefile |
From: Erik M. <er...@us...> - 2001-10-07 15:19:22
|
Update of /cvsroot/blob/blob/include In directory usw-pr-cvs1:/tmp/cvs-serv17408 Modified Files: .cvsignore Log Message: adjust .cvsignore files Index: .cvsignore =================================================================== RCS file: /cvsroot/blob/blob/include/.cvsignore,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- .cvsignore 2001/09/16 15:41:25 1.2 +++ .cvsignore 2001/10/07 15:19:19 1.3 @@ -1,6 +1,2 @@ Makefile.in Makefile -config.h.in -config.h -stamp-h.in -stamp-h |
From: Erik M. <er...@us...> - 2001-10-07 15:19:22
|
Update of /cvsroot/blob/blob/include/blob In directory usw-pr-cvs1:/tmp/cvs-serv17408/blob Added Files: .cvsignore Log Message: adjust .cvsignore files --- NEW FILE .cvsignore --- Makefile.in Makefile config.h.in config.h stamp-h.in stamp-h |
From: Erik M. <er...@us...> - 2001-10-07 15:17:52
|
Update of /cvsroot/blob/blob/include/blob In directory usw-pr-cvs1:/tmp/cvs-serv16987/blob Modified Files: Makefile.am Added Files: command.h errno.h error.h flash.h init.h led.h linux.h main.h memory.h memsetup.h param_block.h sa1100.h serial.h time.h types.h util.h uucodec.h Log Message: Move header files and adjust Makefiles ***** Error reading new file: [Errno 2] No such file or directory: 'command.h' ***** Error reading new file: [Errno 2] No such file or directory: 'errno.h' ***** Error reading new file: [Errno 2] No such file or directory: 'error.h' ***** Error reading new file: [Errno 2] No such file or directory: 'flash.h' ***** Error reading new file: [Errno 2] No such file or directory: 'init.h' ***** Error reading new file: [Errno 2] No such file or directory: 'led.h' ***** Error reading new file: [Errno 2] No such file or directory: 'linux.h' ***** Error reading new file: [Errno 2] No such file or directory: 'main.h' ***** Error reading new file: [Errno 2] No such file or directory: 'memory.h' ***** Error reading new file: [Errno 2] No such file or directory: 'memsetup.h' ***** Error reading new file: [Errno 2] No such file or directory: 'param_block.h' ***** Error reading new file: [Errno 2] No such file or directory: 'sa1100.h' ***** Error reading new file: [Errno 2] No such file or directory: 'serial.h' ***** Error reading new file: [Errno 2] No such file or directory: 'time.h' ***** Error reading new file: [Errno 2] No such file or directory: 'types.h' ***** Error reading new file: [Errno 2] No such file or directory: 'util.h' ***** Error reading new file: [Errno 2] No such file or directory: 'uucodec.h' Index: Makefile.am =================================================================== RCS file: /cvsroot/blob/blob/include/blob/Makefile.am,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- Makefile.am 2001/10/07 15:07:13 1.1 +++ Makefile.am 2001/10/07 15:17:49 1.2 @@ -0,0 +1,34 @@ +# -*- makefile -*- +########################################################################### +## Filename: Makefile.am +## Version: $Id$ +## Copyright: Copyright (C) 1999, Erik Mouw +## Author: Erik Mouw <J.A...@it...> +## Description: Makefile +## Created at: Tue Aug 17 17:25:56 1999 +## Modified by: Erik Mouw <J.A...@it...> +## Modified at: Tue Sep 28 23:36:51 1999 +########################################################################### + + +noinst_HEADERS = \ + command.h \ + errno.h \ + error.h \ + flash.h \ + init.h \ + led.h \ + linux.h \ + main.h \ + memory.h \ + memsetup.h \ + param_block.h \ + sa1100.h \ + serial.h \ + time.h \ + types.h \ + util.h \ + uucodec.h + + +CLEANFILES = *~ |