summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/Makefile1
-rw-r--r--tools/bmp_logo.c5
-rw-r--r--tools/easylogo/easylogo.c32
-rw-r--r--tools/env/Makefile1
-rw-r--r--tools/env/fw_env.h4
-rw-r--r--tools/envcrc.c1
-rw-r--r--tools/gdb/remote.c48
-rw-r--r--tools/img2srec.c32
-rw-r--r--tools/scripts/README21
-rw-r--r--tools/scripts/send_cmd1
-rw-r--r--tools/updater/Makefile8
-rw-r--r--tools/updater/cmd_flash.c17
-rw-r--r--tools/updater/flash_hw.c15
-rw-r--r--tools/updater/string.c6
-rw-r--r--tools/updater/update.c2
-rw-r--r--tools/updater/utils.c116
16 files changed, 151 insertions, 159 deletions
diff --git a/tools/Makefile b/tools/Makefile
index 35c60b6..de6f7dd 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -186,4 +186,3 @@ $(LOGO_H): bmp_logo $(LOGO_BMP)
sinclude .depend
#########################################################################
-
diff --git a/tools/bmp_logo.c b/tools/bmp_logo.c
index 54fdcff..2421b82 100644
--- a/tools/bmp_logo.c
+++ b/tools/bmp_logo.c
@@ -68,8 +68,8 @@ int main (int argc, char *argv[])
exit (EXIT_FAILURE);
}
- /*
- * read width and height of the image, and the number of colors used;
+ /*
+ * read width and height of the image, and the number of colors used;
* ignore the rest
*/
skip_bytes (fp, 16);
@@ -174,4 +174,3 @@ int main (int argc, char *argv[])
return (0);
}
-
diff --git a/tools/easylogo/easylogo.c b/tools/easylogo/easylogo.c
index 3111068..cbec70b 100644
--- a/tools/easylogo/easylogo.c
+++ b/tools/easylogo/easylogo.c
@@ -107,7 +107,7 @@ void printlogo_rgb (rgb_t *data, int w, int h)
printf(" ");
else
printf("X");
- printf("\n");
+ printf("\n");
}
}
@@ -121,7 +121,7 @@ void printlogo_yuyv (unsigned short *data, int w, int h)
printf(" ");
else
printf("X");
- printf("\n");
+ printf("\n");
}
}
@@ -134,7 +134,7 @@ int image_load_tga (image_t *image, char *filename)
rgb_t *p ;
if( ( file = fopen( filename, "rb" ) ) == NULL )
- return -1;
+ return -1;
fread(&header, sizeof(header), 1, file);
@@ -146,7 +146,7 @@ int image_load_tga (image_t *image, char *filename)
image->yuyv = 0 ;
image->palette_size = 0 ;
image->palette = NULL ;
- break;
+ break;
default:
printf("Format not supported!\n");
@@ -181,19 +181,19 @@ int image_load_tga (image_t *image, char *filename)
if(!(header.ImageDescriptorByte & 0x20))
{
- unsigned char *temp = malloc(image->size);
- int linesize = image->pixel_size * image->width ;
+ unsigned char *temp = malloc(image->size);
+ int linesize = image->pixel_size * image->width ;
void *dest = image->data,
*source = temp + image->size - linesize ;
- printf("S");
+ printf("S");
if (temp == NULL)
{
printf("Cannot alloc temp buffer!\n");
return -1;
}
- memcpy(temp, image->data, image->size);
+ memcpy(temp, image->data, image->size);
for(i = 0; i<image->height; i++, dest+=linesize, source-=linesize)
memcpy(dest, source, linesize);
@@ -242,7 +242,7 @@ int image_rgb_to_yuyv (image_t *rgb_image, image_t *yuyv_image)
pixel_rgb_to_yuyv (rgb_ptr++, &yuyv);
if ((count & 1)==0) /* Was == 0 */
- memcpy (dest, ((void *)&yuyv) + 2, sizeof(short));
+ memcpy (dest, ((void *)&yuyv) + 2, sizeof(short));
else
memcpy (dest, (void *)&yuyv, sizeof(short));
@@ -346,7 +346,7 @@ int main (int argc, char *argv[])
case 2:
case 3:
case 4:
- strcpy (inputfile, argv[1]);
+ strcpy (inputfile, argv[1]);
if (argc > 2)
strcpy (varname, argv[2]);
@@ -375,14 +375,14 @@ int main (int argc, char *argv[])
sprintf(outputfile, "%s.h", app);
}
}
- break;
+ break;
default:
- printf("EasyLogo 1.0 (C) 2000 by Paolo Scaffardi\n\n");
+ printf("EasyLogo 1.0 (C) 2000 by Paolo Scaffardi\n\n");
- printf("Syntax: easylogo inputfile [outputvar {outputfile}] \n");
- printf("\n");
- printf("Where: 'inputfile' is the TGA image to load\n");
+ printf("Syntax: easylogo inputfile [outputvar {outputfile}] \n");
+ printf("\n");
+ printf("Where: 'inputfile' is the TGA image to load\n");
printf(" 'outputvar' is the variable name to create\n");
printf(" 'outputfile' is the output header file (default is 'inputfile.h')\n");
@@ -398,7 +398,7 @@ int main (int argc, char *argv[])
if (image_load_tga (&rgb_logo, inputfile)<0)
{
printf("input file not found!\n");
- exit(1);
+ exit(1);
}
/* Convert it to YUYV format */
diff --git a/tools/env/Makefile b/tools/env/Makefile
index 7da1d2b..9ce477c 100644
--- a/tools/env/Makefile
+++ b/tools/env/Makefile
@@ -43,4 +43,3 @@ crc32.c:
sinclude .depend
#########################################################################
-
diff --git a/tools/env/fw_env.h b/tools/env/fw_env.h
index 2cc7724..cc2ff09 100644
--- a/tools/env/fw_env.h
+++ b/tools/env/fw_env.h
@@ -21,8 +21,8 @@
* MA 02111-1307 USA
*/
-/*
- * To build the utility with the run-time configuration
+/*
+ * To build the utility with the run-time configuration
* uncomment the next line.
* See included "fw_env.config" sample file (TRAB board)
* for notes on configuration.
diff --git a/tools/envcrc.c b/tools/envcrc.c
index 19fe17c..5f13a63 100644
--- a/tools/envcrc.c
+++ b/tools/envcrc.c
@@ -94,4 +94,3 @@ int main (int argc, char **argv)
#endif
return EXIT_SUCCESS;
}
-
diff --git a/tools/gdb/remote.c b/tools/gdb/remote.c
index b8b2470..f40b6c6 100644
--- a/tools/gdb/remote.c
+++ b/tools/gdb/remote.c
@@ -171,7 +171,7 @@ remote_continue(void)
reply OK for success
ENN for an error
- write reg Pn...=r... Write register n... with value r...,
+ write reg Pn...=r... Write register n... with value r...,
which contains two hex digits for each
byte in the register (target byte
order).
@@ -194,12 +194,12 @@ remote_continue(void)
where only part of the data was
written).
- write mem XAA..AA,LLLL:XX..XX
- (binary) AA..AA is address,
- LLLL is number of bytes,
- XX..XX is binary data
- reply OK for success
- ENN for an error
+ write mem XAA..AA,LLLL:XX..XX
+ (binary) AA..AA is address,
+ LLLL is number of bytes,
+ XX..XX is binary data
+ reply OK for success
+ ENN for an error
continue cAA..AA AA..AA is address to resume
If AA..AA is omitted,
@@ -217,7 +217,7 @@ remote_continue(void)
signal
last signal ? Reply the current reason for stopping.
- This is the same reply as is generated
+ This is the same reply as is generated
for step or cont : SAA where AA is the
signal number.
@@ -256,7 +256,7 @@ remote_continue(void)
the 'N' packet may arrive spontaneously
whereas the 'qOffsets' is a query
initiated by the host debugger.
- or... OXX..XX XX..XX is hex encoding of ASCII data. This
+ or... OXX..XX XX..XX is hex encoding of ASCII data. This
can happen at any time while the
program is running and the debugger
should continue to wait for
@@ -416,7 +416,7 @@ remote_address_masked (CORE_ADDR addr)
&& remote_address_size < (sizeof (ULONGEST) * 8))
{
/* Only create a mask when that mask can safely be constructed
- in a ULONGEST variable. */
+ in a ULONGEST variable. */
ULONGEST mask = 1;
mask = (mask << remote_address_size) - 1;
addr &= mask;
@@ -529,8 +529,8 @@ remote_write_bytes (memaddr, myaddr, len)
*p = '\0';
/* We send target system values byte by byte, in increasing byte
- addresses, each byte encoded as two hex characters (or one
- binary character). */
+ addresses, each byte encoded as two hex characters (or one
+ binary character). */
if (remote_binary_download)
{
int escaped = 0;
@@ -557,11 +557,11 @@ remote_write_bytes (memaddr, myaddr, len)
if (i < todo)
{
/* Escape chars have filled up the buffer prematurely,
- and we have actually sent fewer bytes than planned.
- Fix-up the length field of the packet. */
+ and we have actually sent fewer bytes than planned.
+ Fix-up the length field of the packet. */
/* FIXME: will fail if new len is a shorter string than
- old len. */
+ old len. */
plen += hexnumstr ((char *)plen, (ULONGEST) i);
*plen++ = ':';
@@ -591,7 +591,7 @@ remote_write_bytes (memaddr, myaddr, len)
}
/* Increment by i, not by todo, in case escape chars
- caused us to send fewer bytes than we'd planned. */
+ caused us to send fewer bytes than we'd planned. */
myaddr += i;
memaddr += i;
len -= i;
@@ -743,10 +743,10 @@ putpkt_binary (buf, cnt)
#if 0
/* This is wrong. If doing a long backtrace, the user should be
- able to get out next time we call QUIT, without anything as
- violent as interrupt_query. If we want to provide a way out of
- here without getting to the next QUIT, it should be based on
- hitting ^C twice as in remote_wait. */
+ able to get out next time we call QUIT, without anything as
+ violent as interrupt_query. If we want to provide a way out of
+ here without getting to the next QUIT, it should be based on
+ hitting ^C twice as in remote_wait. */
if (quit_flag)
{
quit_flag = 0;
@@ -875,12 +875,12 @@ getpkt (buf, forever)
for (tries = 1; tries <= MAX_TRIES; tries++)
{
/* This can loop forever if the remote side sends us characters
- continuously, but if it pauses, we'll get a zero from readchar
- because of timeout. Then we'll count that as a retry. */
+ continuously, but if it pauses, we'll get a zero from readchar
+ because of timeout. Then we'll count that as a retry. */
/* Note that we will only wait forever prior to the start of a packet.
- After that, we expect characters to arrive at a brisk pace. They
- should show up within remote_timeout intervals. */
+ After that, we expect characters to arrive at a brisk pace. They
+ should show up within remote_timeout intervals. */
do
{
diff --git a/tools/img2srec.c b/tools/img2srec.c
index 330ae02..b04abbd 100644
--- a/tools/img2srec.c
+++ b/tools/img2srec.c
@@ -351,34 +351,34 @@ static void ConvertELF(char* fileName, DWORD loadOffset)
loadAddr = 0;
for (i = 0; i < elfHeader.e_shnum; i++) {
if ( (sectHeader[i].sh_type == SHT_PROGBITS)
- && (sectHeader[i].sh_size != 0)
- ) {
+ && (sectHeader[i].sh_size != 0)
+ ) {
loadSize = sectHeader[i].sh_size;
if (sectHeader[i].sh_flags != 0) {
- loadAddr = sectHeader[i].sh_addr;
- loadDiff = loadAddr - sectHeader[i].sh_offset;
+ loadAddr = sectHeader[i].sh_addr;
+ loadDiff = loadAddr - sectHeader[i].sh_offset;
} /* if */
else {
- loadAddr = sectHeader[i].sh_offset + loadDiff;
+ loadAddr = sectHeader[i].sh_offset + loadDiff;
} /* else */
if (loadAddr < firstAddr)
- firstAddr = loadAddr;
+ firstAddr = loadAddr;
/* build s-records */
loadSize = sectHeader[i].sh_size;
fseek(file, sectHeader[i].sh_offset, SEEK_SET);
while (loadSize) {
- rxCount = fread(rxBlock, 1, (loadSize > 32) ? 32 : loadSize, file);
- if (rxCount < 0) {
- fclose(file);
- fprintf (stderr, "*** illegal file format\n");
- return;
- } /* if */
- (void)BuildSRecord(srecLine, 3, loadAddr + loadOffset, rxBlock, rxCount);
- loadSize -= rxCount;
- loadAddr += rxCount;
- printf("%s\r\n",srecLine);
+ rxCount = fread(rxBlock, 1, (loadSize > 32) ? 32 : loadSize, file);
+ if (rxCount < 0) {
+ fclose(file);
+ fprintf (stderr, "*** illegal file format\n");
+ return;
+ } /* if */
+ (void)BuildSRecord(srecLine, 3, loadAddr + loadOffset, rxBlock, rxCount);
+ loadSize -= rxCount;
+ loadAddr += rxCount;
+ printf("%s\r\n",srecLine);
} /* while */
} /* if */
} /* for */
diff --git a/tools/scripts/README b/tools/scripts/README
index cda10a8..046c1d4 100644
--- a/tools/scripts/README
+++ b/tools/scripts/README
@@ -28,7 +28,6 @@ They are meant as EXAMPLE code, so it is very likely that you will
have to modify them before use.
-
Short description:
==================
@@ -40,11 +39,11 @@ dot.kermrc:
flash_param:
- "kermit" script to automatically initialize the environment
- variables on your target. This is most useful during
- development when your environment variables are stored in an
- embedded flash sector which is erased whenever you install a
- new U-Boot image.
+ "kermit" script to automatically initialize the environment
+ variables on your target. This is most useful during
+ development when your environment variables are stored in an
+ embedded flash sector which is erased whenever you install a
+ new U-Boot image.
by Swen Anderson, 10 May 2001
@@ -52,9 +51,9 @@ send_cmd:
send_cmd U_BOOT_COMMAND
- "kermit" script to send a U-Boot command and print the
- results. When used from a shell with history (like the bash)
- this indirectly adds kind of history to U-Boot ;-)
+ "kermit" script to send a U-Boot command and print the
+ results. When used from a shell with history (like the bash)
+ this indirectly adds kind of history to U-Boot ;-)
by Swen Anderson, 10 May 2001
@@ -62,7 +61,7 @@ send_image:
send_image FILE_NAME OFFSET
- "kermit" script to automatically download a file to the
- target using the "loadb" command (kermit binary protocol)
+ "kermit" script to automatically download a file to the
+ target using the "loadb" command (kermit binary protocol)
by Swen Anderson, 10 May 2001
diff --git a/tools/scripts/send_cmd b/tools/scripts/send_cmd
index d01efe2..4131331 100644
--- a/tools/scripts/send_cmd
+++ b/tools/scripts/send_cmd
@@ -19,4 +19,3 @@ out \%1 \%2 \%3 \%4 \%5 \%6 \%7\13
in 10 =>
quit
exit 0
-
diff --git a/tools/updater/Makefile b/tools/updater/Makefile
index a8fb4ce..21b11ca 100644
--- a/tools/updater/Makefile
+++ b/tools/updater/Makefile
@@ -29,9 +29,9 @@ PROG = updater
IMAGE = updater.image
SRC = update.c flash.c flash_hw.c utils.c cmd_flash.c string.c ctype.c dummy.c
ASRC = ppcstring.S
-OBJS = $(SRC:.c=.o) $(ASRC:.S=.o)
+OBJS = $(SRC:.c=.o) $(ASRC:.S=.o)
-LIB = $(TOPDIR)/examples/libsyscall.a
+LIB = $(TOPDIR)/examples/libsyscall.a
LIBAOBJS= $(TOPDIR)/examples/syscall.o
LIBCOBJS=
LIBOBJS = $(LIBAOBJS) $(LIBCOBJS)
@@ -50,14 +50,14 @@ $(LIB): .depend $(LIBOBJS)
$(OBJCOPY) -O srec $(<:.o=) $@
%.o: %.c
- $(CC) $(CPPFLAGS) -c $<
+ $(CC) $(CPPFLAGS) -c $<
%.o: %.S
$(CC) $(CPPFLAGS) -c $<
#########################################################################
-updater: $(OBJS) $(LIB) $(TOPDIR)/board/MAI/AmigaOneG3SE/memio.o
+updater: $(OBJS) $(LIB) $(TOPDIR)/board/MAI/AmigaOneG3SE/memio.o
$(LD) -g -Ttext $(LOAD_ADDR) -o updater -e _main $(OBJS) $(LIB) \
$(TOPDIR)/board/MAI/AmigaOneG3SE/memio.o
$(OBJCOPY) -O binary updater updater.bin
diff --git a/tools/updater/cmd_flash.c b/tools/updater/cmd_flash.c
index f3465f1..573546d 100644
--- a/tools/updater/cmd_flash.c
+++ b/tools/updater/cmd_flash.c
@@ -26,7 +26,6 @@
*/
#include <common.h>
#include <command.h>
-#include <cmd_boot.h>
#include <flash.h>
#if (CONFIG_COMMANDS & CFG_CMD_FLASH)
@@ -227,7 +226,7 @@ int flash_sect_erase (ulong addr_first, ulong addr_last)
}
}
if (erased) {
- // mon_printf ("Erased %d sectors\n", erased);
+ /* mon_printf ("Erased %d sectors\n", erased); */
} else {
mon_printf ("Error: start and/or end address"
" not on sector boundary\n");
@@ -264,8 +263,8 @@ int do_protect(cmd_tbl_t *cmdtp, bd_t *bd, int flag, int argc, char *argv[])
if (info->flash_id == FLASH_UNKNOWN) {
continue;
}
- //mon_printf ("%sProtect Flash Bank # %ld\n",
- // p ? "" : "Un-", bank);
+ /*mon_printf ("%sProtect Flash Bank # %ld\n", */
+ /* p ? "" : "Un-", bank); */
for (i=0; i<info->sector_count; ++i) {
#if defined(CFG_FLASH_PROTECTION)
@@ -290,9 +289,9 @@ int do_protect(cmd_tbl_t *cmdtp, bd_t *bd, int flag, int argc, char *argv[])
mon_printf("Bad sector specification\n");
return 1;
}
- //mon_printf("%sProtect Flash Sectors %d-%d in Bank # %d\n",
- // p ? "" : "Un-", sect_first, sect_last,
- // (info-flash_info)+1);
+ /*mon_printf("%sProtect Flash Sectors %d-%d in Bank # %d\n", */
+ /* p ? "" : "Un-", sect_first, sect_last, */
+ /* (info-flash_info)+1); */
for (i = sect_first; i <= sect_last; i++) {
#if defined(CFG_FLASH_PROTECTION)
if (flash_real_protect(info, i, p))
@@ -418,8 +417,8 @@ int flash_sect_protect (int p, ulong addr_first, ulong addr_last)
}
if (protected) {
- // mon_printf ("%sProtected %d sectors\n",
- // p ? "" : "Un-", protected);
+ /* mon_printf ("%sProtected %d sectors\n", */
+ /* p ? "" : "Un-", protected); */
} else {
mon_printf ("Error: start and/or end address"
" not on sector boundary\n");
diff --git a/tools/updater/flash_hw.c b/tools/updater/flash_hw.c
index ec11589..1d782c6 100644
--- a/tools/updater/flash_hw.c
+++ b/tools/updater/flash_hw.c
@@ -31,7 +31,6 @@
/*---------------------------------------------------------------------*/
#undef DEBUG_FLASH
-//#define DEBUG_FLASH
#ifdef DEBUG_FLASH
#define DEBUGF(fmt,args...) mon_printf(fmt ,##args)
@@ -68,7 +67,7 @@ static void flash_to_mem(void)
unsigned char x;
flash_xd_nest --;
-
+
if (flash_xd_nest == 0)
{
DEBUGF("Flash on memory bus\n");
@@ -327,7 +326,7 @@ static int flash_get_offsets (ulong base, flash_info_t *info)
/* set sector offsets for uniform sector type */
for (i = 0; i < info->sector_count; i++) {
info->start[i] = base + i * info->size /
- info->sector_count;
+ info->sector_count;
}
break;
default:
@@ -479,7 +478,7 @@ int write_buff (flash_info_t *info, uchar *src, ulong addr, ulong cnt)
}
if ((rc = write_word(info, wp, data)) != 0) {
- flash_to_mem();
+ flash_to_mem();
return (rc);
}
wp += 4;
@@ -491,7 +490,7 @@ int write_buff (flash_info_t *info, uchar *src, ulong addr, ulong cnt)
* handle word aligned part
*/
while (cnt >= 4) {
- if (out_cnt>26214)
+ if (out_cnt>26214)
{
mon_putc(219);
out_cnt = 0;
@@ -590,7 +589,7 @@ static int write_word (flash_info_t *info, ulong dest, ulong data)
*/
static void flash_reset (ulong addr)
{
- flash_to_xd();
+ flash_to_xd();
out8(addr, 0xF0); /* reset bank */
iobarrier_rw();
flash_to_mem();
@@ -641,10 +640,10 @@ void flash_print_info (flash_info_t *info)
info->size / 0x100000, info->sector_count);
} else if (info->size % 0x400 == 0) {
mon_printf (" Size: %ld KB in %d Sectors\n",
- info->size / 0x400, info->sector_count);
+ info->size / 0x400, info->sector_count);
} else {
mon_printf (" Size: %ld B in %d Sectors\n",
- info->size, info->sector_count);
+ info->size, info->sector_count);
}
mon_printf (" Sector Start Addresses:");
diff --git a/tools/updater/string.c b/tools/updater/string.c
index 50537a6..8a8edec 100644
--- a/tools/updater/string.c
+++ b/tools/updater/string.c
@@ -129,8 +129,8 @@ char * strrchr(const char * s, int c)
{
const char *p = s + strlen(s);
do {
- if (*p == (char)c)
- return (char *)p;
+ if (*p == (char)c)
+ return (char *)p;
} while (--p >= s);
return NULL;
}
@@ -316,7 +316,7 @@ void * memscan(void * addr, int c, size_t size)
p++;
size--;
}
- return (void *) p;
+ return (void *) p;
}
#endif
diff --git a/tools/updater/update.c b/tools/updater/update.c
index 66c6dfc..26204fb 100644
--- a/tools/updater/update.c
+++ b/tools/updater/update.c
@@ -35,7 +35,7 @@ void _main(void)
mon_printf("\nUpdate done. Please remove diskette.\n");
mon_printf("The machine will automatically reset in %d seconds\n", i);
mon_printf("You can switch off/reset now when the floppy is removed\n\n");
-
+
while (i)
{
mon_printf("Resetting in %d\r", i);
diff --git a/tools/updater/utils.c b/tools/updater/utils.c
index e230e19..0304f94 100644
--- a/tools/updater/utils.c
+++ b/tools/updater/utils.c
@@ -15,7 +15,7 @@ get_msr(void)
static __inline__ void
set_msr(unsigned long msr)
{
- asm volatile("mtmsr %0" : : "r" (msr));
+ asm volatile("mtmsr %0" : : "r" (msr));
}
static __inline__ unsigned long
@@ -31,7 +31,7 @@ get_dec(void)
static __inline__ void
set_dec(unsigned long val)
{
- asm volatile("mtdec %0" : : "r" (val));
+ asm volatile("mtdec %0" : : "r" (val));
}
@@ -69,80 +69,80 @@ unsigned long in32(u32 port)
unsigned long simple_strtoul(const char *cp,char **endp,unsigned int base)
{
- unsigned long result = 0,value;
-
- if (*cp == '0') {
- cp++;
- if ((*cp == 'x') && isxdigit(cp[1])) {
- base = 16;
- cp++;
- }
- if (!base) {
- base = 8;
- }
- }
- if (!base) {
- base = 10;
- }
- while (isxdigit(*cp) && (value = isdigit(*cp) ? *cp-'0' : (islower(*cp)
- ? toupper(*cp) : *cp)-'A'+10) < base) {
- result = result*base + value;
- cp++;
- }
- if (endp)
- *endp = (char *)cp;
- return result;
+ unsigned long result = 0,value;
+
+ if (*cp == '0') {
+ cp++;
+ if ((*cp == 'x') && isxdigit(cp[1])) {
+ base = 16;
+ cp++;
+ }
+ if (!base) {
+ base = 8;
+ }
+ }
+ if (!base) {
+ base = 10;
+ }
+ while (isxdigit(*cp) && (value = isdigit(*cp) ? *cp-'0' : (islower(*cp)
+ ? toupper(*cp) : *cp)-'A'+10) < base) {
+ result = result*base + value;
+ cp++;
+ }
+ if (endp)
+ *endp = (char *)cp;
+ return result;
}
long simple_strtol(const char *cp,char **endp,unsigned int base)
{
- if(*cp=='-')
- return -simple_strtoul(cp+1,endp,base);
- return simple_strtoul(cp,endp,base);
+ if(*cp=='-')
+ return -simple_strtoul(cp+1,endp,base);
+ return simple_strtoul(cp,endp,base);
}
static inline void
soft_restart(unsigned long addr)
{
- /* SRR0 has system reset vector, SRR1 has default MSR value */
- /* rfi restores MSR from SRR1 and sets the PC to the SRR0 value */
+ /* SRR0 has system reset vector, SRR1 has default MSR value */
+ /* rfi restores MSR from SRR1 and sets the PC to the SRR0 value */
- __asm__ __volatile__ ("mtspr 26, %0" :: "r" (addr));
- __asm__ __volatile__ ("li 4, (1 << 6)" ::: "r4");
- __asm__ __volatile__ ("mtspr 27, 4");
- __asm__ __volatile__ ("rfi");
+ __asm__ __volatile__ ("mtspr 26, %0" :: "r" (addr));
+ __asm__ __volatile__ ("li 4, (1 << 6)" ::: "r4");
+ __asm__ __volatile__ ("mtspr 27, 4");
+ __asm__ __volatile__ ("rfi");
- while(1); /* not reached */
+ while(1); /* not reached */
}
void
do_reset (void)
{
- ulong addr;
- /* flush and disable I/D cache */
- __asm__ __volatile__ ("mfspr 3, 1008" ::: "r3");
- __asm__ __volatile__ ("ori 5, 5, 0xcc00" ::: "r5");
- __asm__ __volatile__ ("ori 4, 3, 0xc00" ::: "r4");
- __asm__ __volatile__ ("andc 5, 3, 5" ::: "r5");
- __asm__ __volatile__ ("sync");
- __asm__ __volatile__ ("mtspr 1008, 4");
- __asm__ __volatile__ ("isync");
- __asm__ __volatile__ ("sync");
- __asm__ __volatile__ ("mtspr 1008, 5");
- __asm__ __volatile__ ("isync");
- __asm__ __volatile__ ("sync");
+ ulong addr;
+ /* flush and disable I/D cache */
+ __asm__ __volatile__ ("mfspr 3, 1008" ::: "r3");
+ __asm__ __volatile__ ("ori 5, 5, 0xcc00" ::: "r5");
+ __asm__ __volatile__ ("ori 4, 3, 0xc00" ::: "r4");
+ __asm__ __volatile__ ("andc 5, 3, 5" ::: "r5");
+ __asm__ __volatile__ ("sync");
+ __asm__ __volatile__ ("mtspr 1008, 4");
+ __asm__ __volatile__ ("isync");
+ __asm__ __volatile__ ("sync");
+ __asm__ __volatile__ ("mtspr 1008, 5");
+ __asm__ __volatile__ ("isync");
+ __asm__ __volatile__ ("sync");
#ifdef CFG_RESET_ADDRESS
- addr = CFG_RESET_ADDRESS;
+ addr = CFG_RESET_ADDRESS;
#else
- /*
- * note: when CFG_MONITOR_BASE points to a RAM address,
- * CFG_MONITOR_BASE - sizeof (ulong) is usually a valid
- * address. Better pick an address known to be invalid on your
- * system and assign it to CFG_RESET_ADDRESS.
- */
- addr = CFG_MONITOR_BASE - sizeof (ulong);
+ /*
+ * note: when CFG_MONITOR_BASE points to a RAM address,
+ * CFG_MONITOR_BASE - sizeof (ulong) is usually a valid
+ * address. Better pick an address known to be invalid on your
+ * system and assign it to CFG_RESET_ADDRESS.
+ */
+ addr = CFG_MONITOR_BASE - sizeof (ulong);
#endif
- soft_restart(addr);
- while(1); /* not reached */
+ soft_restart(addr);
+ while(1); /* not reached */
}