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-09-23 15:01:21
|
Update of /cvsroot/blob/blob/src
In directory usw-pr-cvs1:/tmp/cvs-serv14103
Modified Files:
Makefile.am memsetup-sa1100.S memsetup-sa1110.S
Removed Files:
memsetup.S
Log Message:
- split up memsetup.S into memsetup-sa1100.S and memsetup-sa1110.S
- memsetup-sa1100.S is OK
- memsetup-sa1110.S still needs changing
- Makefile.am reflects changes: memsetup-sa11[01]0.S are optionally compiled
Index: Makefile.am
===================================================================
RCS file: /cvsroot/blob/blob/src/Makefile.am,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- Makefile.am 2001/09/18 19:55:29 1.4
+++ Makefile.am 2001/09/23 15:01:18 1.5
@@ -25,15 +25,21 @@
# be linked in the wrong order!
blob_start_elf32_SOURCES = \
start.S \
- memsetup.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
Index: memsetup-sa1100.S
===================================================================
RCS file: /cvsroot/blob/blob/src/memsetup-sa1100.S,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- memsetup-sa1100.S 2001/09/23 13:20:31 1.1
+++ memsetup-sa1100.S 2001/09/23 15:01:18 1.2
@@ -0,0 +1,145 @@
+/*
+ * memsetup-sa1100.S: memory setup for various SA1100 architectures
+ *
+ * $Id$
+ *
+ * Copyright (C) 1999 2000 2001 Erik Mouw (J.A...@it...) and
+ * 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
+ *
+ */
+/*
+ * Documentation:
+ * Intel Corporation, "Intel StrongARM SA-1100 Microprocessor
+ * Developer's Manual", April 1999
+ */
+
+.ident "$Id$"
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+
+
+
+.text
+
+
+
+
+MEM_BASE: .long 0xa0000000
+MEM_START: .long 0xc0000000
+#define MDCNFG 0x0
+#define MDCAS0 0x04
+#define MDCAS1 0x08
+#define MDCAS2 0x0c
+#define MCS0 0x10
+
+
+
+
+#if (defined BRUTUS)
+mdcas0: .long 0xc71c703f
+mdcas1: .long 0xffc71c71
+mdcas2: .long 0xffffffff
+mdcnfg: .long 0x0334b22f
+mcs0: .long 0xfff8fff8
+#endif
+
+#if (defined NESA)
+mdcas0: .long 0xc71c703f
+mdcas1: .long 0xffc71c71
+mdcas2: .long 0xffffffff
+mdcnfg: .long 0x0334b22f
+mcs0: .long 0xfff84458
+#endif
+
+#if defined LART
+mdcas0: .long 0xc71c703f
+mdcas1: .long 0xffc71c71
+mdcas2: .long 0xffffffff
+mdcnfg: .long 0x0334b22f
+mcs0: .long 0xad8c4888
+#endif
+
+#if defined PLEB
+mdcas0: .long 0x1c71c01f
+mdcas1: .long 0xff1c71c7
+mdcas2: .long 0xffffffff
+mdcnfg: .long 0x0c7f3ca3
+mcs0: .long 0xfff8fff8
+#endif
+
+#if defined SHANNON
+mdcas0: .long 0xc71c703f
+mdcas1: .long 0xffc71c71
+mdcas2: .long 0xffffffff
+mdcnfg: .long 0x0334b21f
+mcs0: .long 0xfff84458
+#endif
+
+
+
+
+.globl memsetup
+memsetup:
+ /* Setup the flash memory */
+ ldr r0, MEM_BASE
+
+ ldr r1, mcs0
+ str r1, [r0, #MCS0]
+
+ /* Set up the DRAM */
+
+ /* MDCAS0 */
+ ldr r1, mdcas0
+ str r1, [r0, #MDCAS0]
+
+ /* MDCAS1 */
+ ldr r1, mdcas1
+ str r1, [r0, #MDCAS1]
+
+ /* MDCAS2 */
+ ldr r1, mdcas2
+ str r1, [r0, #MDCAS2]
+
+ /* MDCNFG */
+ ldr r1, mdcnfg
+ str r1, [r0, #MDCNFG]
+
+ /* Issue read requests to disabled bank to start refresh */
+ /* this is required by the Micron memory on a TuxScreen */
+
+ /* Comment from JDB:
+ * This is not strictly necessary. As long as blob writes something to
+ * the serial port between enabling and accessing DRAM (as I think it
+ * does even on Shannon), you can pretty much guarantee that the
+ * required eight refreshes have occurred (as 1 refresh is ~16
+ * microseconds, so even writing two characters at 115k2 covers the
+ * refreshes).
+ *
+ * Comment (on comment) from Erik:
+ * We don't print anymore in the low level loader, so we need this
+ * on all architectures.
+ */
+ ldr r1, MEM_START
+
+.rept 8
+ ldr r0, [r1]
+.endr
+
+ mov pc, lr
Index: memsetup-sa1110.S
===================================================================
RCS file: /cvsroot/blob/blob/src/memsetup-sa1110.S,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- memsetup-sa1110.S 2001/09/23 13:20:31 1.1
+++ memsetup-sa1110.S 2001/09/23 15:01:18 1.2
@@ -0,0 +1,131 @@
+/*
+ * memsetup-sa1110.S: memory setup for various SA1110 architectures
+ *
+ * $Id$
+ *
+ * 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
+ *
+ */
+/*
+ * Documentation:
+ * Intel Corporation, "Intel StrongARM SA-1110 Microprocessor
+ * Advanced Developer's manual, December 1999
+ *
+ * NOTE: This code assumes that an SA1110 CPU *always* uses SDRAM. This
+ * appears to be true, but it might be possible that somebody designs a
+ * board with mixed EDODRAM/SDRAM memory. -- Erik
+ *
+ */
+
+.ident "$Id$"
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+
+
+
+.text
+
+
+
+
+MEM_BASE: .long 0xa0000000
+MEM_START: .long 0xc0000000
+#define MDCNFG 0x0
+#define MDCAS0 0x04
+#define MDCAS1 0x08
+#define MDCAS2 0x0c
+#define MCS0 0x10
+
+
+
+
+.globl memsetup
+memsetup:
+ /* This part is actually for the Assabet only. If your board
+ * uses other settings, you'll have to ifdef them here.
+ */
+ /* Set up the SDRAM */
+ mov r1, #0xA0000000 /* MDCNFG base address */
+
+ ldr r2, =0xAAAAAA7F
+ str r2, [r1, #0x04] /* MDCAS00 */
+ str r2, [r1, #0x20] /* MDCAS20 */
+
+ ldr r2, =0xAAAAAAAA
+ str r2, [r1, #0x08] /* MDCAS01 */
+ str r2, [r1, #0x24] /* MDCAS21 */
+
+ ldr r2, =0xAAAAAAAA
+ str r2, [r1, #0x0C] /* MDCAS02 */
+ str r2, [r1, #0x28] /* MDCAS22 */
+
+ ldr r2, =0x4dbc0327 /* MDREFR */
+ str r2, [r1, #0x1C]
+
+ ldr r2, =0x72547254 /* MDCNFG */
+ str r2, [r1, #0x00]
+
+ /* Issue read requests to disabled bank to start refresh */
+
+ ldr r1, =0xC0000000
+
+.rept 8
+ ldr r0, [r1]
+.endr
+
+ mov r1, #0xA0000000 /* MDCNFG base address */
+
+ ldr r2, =0x72547255 /* Enable the banks */
+ str r2, [r1, #0x00] /* MDCNFG */
+
+/* Static memory chip selects on Assabet: */
+
+ ldr r2, =0x4b90 /* MCS0 */
+ orr r2,r2,r2,lsl #16
+ str r2, [r1, #0x10]
+
+ ldr r2, =0x22212419 /* MCS1 */
+ str r2, [r1, #0x14]
+
+ ldr r2, =0x42196669 /* MCS2 */
+ str r2, [r1, #0x2C]
+
+ ldr r2, =0xafccafcc /* SMCNFG */
+ str r2, [r1, #0x30]
+
+/* Set up PCMCIA space */
+
+ ldr r2, =0x994a994a
+ str r2, [r1, #0x18]
+
+/* All SDRAM memory settings should be ready to go... */
+/* For best performance, should fill out remaining memory config regs: */
+
+
+ /* Testing ,Chester */
+ mov r3,#0x12000000
+ mov r2,#0x5000 /* D9_LED on and D8_LED off */
+ str r2,[r3]
+ mov r4, #0x20000
+gogogo2:
+ subs r4, r4, #1
+ bne gogogo2
+
+ mov pc, lr
--- memsetup.S DELETED ---
|
|
From: Erik M. <er...@us...> - 2001-09-23 14:59:04
|
Update of /cvsroot/blob/blob/src
In directory usw-pr-cvs1:/tmp/cvs-serv13923
Modified Files:
linux.c
Log Message:
Fix compiler warning (code isn't reached anyway).
Index: linux.c
===================================================================
RCS file: /cvsroot/blob/blob/src/linux.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- linux.c 2001/09/17 00:05:31 1.5
+++ linux.c 2001/09/23 14:59:01 1.6
@@ -73,6 +73,8 @@
theKernel(0, ARCH_NUMBER);
SerialOutputString("Hey, the kernel returned! This should not happen.\n");
+
+ return 0;
}
static char boothelp[] = "boot [kernel options]\n"
|
|
From: Erik M. <er...@us...> - 2001-09-23 14:57:03
|
Update of /cvsroot/blob/blob/src In directory usw-pr-cvs1:/tmp/cvs-serv13554 Modified Files: clock.c Log Message: I'm not exactly sure what the operator precedence is, but this is what I mean. Index: clock.c =================================================================== RCS file: /cvsroot/blob/blob/src/clock.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- clock.c 2001/09/18 19:55:29 1.4 +++ clock.c 2001/09/23 14:57:00 1.5 @@ -79,7 +79,7 @@ if((i = MyXDigitValue(*str)) < 0) return -1; - *value = *value << 4 | i; + *value = (*value << 4) | i; } return 0; |
|
From: Erik M. <er...@us...> - 2001-09-23 13:20:34
|
Update of /cvsroot/blob/blob/src In directory usw-pr-cvs1:/tmp/cvs-serv27521 Added Files: memsetup-sa1100.S memsetup-sa1110.S Log Message: Commit empty files so the changes will be better visible. I'm going to split up the SA1100 and SA1110 memory setup code into two files to make the code cleaner. --- NEW FILE memsetup-sa1100.S --- --- NEW FILE memsetup-sa1110.S --- |
|
From: Erik M. <er...@us...> - 2001-09-18 20:23:26
|
Update of /cvsroot/blob/blob/src
In directory usw-pr-cvs1:/tmp/cvs-serv22423/src
Modified Files:
main.c
Log Message:
Download() and Flash() also converted to the new command system
Index: main.c
===================================================================
RCS file: /cvsroot/blob/blob/src/main.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- main.c 2001/09/18 19:55:29 1.12
+++ main.c 2001/09/18 20:23:24 1.13
@@ -54,8 +54,6 @@
-void Download(char *commandline);
-void Flash(char *commandline);
static int do_reload(char *what);
static void PrintSerialSpeed(eBauds speed);
@@ -173,11 +171,7 @@
numRead = GetCommand(commandline, MAX_COMMANDLINE_LENGTH, 600);
if(numRead > 0) {
- if(strncmp(commandline, "download ", 9) == 0) {
- Download(commandline + 9);
- } else if(strncmp(commandline, "flash ", 6) == 0) {
- Flash(commandline + 6);
- } else if(parse_command(commandline) != 0 ) {
+ if(parse_command(commandline) != 0 ) {
SerialOutputString("*** Unknown command: ");
SerialOutputString(commandline);
SerialOutputByte('\n');
@@ -191,33 +185,40 @@
-void Download(char *commandline)
+static int Download(int argc, char *argv[])
{
u32 startAddress = 0;
int bufLen;
int *numRead = 0;
- if(strncmp(commandline, "blob", 4) == 0) {
+ if(argc < 2) {
+ SerialOutputString("*** not enough parameters\n");
+ /* FIXME: let the command line parser print the error
+ message */
+ return 0;
+ }
+
+ 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(commandline, "param", 5) == 0) {
+ } 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(commandline, "kernel", 6) == 0) {
+ } 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(commandline, "ramdisk", 7) == 0) {
+ } else if(strncmp(argv[1], "ramdisk", 7) == 0) {
/* download ramdisk */
startAddress = RAMDISK_RAM_BASE;
bufLen = blob_status.blockSize - RAMDISK_BLOCK_OFFSET;
@@ -225,9 +226,9 @@
blob_status.ramdiskType = fromDownload;
} else {
SerialOutputString("*** Don't know how to download \"");
- SerialOutputString(commandline);
+ SerialOutputString(argv[1]);
SerialOutputString("\"\n");
- return;
+ return 0;
}
@@ -253,10 +254,10 @@
SerialOutputString("*** Uudecode receive failed\n");
/* reload the correct memory */
- do_reload(commandline);
+ do_reload(argv[1]);
SerialInit(blob_status.terminalSpeed);
- return;
+ return 0;
}
SerialOutputString("Received ");
SerialOutputDec(*numRead);
@@ -266,19 +267,33 @@
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);
-void Flash(char *commandline)
+
+
+static int Flash(int argc, char *argv[])
{
u32 startAddress = 0;
tBlockType block;
int numBytes = 0;
int maxSize = 0;
- if(strncmp(commandline, "blob", 4) == 0) {
+ if(argc < 2) {
+ SerialOutputString("*** not enough parameters\n");
+ /* FIXME: let the command line parser print the error
+ message */
+ return 0;
+ }
+
+ if(strncmp(argv[1], "blob", 4) == 0) {
startAddress = BLOB_RAM_BASE;
block = blBlob;
numBytes = blob_status.blobSize;
@@ -286,12 +301,12 @@
if(blob_status.blobType == fromFlash) {
SerialOutputString("*** No blob downloaded\n");
- return;
+ return 0;
}
SerialOutputString("Saving blob to flash ");
#ifdef PARAM_START
- } else if(strncmp(commandline, "param", 5) == 0) {
+ } else if(strncmp(argv[1], "param", 5) == 0) {
startAddress = PARAM_RAM_BASE;
block = blParam;
numBytes = blob_status.paramSize;
@@ -299,12 +314,12 @@
if(blob_status.paramType == fromFlash) {
SerialOutputString("*** No paramater block downloaded\n");
- return;
+ return 0;
}
SerialOutputString("Saving paramater block to flash ");
#endif
- } else if(strncmp(commandline, "kernel", 6) == 0) {
+ } else if(strncmp(argv[1], "kernel", 6) == 0) {
startAddress = KERNEL_RAM_BASE;
block = blKernel;
numBytes = blob_status.kernelSize;
@@ -312,11 +327,11 @@
if(blob_status.kernelType == fromFlash) {
SerialOutputString("*** No kernel downloaded\n");
- return;
+ return 0;
}
SerialOutputString("Saving kernel to flash ");
- } else if(strncmp(commandline, "ramdisk", 7) == 0) {
+ } else if(strncmp(argv[1], "ramdisk", 7) == 0) {
startAddress = RAMDISK_RAM_BASE;
block = blRamdisk;
numBytes = blob_status.ramdiskSize;
@@ -324,15 +339,15 @@
if(blob_status.ramdiskType == fromFlash) {
SerialOutputString("*** No ramdisk downloaded\n");
- return;
+ return 0;
}
SerialOutputString("Saving ramdisk to flash ");
} else {
SerialOutputString("*** Don't know how to flash \"");
- SerialOutputString(commandline);
+ SerialOutputString(argv[1]);
SerialOutputString("\"\n");
- return;
+ return 0;
}
if(numBytes > maxSize) {
@@ -343,24 +358,27 @@
SerialOutputHex(maxSize);
SerialOutputString(" bytes)\n");
- return;
+ return 0;
}
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 PrintHelp(int argc, char *argv[])
{
-#if 0
- SerialOutputString("* download {blob|param|kernel|ramdisk} Download <argument> image to RAM\n");
- SerialOutputString("* flash {blob|param|kernel|ramdisk} Copy <argument> from RAM to flash\n");
-#endif
commandlist_t *cmd;
/* help on a command? */
|
|
From: Erik M. <er...@us...> - 2001-09-18 19:55:32
|
Update of /cvsroot/blob/blob/src
In directory usw-pr-cvs1:/tmp/cvs-serv15081/src
Modified Files:
Makefile.am clock.c main.c
Log Message:
This patch really shows the elegancy of the new command line system:
clock.c is conditionally compiled and it doesn't need any #ifdef in the
rest of the code.
The changes:
- make clock.c compile conditionally
- get rid of clock.h, it's no longer needed
- cleanup the codestyle in clock.c
- large cleanup in clock.c getting rid of MyIsXDigit()
- remove Johan from the startup messages, his code is now conditionally
Index: Makefile.am
===================================================================
RCS file: /cvsroot/blob/blob/src/Makefile.am,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- Makefile.am 2001/08/31 06:26:59 1.3
+++ Makefile.am 2001/09/18 19:55:29 1.4
@@ -46,11 +46,12 @@
# 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 \
- clock.c \
command.c \
flash.c \
led.c \
@@ -63,12 +64,19 @@
util.c \
uucodec.c
+# conditionally compiled sources
+EXTRA_blob_rest_elf32_SOURCES = \
+ clock.c
+blob_rest_elf32_DEPENDENCIES = \
+ @CLOCK@
+
blob_rest_elf32_LDFLAGS += \
-Wl,-T,${top_srcdir}/src/rest-ld-script
blob_rest_elf32_LDADD += \
+ @CLOCK@ \
-lgcc
Index: clock.c
===================================================================
RCS file: /cvsroot/blob/blob/src/clock.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- clock.c 2001/09/16 15:44:00 1.3
+++ clock.c 2001/09/18 19:55:29 1.4
@@ -35,6 +35,7 @@
# include "config.h"
#endif
+#include "command.h"
#include "types.h"
#include "sa1100.h"
#include "serial.h"
@@ -42,11 +43,6 @@
#include "util.h"
-/* It should be possible to improve this function */
-/* Determine if the given character is a 0 to 9 or a to z,
- these characters can be converted to a hexidecimal number
-*/
-
/* Struct with the SA-1100 PLL + DRAM parameter registers */
enum {
SA_PPCR,
@@ -57,104 +53,80 @@
};
-int MyIsXDigit(char isdigit) {
- if ((isdigit >= '0' && isdigit <= '9' ) ||
- (isdigit >= 'a' && isdigit <= 'f'))
- return 1;
- else
- return 0;
-} /* MyIsXDigit */
-
-int MyXDigitValue(char isdigit) {
- if (isdigit >= '0' && isdigit <= '9' )
- return isdigit - '0';
- if (isdigit >= 'a' && isdigit <= 'f')
- return 10 + isdigit - 'a';
- return -1;
+static int MyXDigitValue(char isdigit)
+{
+ if (isdigit >= '0' && isdigit <= '9' )
+ return isdigit - '0';
+ if (isdigit >= 'a' && isdigit <= 'f')
+ return 10 + isdigit - 'a';
+ return -1;
} /* MyXDigitValue */
-/* Converts 8 characters 0-9a-f into a 4 byte hexadecimal value */
-char *GetHexValue(char *commandline,u32 *value) {
- int i;
-
- if(commandline[0] == '\0') {
- SerialOutputString(__FUNCTION__ ": zero length string\n");
- return(NULL);
- }
-
- *value=0x00;
- if (strncmp(commandline, " 0x", 3) == 0) {
- commandline += 3;
- } else if(commandline[0] == ' ') {
- commandline += 1;
- } else {
- SerialOutputString(__FUNCTION__ ":value not hexdecimal\n");
- return NULL;
- }
-
- SerialOutputString("char: ");
- SerialOutputString(commandline);
- SerialOutputByte(' ');
-
- for (i=0; i<8;i++) {
- if (*commandline == '\0') {
- SerialOutputString(__FUNCTION__ ":hex value not 32 bits\n");
- return NULL;
- } else {
- if (MyIsXDigit(*commandline) == 0) {
- SerialOutputString("hex value contains invalid characters\n");
- return NULL;
- } else {
- *value |= (u32) MyXDigitValue(*commandline) << ((7-i)*4);
- }
- }
-
- commandline++;
- }
-
- SerialOutputString("hex 0x");
- SerialOutputHex(*value);
- SerialOutputByte('\r');
- return commandline;
+/* Converts hex string into value. no, we don't care if the string is
+ too long */
+static int GetHexValue(char *str, u32 *value)
+{
+ int i;
+
+ /* skip any leading 0x */
+ if(strncmp(str, "0x", 2) == 0)
+ str += 2;
+
+ *value=0x00;
+
+ while(*str != '\0') {
+ if((i = MyXDigitValue(*str)) < 0)
+ return -1;
+
+ *value = *value << 4 | i;
+ }
+
+ return 0;
} /* GetHexValue */
+
-void SetClock(char *commandline) {
-int i;
-u32 regs[5];
-u32 startTime, currentTime;
-
- for(i = 0; i < 5; i++) {
- commandline = GetHexValue(commandline, ®s[i]);
-
-#warning "FIXME: GetHexValue() returns NULL after the fifth call..."
-
- if((commandline == NULL) && (i != 4)) {
- SerialOutputString(__FUNCTION__ ": can't get hex values\n");
- return;
- }
- }
-
-#if 0
- printf (" write %lx to %x \n",regs[SA_PPCR], _PPCR);
- printf (" write %lx to %x \n",regs[SA_MDCNFG], _MDCNFG);
- printf (" write %lx to %x \n",regs[SA_MDCAS0], _MDCAS0);
- printf (" write %lx to %x \n",regs[SA_MDCAS1], _MDCAS1);
- printf (" write %lx to %x \n",regs[SA_MDCAS2], _MDCAS2);
-#endif
- /* 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;
- }
+int SetClock(int argc, char *argv[])
+{
+ int i;
+ u32 regs[5];
+ u32 startTime, currentTime;
+
+ if(argc < 6) {
+ /* FIXME: command loop should print error messages */
+ SerialOutputString("*** not enough arguments\n");
+ return 0;
+ }
+
+ for(i = 0; i < 5; i++) {
+ if(GetHexValue(argv[i + 1], ®s[i]) < 0) {
+ SerialOutputString("*** not a hexidecimal number: ");
+ SerialOutputString(argv[i + 1]);
+ SerialOutputByte('\n');
+ 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);
Index: main.c
===================================================================
RCS file: /cvsroot/blob/blob/src/main.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- main.c 2001/09/17 00:05:31 1.11
+++ main.c 2001/09/18 19:55:29 1.12
@@ -38,7 +38,6 @@
# include "config.h"
#endif
-#include "clock.h"
#include "command.h"
#include "flash.h"
#include "led.h"
@@ -109,9 +108,7 @@
SerialOutputString("\nConsider yourself LARTed!\n\n");
SerialOutputString(PACKAGE " version " VERSION "\n"
"Copyright (C) 1999 2000 2001 "
- "Jan-Derk Bakker and Erik Mouw\n"
- "Copyright (C) 2000 "
- "Johan Pouwelse\n");
+ "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 "
@@ -176,9 +173,7 @@
numRead = GetCommand(commandline, MAX_COMMANDLINE_LENGTH, 600);
if(numRead > 0) {
- if(strncmp(commandline, "clock", 5) == 0) {
- SetClock(commandline + 5);
- } else if(strncmp(commandline, "download ", 9) == 0) {
+ if(strncmp(commandline, "download ", 9) == 0) {
Download(commandline + 9);
} else if(strncmp(commandline, "flash ", 6) == 0) {
Flash(commandline + 6);
@@ -363,9 +358,6 @@
static int PrintHelp(int argc, char *argv[])
{
#if 0
- SerialOutputString("* clock PPCR MDCNFG MDCAS0 MDCAS1 MDCAS2\n");
- SerialOutputString(" Set the SA1100 core clock and DRAM timings\n");
- SerialOutputString(" (WARNING: dangerous command!)\n");
SerialOutputString("* download {blob|param|kernel|ramdisk} Download <argument> image to RAM\n");
SerialOutputString("* flash {blob|param|kernel|ramdisk} Copy <argument> from RAM to flash\n");
#endif
|
|
From: Erik M. <er...@us...> - 2001-09-18 19:55:31
|
Update of /cvsroot/blob/blob/include In directory usw-pr-cvs1:/tmp/cvs-serv15081/include Modified Files: Makefile.am Removed Files: clock.h Log Message: This patch really shows the elegancy of the new command line system: clock.c is conditionally compiled and it doesn't need any #ifdef in the rest of the code. The changes: - make clock.c compile conditionally - get rid of clock.h, it's no longer needed - cleanup the codestyle in clock.c - large cleanup in clock.c getting rid of MyIsXDigit() - remove Johan from the startup messages, his code is now conditionally Index: Makefile.am =================================================================== RCS file: /cvsroot/blob/blob/include/Makefile.am,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- Makefile.am 2001/09/15 20:03:32 1.3 +++ Makefile.am 2001/09/18 19:55:29 1.4 @@ -12,7 +12,6 @@ noinst_HEADERS = \ - clock.h \ command.h \ flash.h \ led.h \ --- clock.h DELETED --- |
|
From: Erik M. <er...@us...> - 2001-09-18 19:55:31
|
Update of /cvsroot/blob/blob
In directory usw-pr-cvs1:/tmp/cvs-serv15081
Modified Files:
configure.in
Log Message:
This patch really shows the elegancy of the new command line system:
clock.c is conditionally compiled and it doesn't need any #ifdef in the
rest of the code.
The changes:
- make clock.c compile conditionally
- get rid of clock.h, it's no longer needed
- cleanup the codestyle in clock.c
- large cleanup in clock.c getting rid of MyIsXDigit()
- remove Johan from the startup messages, his code is now conditionally
Index: configure.in
===================================================================
RCS file: /cvsroot/blob/blob/configure.in,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- configure.in 2001/09/16 15:44:00 1.7
+++ configure.in 2001/09/18 19:55:29 1.8
@@ -75,13 +75,13 @@
AC_DEFINE(USE_SDRAM)
AC_DEFINE(USE_SERIAL1)
;;
-
brutus)
AC_MSG_RESULT(Brutus)
AC_DEFINE(BRUTUS)
AC_DEFINE(USE_SA1100)
AC_DEFINE(USE_EDODRAM)
AC_DEFINE(USE_SERIAL3)
+ CLOCK="clock.o"
;;
creditlart)
AC_MSG_RESULT(CreditLART)
@@ -96,6 +96,7 @@
AC_DEFINE(USE_SA1100)
AC_DEFINE(USE_EDODRAM)
AC_DEFINE(USE_SERIAL3)
+ CLOCK="clock.o"
;;
nesa)
AC_MSG_RESULT(NESA)
@@ -103,6 +104,7 @@
AC_DEFINE(USE_SA1100)
AC_DEFINE(USE_EDODRAM)
AC_DEFINE(USE_SERIAL3)
+ CLOCK="clock.o"
;;
pleb)
AC_MSG_RESULT(PLEB)
@@ -110,6 +112,7 @@
AC_DEFINE(USE_SA1100)
AC_DEFINE(USE_EDODRAM)
AC_DEFINE(USE_SERIAL3)
+ CLOCK="clock.o"
;;
shannon)
AC_MSG_RESULT(SHANNON)
@@ -117,6 +120,7 @@
AC_DEFINE(USE_SA1100)
AC_DEFINE(USE_EDODRAM)
AC_DEFINE(USE_SERIAL3)
+ CLOCK="clock.o"
;;
*)
AC_MSG_RESULT(unknown)
@@ -124,9 +128,10 @@
AC_DEFINE(USE_SA1100)
AC_DEFINE(USE_EDODRAM)
AC_DEFINE(USE_SERIAL3)
+ CLOCK="clock.o"
;;
esac
-
+AC_SUBST(CLOCK)
dnl Find out where the Linux headers are
AC_ARG_WITH(linux-prefix,[ --with-linux-prefix=PFX Prefix where the ArmLinux sources live],
|
|
From: Erik M. <er...@us...> - 2001-09-18 19:45:32
|
Update of /cvsroot/blob/blob/utils/mkparamblock
In directory usw-pr-cvs1:/tmp/cvs-serv13555
Modified Files:
Makefile.am
Log Message:
Forgot to include a list of source files
Index: Makefile.am
===================================================================
RCS file: /cvsroot/blob/blob/utils/mkparamblock/Makefile.am,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- Makefile.am 2001/09/14 23:02:21 1.1
+++ Makefile.am 2001/09/18 19:45:29 1.2
@@ -6,6 +6,9 @@
bin_PROGRAMS = \
mkparamblock
+mkparamblock_SOURCES = \
+ mkparamblock.c
+
mkparamblock: mkparamblock.c
gcc -Wall -O2 -I${top_builddir}/include -I${top_srcdir}/include -o $@ $<
|
|
From: Erik M. <er...@us...> - 2001-09-17 00:05:34
|
Update of /cvsroot/blob/blob/src
In directory usw-pr-cvs1:/tmp/cvs-serv8549/src
Modified Files:
command.c linux.c main.c util.c
Log Message:
The new command line stuff. Most of the commands are converted, only
a couple of them still need to be done. Anyway, it makes the code a lot
easier and smaller.
Index: command.c
===================================================================
RCS file: /cvsroot/blob/blob/src/command.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- command.c 2001/09/16 15:44:00 1.5
+++ command.c 2001/09/17 00:05:31 1.6
@@ -11,7 +11,7 @@
/*
* command.c: Command line functions for blob
*
- * Copyright (C) 1999 Erik Mouw (J.A...@it...)
+ * 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
@@ -48,12 +48,12 @@
/* the first command */
-static commandlist_t *commands;
-static commandlist_t *lastcommand;
+commandlist_t *commands;
void init_commands(void)
{
+ commandlist_t *lastcommand;
commandlist_t *cmd, *next_cmd;
commands = (commandlist_t *) &__commandlist_start;
@@ -74,9 +74,60 @@
-static int parse_args(char *cmdline, int *argc, char **argv)
+#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++) {
+ SerialOutputString("*** argv[");
+ SerialOutputDec(i);
+ SerialOutputString("] = ");
+ SerialOutputString(argv[i]);
+ SerialOutputByte('\n');
+ }
+#endif
}
@@ -85,19 +136,19 @@
int parse_command(char *cmdline)
{
commandlist_t *cmd;
- int len;
+ int argc;
+ char *argv[MAX_ARGS];
- for(cmd = commands; cmd != NULL; cmd = cmd->next) {
- if(cmd->magic != COMMAND_MAGIC) {
- SerialOutputString("*** Invalid command list entry\n");
- return -1;
- }
+ parse_args(cmdline, &argc, argv);
+
+ /* only whitespace */
+ if(argc == 0)
+ return 0;
- len = strlen(cmd->name);
-
- if(strncmp(cmd->name, cmdline, len) == 0) {
+ for(cmd = commands; cmd != NULL; cmd = cmd->next) {
+ if(strcmp(cmd->name, cmdline) == 0) {
/* call function */
- return cmd->callback(1, cmdline);
+ return cmd->callback(argc, argv);
}
}
@@ -107,30 +158,32 @@
-static int foo(int argc, char *argv[])
+static int test_command(int argc, char *argv[])
{
- SerialOutputString("*** foo() got called!\n");
- return 0;
-}
-
+ int i;
-static char fooname[] = "foo";
-static char foohelp[] = "foo help";
+ SerialOutputString("*** test_command() got called!\n");
-__commandlist(foo, fooname, foohelp);
-
-
+ SerialOutputString("*** argc = ");
+ SerialOutputDec(argc);
+ SerialOutputByte('\n');
+
+ for(i = 0; i < argc; i++) {
+ SerialOutputString("*** argv[");
+ SerialOutputDec(i);
+ SerialOutputString("] = '");
+ SerialOutputString(argv[i]);
+ SerialOutputString("'\n");
+ }
-static int bar(int argc, char *argv[])
-{
- SerialOutputString("*** bar() got called!\n");
return 0;
}
-__commandlist(bar, "bar", "bar help");
-
+static char testhelp[] = "test_command\n"
+"Test new command line functions\n";
+__commandlist(test_command, "test", testhelp);
Index: linux.c
===================================================================
RCS file: /cvsroot/blob/blob/src/linux.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- linux.c 2001/08/31 06:26:59 1.4
+++ linux.c 2001/09/17 00:05:31 1.5
@@ -26,6 +26,7 @@
#endif
#include "linux.h"
+#include "command.h"
#include "main.h"
#include "flash.h"
#include "memory.h"
@@ -37,7 +38,7 @@
static void setup_start_tag(void);
static void setup_memory_tags(void);
-static void setup_commandline_tag(char *commandline);
+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);
@@ -46,14 +47,14 @@
static struct tag *params;
-void boot_linux(char *commandline)
+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(commandline);
+ setup_commandline_tag(argc, argv);
setup_initrd_tag();
setup_ramdisk_tag();
setup_end_tag();
@@ -74,7 +75,12 @@
SerialOutputString("Hey, the kernel returned! This should not happen.\n");
}
+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;
@@ -108,29 +114,39 @@
}
-static void setup_commandline_tag(char *commandline)
+static void setup_commandline_tag(int argc, char *argv[])
{
char *p;
-
- /* eat leading white space */
- for(p = commandline; *p == ' '; p++)
- ;
-
- /* skip non-existent command lines so the kernel will still
- * use its default command line.
- */
- if(*p == '\0') {
- if(*blob_status.cmdline != '\0')
- p = blob_status.cmdline;
- else return;
- }
+ int i;
- params->hdr.tag = ATAG_CMDLINE;
- params->hdr.size = (sizeof(struct tag_header) + strlen(p) + 1 + 4) >> 2;
+ /* initialise commandline */
+ params->u.cmdline.cmdline[0] = '\0';
- strcpy(params->u.cmdline.cmdline, p);
+ /* 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';
+ }
- params = tag_next(params);
+ 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);
+ }
}
Index: main.c
===================================================================
RCS file: /cvsroot/blob/blob/src/main.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- main.c 2001/09/16 15:44:00 1.10
+++ main.c 2001/09/17 00:05:31 1.11
@@ -57,14 +57,8 @@
void Download(char *commandline);
void Flash(char *commandline);
-void PrintHelp(void);
-void SetDownloadSpeed(char *commandline);
-void PrintStatus(void);
-void ResetTerminal(void);
-void Reload(char *commandline);
-void PrintSerialSpeed(eBauds speed);
-void Reboot(void);
-void Reblob(void);
+static int do_reload(char *what);
+static void PrintSerialSpeed(eBauds speed);
@@ -78,7 +72,7 @@
{
u32 blockSize = 0x00800000;
int numRead = 0;
- char commandline[128];
+ char commandline[MAX_COMMANDLINE_LENGTH];
int i;
int retval = 0;
u32 conf;
@@ -125,20 +119,22 @@
SerialOutputString("under certain conditions; "
"read the GNU GPL for details.\n");
- init_commands();
-
/* get the amount of memory */
get_memory_map();
+ /* initialise command line parser */
+ init_commands();
+
/* 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 */
- Reload("blob");
- Reload("kernel");
- if(blob_status.load_ramdisk) Reload("ramdisk");
+ do_reload("blob");
+ do_reload("kernel");
+ if(blob_status.load_ramdisk)
+ do_reload("ramdisk");
#ifdef BLOB_DEBUG
/* print some information */
@@ -166,7 +162,7 @@
/* no key was pressed, so proceed booting the kernel */
if(retval == 0) {
commandline[0] = '\0';
- boot_linux(commandline);
+ boot_linux(0, NULL);
}
SerialOutputString("\nAutoboot aborted\n");
@@ -177,32 +173,15 @@
DisplayPrompt(NULL);
/* wait 10 minutes for a command */
- numRead = GetCommand(commandline, 128, 600);
+ numRead = GetCommand(commandline, MAX_COMMANDLINE_LENGTH, 600);
if(numRead > 0) {
- if(strncmp(commandline, "boot", 4) == 0) {
- boot_linux(commandline + 4);
- } else if(strncmp(commandline, "clock", 5) == 0) {
+ if(strncmp(commandline, "clock", 5) == 0) {
SetClock(commandline + 5);
} else if(strncmp(commandline, "download ", 9) == 0) {
Download(commandline + 9);
} else if(strncmp(commandline, "flash ", 6) == 0) {
Flash(commandline + 6);
- } else if(strncmp(commandline, "help", 4) == 0) {
- PrintHelp();
- } else if(strncmp(commandline, "reblob", 6) == 0) {
- Reblob();
- } else if(strncmp(commandline, "reboot", 6) == 0) {
- Reboot();
- } else if(strncmp(commandline, "reload ", 7) == 0) {
- Reload(commandline + 7);
- } else if(strncmp(commandline, "reset", 5) == 0) {
- ResetTerminal();
- } else if(strncmp(commandline, "speed ", 6) == 0) {
- SetDownloadSpeed(commandline + 6);
- }
- else if(strncmp(commandline, "status", 6) == 0) {
- PrintStatus();
} else if(parse_command(commandline) != 0 ) {
SerialOutputString("*** Unknown command: ");
SerialOutputString(commandline);
@@ -279,7 +258,7 @@
SerialOutputString("*** Uudecode receive failed\n");
/* reload the correct memory */
- Reload(commandline);
+ do_reload(commandline);
SerialInit(blob_status.terminalSpeed);
return;
@@ -381,61 +360,97 @@
-void PrintHelp(void)
+static int PrintHelp(int argc, char *argv[])
{
- SerialOutputString("Help for " PACKAGE " " VERSION ", the LART bootloader\n");
- SerialOutputString("The following commands are supported:\n");
- SerialOutputString("* boot [kernel options] Boot Linux with optional kernel options\n");
+#if 0
SerialOutputString("* clock PPCR MDCNFG MDCAS0 MDCAS1 MDCAS2\n");
SerialOutputString(" Set the SA1100 core clock and DRAM timings\n");
SerialOutputString(" (WARNING: dangerous command!)\n");
SerialOutputString("* download {blob|param|kernel|ramdisk} Download <argument> image to RAM\n");
SerialOutputString("* flash {blob|param|kernel|ramdisk} Copy <argument> from RAM to flash\n");
- SerialOutputString("* help Get this help\n");
- SerialOutputString("* reblob Restart blob from RAM\n");
- SerialOutputString("* reboot Reboot system\n");
- SerialOutputString("* reload {blob|param|kernel|ramdisk} Reload <argument> from flash to RAM\n");
- SerialOutputString("* reset Reset terminal\n");
- SerialOutputString("* speed Set download speed\n");
- SerialOutputString("* status Display current status\n");
+#endif
+ 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;
+ }
+ }
+
+ SerialOutputString("*** Can't find help for '");
+ SerialOutputString(argv[1]);
+ SerialOutputString("'\n");
+ return 0;
+ }
+
+ /* generic help */
+ SerialOutputString("Help for " PACKAGE " " VERSION ", the LART 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(PrintHelp, "help", helphelp);
-void SetDownloadSpeed(char *commandline)
+
+static int SetDownloadSpeed(int argc, char *argv[])
{
- if(strncmp(commandline, "1200", 4) == 0) {
+ if(argc < 2) {
+ /* FIXME: return -EINVAL and let the command line
+ stuff print the error */
+ SerialOutputString("*** not enough parameters\n");
+ return 0;
+ }
+
+ if(strcmp(argv[1], "1200") == 0) {
blob_status.downloadSpeed = baud1k2;
- } else if(strncmp(commandline, "1k2", 3) == 0) {
+ } else if(strcmp(argv[1], "1k2") == 0) {
blob_status.downloadSpeed = baud1k2;
- } else if(strncmp(commandline, "9600", 4) == 0) {
+ } else if(strcmp(argv[1], "9600") == 0) {
blob_status.downloadSpeed = baud9k6;
- } else if(strncmp(commandline, "9k6", 3) == 0) {
+ } else if(strcmp(argv[1], "9k6") == 0) {
blob_status.downloadSpeed = baud9k6;
- } else if(strncmp(commandline, "19200", 5) == 0) {
+ } else if(strcmp(argv[1], "19200") == 0) {
blob_status.downloadSpeed = baud19k2;
- } else if(strncmp(commandline, "19k2", 4) == 0) {
+ } else if(strcmp(argv[1], "19k2") == 0) {
blob_status.downloadSpeed = baud19k2;
- } else if(strncmp(commandline, "38400", 5) == 0) {
+ } else if(strcmp(argv[1], "38400") == 0) {
blob_status.downloadSpeed = baud38k4;
- } else if(strncmp(commandline, "38k4", 4) == 0) {
+ } else if(strcmp(argv[1], "38k4") == 0) {
blob_status.downloadSpeed = baud38k4;
- } else if(strncmp(commandline, "57600", 5) == 0) {
+ } else if(strcmp(argv[1], "57600") == 0) {
blob_status.downloadSpeed = baud57k6;
- } else if(strncmp(commandline, "57k6", 4) == 0) {
+ } else if(strcmp(argv[1], "57k6") == 0) {
blob_status.downloadSpeed = baud57k6;
- } else if(strncmp(commandline, "115200", 6) == 0) {
+ } else if(strcmp(argv[1], "115200") == 0) {
blob_status.downloadSpeed = baud115k2;
- } else if(strncmp(commandline, "115k2", 5) == 0) {
+ } else if(strcmp(argv[1], "115k2") == 0) {
blob_status.downloadSpeed = baud115k2;
- } else if(strncmp(commandline, "230400", 6) == 0) {
+ } else if(strcmp(argv[1], "230400") == 0) {
blob_status.downloadSpeed = baud230k4;
- } else if(strncmp(commandline, "230k4", 5) == 0) {
+ } else if(strcmp(argv[1], "230k4") == 0) {
blob_status.downloadSpeed = baud230k4;
} else {
SerialOutputString("*** Invalid download speed value \"");
- SerialOutputString(commandline);
+ SerialOutputString(argv[1]);
SerialOutputString("\"\n*** Valid values are:\n");
SerialOutputString("*** 1200, 9600, 19200, 38400, 57600, 115200, 230400\n");
SerialOutputString("*** 1k2, 9k6, 19k2, 38k4, 57k6, 115k2, and 230k4\n");
@@ -444,12 +459,19 @@
SerialOutputString("Download speed set to ");
PrintSerialSpeed(blob_status.downloadSpeed);
SerialOutputString(" baud\n");
+
+ return 0;
}
+static char speedhelp[] = "speed\n"
+"Set download speed\n";
+
+__commandlist(SetDownloadSpeed, "speed", speedhelp);
+
-void PrintStatus(void)
+static int PrintStatus(int argc, char *argv[])
{
SerialOutputString("Bootloader : " PACKAGE "\n");
SerialOutputString("Version : " VERSION "\n");
@@ -467,7 +489,7 @@
PrintSerialSpeed(blob_status.downloadSpeed);
SerialOutputString(" baud\n");
- SerialOutputString("\nTerminal speed: ");
+ SerialOutputString("Terminal speed: ");
PrintSerialSpeed(blob_status.terminalSpeed);
SerialOutputString(" baud\n");
@@ -510,12 +532,19 @@
SerialOutputDec(blob_status.ramdiskSize);
SerialOutputString(" bytes\n");
}
+
+ return 0;
}
+static char statushelp[] = "status\n"
+"Display current status\n";
+
+__commandlist(PrintStatus, "status", statushelp);
-void ResetTerminal(void)
+
+static int ResetTerminal(int argc, char *argv[])
{
int i;
@@ -525,18 +554,25 @@
SerialOutputByte('\n');
SerialOutputString("c");
+
+ return 0;
}
+static char resethelp[] = "reset\n"
+"Reset terminal\n";
+
+__commandlist(ResetTerminal, "reset", resethelp);
-void Reload(char *commandline)
+
+static int do_reload(char *what)
{
u32 *src = 0;
u32 *dst = 0;
int numWords;
- if(strncmp(commandline, "blob", 4) == 0) {
+ if(strcmp(what, "blob") == 0) {
src = (u32 *)BLOB_RAM_BASE;
dst = (u32 *)BLOB_START;
numWords = BLOB_LEN / 4;
@@ -544,7 +580,7 @@
blob_status.blobType = fromFlash;
SerialOutputString("Loading blob from flash ");
#ifdef PARAM_START
- } else if(strncmp(commandline, "param", 6) == 0) {
+ } else if(strcmp(what, "param") == 0) {
src = (u32 *)PARAM_RAM_BASE;
dst = (u32 *)PARAM_START;
numWords = PARAM_LEN / 4;
@@ -552,14 +588,14 @@
blob_status.paramType = fromFlash;
SerialOutputString("Loading paramater block from flash ");
#endif
- } else if(strncmp(commandline, "kernel", 6) == 0) {
+ } else if(strcmp(what, "kernel") == 0) {
src = (u32 *)KERNEL_RAM_BASE;
dst = (u32 *)KERNEL_START;
numWords = KERNEL_LEN / 4;
blob_status.kernelSize = 0;
blob_status.kernelType = fromFlash;
SerialOutputString("Loading kernel from flash ");
- } else if(strncmp(commandline, "ramdisk", 7) == 0) {
+ } else if(strcmp(what, "ramdisk") == 0) {
src = (u32 *)RAMDISK_RAM_BASE;
dst = (u32 *)INITRD_START;
numWords = INITRD_LEN / 4;
@@ -568,19 +604,41 @@
SerialOutputString("Loading ramdisk from flash ");
} else {
SerialOutputString("*** Don't know how to reload \"");
- SerialOutputString(commandline);
+ SerialOutputString(what);
SerialOutputString("\"\n");
- return;
+ return 0;
}
MyMemCpy(src, dst, numWords);
SerialOutputString(" done\n");
+
+ return 0;
+}
+
+
+
+
+static int Reload(int argc, char *argv[])
+{
+ if(argc < 2) {
+ /* FIXME: return -EINVAL and let the command line
+ stuff print the error */
+ SerialOutputString("*** not enough parameters\n");
+ return 0;
+ }
+
+ return do_reload(argv[1]);
}
+static char reloadhelp[] = "reload {blob|param|kernel|ramdisk}\n"
+"Reload <argument> from flash to RAM\n";
+
+__commandlist(Reload, "reload", reloadhelp);
-void PrintSerialSpeed(eBauds speed)
+
+static void PrintSerialSpeed(eBauds speed)
{
switch(speed) {
case baud1k2:
@@ -620,7 +678,7 @@
-void Reboot(void)
+static int Reboot(int argc, char *argv[])
{
SerialOutputString("Rebooting...\n\n");
@@ -628,12 +686,20 @@
RCSR = 0;
RSRR = 1;
+
+ /* never reached, but anyway... */
+ return 0;
}
+static char reboothelp[] = "reboot\n"
+"Reboot system\n";
+
+__commandlist(Reboot, "reboot", reboothelp);
-void Reblob(void)
+
+int Reblob(int argc, char *argv[])
{
void (*blob)(void) = (void (*)(void))BLOB_RAM_BASE;
@@ -642,4 +708,12 @@
msleep(500);
blob();
+
+ /* never reached, but anyway... */
+ return 0;
}
+
+static char reblobhelp[] = "reblob\n"
+"Restart blob from RAM\n";
+
+__commandlist(Reblob, "reblob", reblobhelp);
Index: util.c
===================================================================
RCS file: /cvsroot/blob/blob/src/util.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- util.c 2001/09/16 15:44:00 1.4
+++ util.c 2001/09/17 00:05:31 1.5
@@ -119,6 +119,8 @@
}
+
+
char *strcpy(char *dest, const char *src)
{
while(*src != '\0')
|
|
From: Erik M. <er...@us...> - 2001-09-17 00:05:33
|
Update of /cvsroot/blob/blob/include
In directory usw-pr-cvs1:/tmp/cvs-serv8549/include
Modified Files:
command.h linux.h
Log Message:
The new command line stuff. Most of the commands are converted, only
a couple of them still need to be done. Anyway, it makes the code a lot
easier and smaller.
Index: command.h
===================================================================
RCS file: /cvsroot/blob/blob/include/command.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- command.h 2001/09/15 20:14:23 1.2
+++ command.h 2001/09/17 00:05:31 1.3
@@ -54,17 +54,21 @@
#define __command __attribute__((unused, __section__(".commandlist")))
#define __commandlist(fn, nm, hlp) \
-static commandlist_t __commandlist_##fn __command = { \
+static commandlist_t __command_##fn __command = { \
magic: COMMAND_MAGIC, \
name: nm, \
help: hlp, \
callback: fn }
-
+
+extern commandlist_t *commands;
+
void init_commands(void);
int parse_command(char *cmdline);
+#define MAX_COMMANDLINE_LENGTH (128)
+#define MAX_ARGS (MAX_COMMANDLINE_LENGTH / 4)
void DisplayPrompt(char *prompt);
int GetCommand(char *command, int len, int timeout);
Index: linux.h
===================================================================
RCS file: /cvsroot/blob/blob/include/linux.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- linux.h 2001/08/06 22:44:52 1.2
+++ linux.h 2001/09/17 00:05:31 1.3
@@ -52,7 +52,7 @@
#endif
-void boot_linux(char *commandline);
+int boot_linux(int argc, char *argv[]);
#endif
|
|
From: Erik M. <J.A...@IT...> - 2001-09-16 15:48:51
|
On Sun, Sep 16, 2001 at 08:44:02AM -0700, Erik Mouw wrote: > Log Message: > Cleanup: s/MyStrNCmp/strncmp/ > Also had to add -fno-builtin to the compiler flags cause strncmp seems to be > a builtin function in gcc-3.0. Forget to tell about another cleanup: get rid of MyToUpper() and MyToLower() because they aren't used anyway. Erik -- J.A.K. (Erik) Mouw, Information and Communication Theory Group, Department of Electrical Engineering, Faculty of Information Technology and Systems, Delft University of Technology, PO BOX 5031, 2600 GA Delft, The Netherlands Phone: +31-15-2783635 Fax: +31-15-2781843 Email: J.A...@it... WWW: http://www-ict.its.tudelft.nl/~erik/ |
|
From: Erik M. <er...@us...> - 2001-09-16 15:44:02
|
Update of /cvsroot/blob/blob/src
In directory usw-pr-cvs1:/tmp/cvs-serv6125/src
Modified Files:
clock.c command.c main.c util.c uucodec.c
Log Message:
Cleanup: s/MyStrNCmp/strncmp/
Also had to add -fno-builtin to the compiler flags cause strncmp seems to be
a builtin function in gcc-3.0.
Index: clock.c
===================================================================
RCS file: /cvsroot/blob/blob/src/clock.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- clock.c 2001/08/06 22:44:52 1.2
+++ clock.c 2001/09/16 15:44:00 1.3
@@ -83,7 +83,7 @@
}
*value=0x00;
- if (MyStrNCmp(commandline, " 0x", 3) == 0) {
+ if (strncmp(commandline, " 0x", 3) == 0) {
commandline += 3;
} else if(commandline[0] == ' ') {
commandline += 1;
Index: command.c
===================================================================
RCS file: /cvsroot/blob/blob/src/command.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- command.c 2001/09/15 20:35:52 1.4
+++ command.c 2001/09/16 15:44:00 1.5
@@ -46,62 +46,58 @@
extern u32 __commandlist_end;
-#if 0
-/* the last command in the list */
-static commandlist_t __command last_command = {
- callback: NULL,
-};
-#endif
-
/* the first command */
static commandlist_t *commands;
static commandlist_t *lastcommand;
+
void init_commands(void)
{
- SerialOutputString("Command list start: 0x");
- SerialOutputHex((unsigned int) &__commandlist_start);
- SerialOutputString("\nCommand list end: 0x");
- SerialOutputHex((unsigned int) &__commandlist_end);
- SerialOutputByte('\n');
+ 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++;
+ }
}
+
+
+static int parse_args(char *cmdline, int *argc, char **argv)
+{
+
+}
+
+
+
+
int parse_command(char *cmdline)
{
commandlist_t *cmd;
int len;
-
- SerialOutputString("*** " __FUNCTION__ " called\n");
- for(cmd = commands; cmd != lastcommand; cmd++) {
+ for(cmd = commands; cmd != NULL; cmd = cmd->next) {
if(cmd->magic != COMMAND_MAGIC) {
SerialOutputString("*** Invalid command list entry\n");
return -1;
}
- if(cmd->callback == NULL) {
- SerialOutputString("*** No callback\n");
- continue;
- }
-
- SerialOutputString("\n*** Trying to match command '");
- SerialOutputString(cmd->name);
- SerialOutputString("'... ");
-
len = strlen(cmd->name);
- if(MyStrNCmp(cmd->name, cmdline, len) == 0) {
- SerialOutputString("yes\n");
-
+ if(strncmp(cmd->name, cmdline, len) == 0) {
/* call function */
return cmd->callback(1, cmdline);
- } else {
- SerialOutputString("no\n");
}
}
@@ -122,9 +118,20 @@
static char foohelp[] = "foo help";
__commandlist(foo, fooname, foohelp);
+
+
+
+static int bar(int argc, char *argv[])
+{
+ SerialOutputString("*** bar() got called!\n");
+ return 0;
+}
+
+
+__commandlist(bar, "bar", "bar help");
+
+
-/* the last command in the list */
-__commandlist(NULL, NULL, NULL);
Index: main.c
===================================================================
RCS file: /cvsroot/blob/blob/src/main.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- main.c 2001/09/15 20:14:23 1.9
+++ main.c 2001/09/16 15:44:00 1.10
@@ -180,28 +180,28 @@
numRead = GetCommand(commandline, 128, 600);
if(numRead > 0) {
- if(MyStrNCmp(commandline, "boot", 4) == 0) {
+ if(strncmp(commandline, "boot", 4) == 0) {
boot_linux(commandline + 4);
- } else if(MyStrNCmp(commandline, "clock", 5) == 0) {
+ } else if(strncmp(commandline, "clock", 5) == 0) {
SetClock(commandline + 5);
- } else if(MyStrNCmp(commandline, "download ", 9) == 0) {
+ } else if(strncmp(commandline, "download ", 9) == 0) {
Download(commandline + 9);
- } else if(MyStrNCmp(commandline, "flash ", 6) == 0) {
+ } else if(strncmp(commandline, "flash ", 6) == 0) {
Flash(commandline + 6);
- } else if(MyStrNCmp(commandline, "help", 4) == 0) {
+ } else if(strncmp(commandline, "help", 4) == 0) {
PrintHelp();
- } else if(MyStrNCmp(commandline, "reblob", 6) == 0) {
+ } else if(strncmp(commandline, "reblob", 6) == 0) {
Reblob();
- } else if(MyStrNCmp(commandline, "reboot", 6) == 0) {
+ } else if(strncmp(commandline, "reboot", 6) == 0) {
Reboot();
- } else if(MyStrNCmp(commandline, "reload ", 7) == 0) {
+ } else if(strncmp(commandline, "reload ", 7) == 0) {
Reload(commandline + 7);
- } else if(MyStrNCmp(commandline, "reset", 5) == 0) {
+ } else if(strncmp(commandline, "reset", 5) == 0) {
ResetTerminal();
- } else if(MyStrNCmp(commandline, "speed ", 6) == 0) {
+ } else if(strncmp(commandline, "speed ", 6) == 0) {
SetDownloadSpeed(commandline + 6);
}
- else if(MyStrNCmp(commandline, "status", 6) == 0) {
+ else if(strncmp(commandline, "status", 6) == 0) {
PrintStatus();
} else if(parse_command(commandline) != 0 ) {
SerialOutputString("*** Unknown command: ");
@@ -223,27 +223,27 @@
int bufLen;
int *numRead = 0;
- if(MyStrNCmp(commandline, "blob", 4) == 0) {
+ if(strncmp(commandline, "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(MyStrNCmp(commandline, "param", 5) == 0) {
+ } else if(strncmp(commandline, "param", 5) == 0) {
/* download kernel */
startAddress = PARAM_RAM_BASE;
bufLen = PARAM_LEN;
numRead = &blob_status.paramSize;
blob_status.paramType = fromDownload;
#endif
- } else if(MyStrNCmp(commandline, "kernel", 6) == 0) {
+ } else if(strncmp(commandline, "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(MyStrNCmp(commandline, "ramdisk", 7) == 0) {
+ } else if(strncmp(commandline, "ramdisk", 7) == 0) {
/* download ramdisk */
startAddress = RAMDISK_RAM_BASE;
bufLen = blob_status.blockSize - RAMDISK_BLOCK_OFFSET;
@@ -304,7 +304,7 @@
int numBytes = 0;
int maxSize = 0;
- if(MyStrNCmp(commandline, "blob", 4) == 0) {
+ if(strncmp(commandline, "blob", 4) == 0) {
startAddress = BLOB_RAM_BASE;
block = blBlob;
numBytes = blob_status.blobSize;
@@ -317,7 +317,7 @@
SerialOutputString("Saving blob to flash ");
#ifdef PARAM_START
- } else if(MyStrNCmp(commandline, "param", 5) == 0) {
+ } else if(strncmp(commandline, "param", 5) == 0) {
startAddress = PARAM_RAM_BASE;
block = blParam;
numBytes = blob_status.paramSize;
@@ -330,7 +330,7 @@
SerialOutputString("Saving paramater block to flash ");
#endif
- } else if(MyStrNCmp(commandline, "kernel", 6) == 0) {
+ } else if(strncmp(commandline, "kernel", 6) == 0) {
startAddress = KERNEL_RAM_BASE;
block = blKernel;
numBytes = blob_status.kernelSize;
@@ -342,7 +342,7 @@
}
SerialOutputString("Saving kernel to flash ");
- } else if(MyStrNCmp(commandline, "ramdisk", 7) == 0) {
+ } else if(strncmp(commandline, "ramdisk", 7) == 0) {
startAddress = RAMDISK_RAM_BASE;
block = blRamdisk;
numBytes = blob_status.ramdiskSize;
@@ -405,33 +405,33 @@
void SetDownloadSpeed(char *commandline)
{
- if(MyStrNCmp(commandline, "1200", 4) == 0) {
+ if(strncmp(commandline, "1200", 4) == 0) {
blob_status.downloadSpeed = baud1k2;
- } else if(MyStrNCmp(commandline, "1k2", 3) == 0) {
+ } else if(strncmp(commandline, "1k2", 3) == 0) {
blob_status.downloadSpeed = baud1k2;
- } else if(MyStrNCmp(commandline, "9600", 4) == 0) {
+ } else if(strncmp(commandline, "9600", 4) == 0) {
blob_status.downloadSpeed = baud9k6;
- } else if(MyStrNCmp(commandline, "9k6", 3) == 0) {
+ } else if(strncmp(commandline, "9k6", 3) == 0) {
blob_status.downloadSpeed = baud9k6;
- } else if(MyStrNCmp(commandline, "19200", 5) == 0) {
+ } else if(strncmp(commandline, "19200", 5) == 0) {
blob_status.downloadSpeed = baud19k2;
- } else if(MyStrNCmp(commandline, "19k2", 4) == 0) {
+ } else if(strncmp(commandline, "19k2", 4) == 0) {
blob_status.downloadSpeed = baud19k2;
- } else if(MyStrNCmp(commandline, "38400", 5) == 0) {
+ } else if(strncmp(commandline, "38400", 5) == 0) {
blob_status.downloadSpeed = baud38k4;
- } else if(MyStrNCmp(commandline, "38k4", 4) == 0) {
+ } else if(strncmp(commandline, "38k4", 4) == 0) {
blob_status.downloadSpeed = baud38k4;
- } else if(MyStrNCmp(commandline, "57600", 5) == 0) {
+ } else if(strncmp(commandline, "57600", 5) == 0) {
blob_status.downloadSpeed = baud57k6;
- } else if(MyStrNCmp(commandline, "57k6", 4) == 0) {
+ } else if(strncmp(commandline, "57k6", 4) == 0) {
blob_status.downloadSpeed = baud57k6;
- } else if(MyStrNCmp(commandline, "115200", 6) == 0) {
+ } else if(strncmp(commandline, "115200", 6) == 0) {
blob_status.downloadSpeed = baud115k2;
- } else if(MyStrNCmp(commandline, "115k2", 5) == 0) {
+ } else if(strncmp(commandline, "115k2", 5) == 0) {
blob_status.downloadSpeed = baud115k2;
- } else if(MyStrNCmp(commandline, "230400", 6) == 0) {
+ } else if(strncmp(commandline, "230400", 6) == 0) {
blob_status.downloadSpeed = baud230k4;
- } else if(MyStrNCmp(commandline, "230k4", 5) == 0) {
+ } else if(strncmp(commandline, "230k4", 5) == 0) {
blob_status.downloadSpeed = baud230k4;
} else {
SerialOutputString("*** Invalid download speed value \"");
@@ -536,7 +536,7 @@
u32 *dst = 0;
int numWords;
- if(MyStrNCmp(commandline, "blob", 4) == 0) {
+ if(strncmp(commandline, "blob", 4) == 0) {
src = (u32 *)BLOB_RAM_BASE;
dst = (u32 *)BLOB_START;
numWords = BLOB_LEN / 4;
@@ -544,7 +544,7 @@
blob_status.blobType = fromFlash;
SerialOutputString("Loading blob from flash ");
#ifdef PARAM_START
- } else if(MyStrNCmp(commandline, "param", 6) == 0) {
+ } else if(strncmp(commandline, "param", 6) == 0) {
src = (u32 *)PARAM_RAM_BASE;
dst = (u32 *)PARAM_START;
numWords = PARAM_LEN / 4;
@@ -552,14 +552,14 @@
blob_status.paramType = fromFlash;
SerialOutputString("Loading paramater block from flash ");
#endif
- } else if(MyStrNCmp(commandline, "kernel", 6) == 0) {
+ } else if(strncmp(commandline, "kernel", 6) == 0) {
src = (u32 *)KERNEL_RAM_BASE;
dst = (u32 *)KERNEL_START;
numWords = KERNEL_LEN / 4;
blob_status.kernelSize = 0;
blob_status.kernelType = fromFlash;
SerialOutputString("Loading kernel from flash ");
- } else if(MyStrNCmp(commandline, "ramdisk", 7) == 0) {
+ } else if(strncmp(commandline, "ramdisk", 7) == 0) {
src = (u32 *)RAMDISK_RAM_BASE;
dst = (u32 *)INITRD_START;
numWords = INITRD_LEN / 4;
Index: util.c
===================================================================
RCS file: /cvsroot/blob/blob/src/util.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- util.c 2001/08/07 17:36:48 1.3
+++ util.c 2001/09/16 15:44:00 1.4
@@ -91,7 +91,7 @@
-int MyStrNCmp(const char *s1, const char *s2, int maxlen)
+int strncmp(const char *s1, const char *s2, int maxlen)
{
int i;
@@ -103,29 +103,9 @@
}
return 0;
-} /* MyStrNCmp */
-
-
-
-
-int MyToUpper(int c)
-{
- if((c >= 'a') && (c <= 'z'))
- c += 'A' - 'a';
-
- return(c);
}
-
-
-int MyToLower(int c)
-{
- if((c >= 'A') && (c <= 'Z'))
- c += 'a' - 'A';
-
- return(c);
-}
int strlen(const char *s)
Index: uucodec.c
===================================================================
RCS file: /cvsroot/blob/blob/src/uucodec.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- uucodec.c 2001/08/06 22:44:52 1.2
+++ uucodec.c 2001/09/16 15:44:00 1.3
@@ -86,7 +86,7 @@
do {
SerialInputString(buf, sizeof(buf), 6);
TEST_MAX_RETRIES;
- } while (MyStrNCmp(buf, "begin ", 6) != 0);
+ } while (strncmp(buf, "begin ", 6) != 0);
/*
SerialOutputString("Bytes received : 0x00000000");
@@ -146,7 +146,7 @@
}
}
SerialOutputByte('\n');
- if (SerialInputString(p = buf, sizeof(buf), 2) == 0 || (MyStrNCmp(buf, "end", 3))) {
+ if (SerialInputString(p = buf, sizeof(buf), 2) == 0 || (strncmp(buf, "end", 3))) {
SerialOutputString("*** No \"end\" line. Aborting.\n");
return(-1);
}
|
|
From: Erik M. <er...@us...> - 2001-09-16 15:44:02
|
Update of /cvsroot/blob/blob/include
In directory usw-pr-cvs1:/tmp/cvs-serv6125/include
Modified Files:
util.h
Log Message:
Cleanup: s/MyStrNCmp/strncmp/
Also had to add -fno-builtin to the compiler flags cause strncmp seems to be
a builtin function in gcc-3.0.
Index: util.h
===================================================================
RCS file: /cvsroot/blob/blob/include/util.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- util.h 2001/08/06 22:44:52 1.2
+++ util.h 2001/09/16 15:44:00 1.3
@@ -40,10 +40,15 @@
void MyMemCpy(u32 *dest, const u32 *src, int numWords);
void MyMemCpyChar(char *dest, const char *src, int numBytes);
void MyMemSet(u32 *dest, const u32 wordToWrite, int numWords);
-int MyStrNCmp(const char *s1, const char *s2, int maxlen);
-int MyToUpper(int c);
-int MyToLower(int c);
+int strncmp(const char *s1, const char *s2, int maxlen);
+
+static inline int strcmp(const char *s1, const char *s2)
+{
+ /* 1024 should be long enough for strings in blob */
+ return strncmp(s1, s2, 1024);
+}
+
int strlen(const char *s);
char *strcpy(char *dest, const char *src);
|
|
From: Erik M. <er...@us...> - 2001-09-16 15:44:02
|
Update of /cvsroot/blob/blob In directory usw-pr-cvs1:/tmp/cvs-serv6125 Modified Files: configure.in Log Message: Cleanup: s/MyStrNCmp/strncmp/ Also had to add -fno-builtin to the compiler flags cause strncmp seems to be a builtin function in gcc-3.0. Index: configure.in =================================================================== RCS file: /cvsroot/blob/blob/configure.in,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- configure.in 2001/09/15 20:55:14 1.6 +++ configure.in 2001/09/16 15:44:00 1.7 @@ -209,7 +209,7 @@ LDFLAGS=`echo $LDFLAGS | sed 's/\ *-g\ */\ /'` dnl Add some StrongARM specific flags -CFLAGS=`echo $CFLAGS -march=armv4 -mtune=strongarm1100 -fomit-frame-pointer -mapcs-32 -nostdinc` +CFLAGS=`echo $CFLAGS -march=armv4 -mtune=strongarm1100 -fomit-frame-pointer -fno-builtin -mapcs-32 -nostdinc` LDFLAGS=`echo $LDFLAGS -static -nostdlib` OCFLAGS="-O binary -R .note -R .comment -S" AC_SUBST(OCFLAGS) |
|
From: Erik M. <er...@us...> - 2001-09-16 15:41:29
|
Update of /cvsroot/blob/blob/utils/build In directory usw-pr-cvs1:/tmp/cvs-serv5666/utils/build Modified Files: .cvsignore Log Message: ... and put some content in them as well. Index: .cvsignore =================================================================== RCS file: /cvsroot/blob/blob/utils/build/.cvsignore,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- .cvsignore 2001/09/16 15:34:52 1.1 +++ .cvsignore 2001/09/16 15:41:26 1.2 @@ -0,0 +1,2 @@ +Makefile.in +Makefile |
|
From: Erik M. <er...@us...> - 2001-09-16 15:41:29
|
Update of /cvsroot/blob/blob/utils/mkparamblock In directory usw-pr-cvs1:/tmp/cvs-serv5666/utils/mkparamblock Modified Files: .cvsignore Log Message: ... and put some content in them as well. Index: .cvsignore =================================================================== RCS file: /cvsroot/blob/blob/utils/mkparamblock/.cvsignore,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- .cvsignore 2001/09/16 15:34:52 1.1 +++ .cvsignore 2001/09/16 15:41:26 1.2 @@ -0,0 +1,3 @@ +Makefile.in +Makefile +mkparamblock |
|
From: Erik M. <er...@us...> - 2001-09-16 15:41:29
|
Update of /cvsroot/blob/blob/tools In directory usw-pr-cvs1:/tmp/cvs-serv5666/tools Modified Files: .cvsignore Log Message: ... and put some content in them as well. Index: .cvsignore =================================================================== RCS file: /cvsroot/blob/blob/tools/.cvsignore,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- .cvsignore 2001/09/16 15:34:52 1.1 +++ .cvsignore 2001/09/16 15:41:25 1.2 @@ -0,0 +1,2 @@ +Makefile.in +Makefile |
|
From: Erik M. <er...@us...> - 2001-09-16 15:41:28
|
Update of /cvsroot/blob/blob/utils In directory usw-pr-cvs1:/tmp/cvs-serv5666/utils Modified Files: .cvsignore Log Message: ... and put some content in them as well. Index: .cvsignore =================================================================== RCS file: /cvsroot/blob/blob/utils/.cvsignore,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- .cvsignore 2001/09/16 15:34:52 1.1 +++ .cvsignore 2001/09/16 15:41:25 1.2 @@ -0,0 +1,2 @@ +Makefile.in +Makefile |
|
From: Erik M. <er...@us...> - 2001-09-16 15:41:28
|
Update of /cvsroot/blob/blob/src In directory usw-pr-cvs1:/tmp/cvs-serv5666/src Modified Files: .cvsignore Log Message: ... and put some content in them as well. Index: .cvsignore =================================================================== RCS file: /cvsroot/blob/blob/src/.cvsignore,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- .cvsignore 2001/09/16 15:34:52 1.1 +++ .cvsignore 2001/09/16 15:41:25 1.2 @@ -0,0 +1,4 @@ +Makefile.in +Makefile +blob* +*.o |
|
From: Erik M. <er...@us...> - 2001-09-16 15:41:28
|
Update of /cvsroot/blob/blob/include In directory usw-pr-cvs1:/tmp/cvs-serv5666/include Modified Files: .cvsignore Log Message: ... and put some content in them as well. Index: .cvsignore =================================================================== RCS file: /cvsroot/blob/blob/include/.cvsignore,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- .cvsignore 2001/09/16 15:34:52 1.1 +++ .cvsignore 2001/09/16 15:41:25 1.2 @@ -0,0 +1,6 @@ +Makefile.in +Makefile +config.h.in +config.h +stamp-h.in +stamp-h |
|
From: Erik M. <er...@us...> - 2001-09-16 15:41:28
|
Update of /cvsroot/blob/blob In directory usw-pr-cvs1:/tmp/cvs-serv5666 Modified Files: .cvsignore Log Message: ... and put some content in them as well. Index: .cvsignore =================================================================== RCS file: /cvsroot/blob/blob/.cvsignore,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- .cvsignore 2001/09/16 15:34:52 1.1 +++ .cvsignore 2001/09/16 15:41:25 1.2 @@ -0,0 +1,7 @@ +aclocal.m4 +configure +config.cache +config.log +config.status +Makefile.in +Makefile |
|
From: Erik M. <er...@us...> - 2001-09-16 15:34:56
|
Update of /cvsroot/blob/blob In directory usw-pr-cvs1:/tmp/cvs-serv4281 Added Files: .cvsignore Log Message: Add a couple of cvsignore files so CVS won't ask questions about generated files. --- NEW FILE .cvsignore --- |
|
From: Erik M. <er...@us...> - 2001-09-16 15:34:55
|
Update of /cvsroot/blob/blob/tools In directory usw-pr-cvs1:/tmp/cvs-serv4281/tools Added Files: .cvsignore Log Message: Add a couple of cvsignore files so CVS won't ask questions about generated files. --- NEW FILE .cvsignore --- |
|
From: Erik M. <er...@us...> - 2001-09-16 15:34:55
|
Update of /cvsroot/blob/blob/src In directory usw-pr-cvs1:/tmp/cvs-serv4281/src Added Files: .cvsignore Log Message: Add a couple of cvsignore files so CVS won't ask questions about generated files. --- NEW FILE .cvsignore --- |