mtd/boot Makefile, 1.4, 1.5 local.h, 1.1, 1.2 main.c, 1.1, 1.2 makerom.c, 1.1, 1.2 misc.c, 1.1, 1.2 sbc_gxx_boot.c, 1.1, 1.2

gleixner at infradead.org gleixner at infradead.org
Mon Nov 7 06:16:13 EST 2005


Update of /home/cvs/mtd/boot
In directory phoenix.infradead.org:/tmp/cvs-serv29274/boot

Modified Files:
	Makefile local.h main.c makerom.c misc.c sbc_gxx_boot.c 
Log Message:
[MTD / JFFS2] Clean up trailing white spaces


Index: Makefile
===================================================================
RCS file: /home/cvs/mtd/boot/Makefile,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- Makefile	9 May 2001 10:29:21 -0000	1.4
+++ Makefile	7 Nov 2005 11:14:18 -0000	1.5
@@ -10,14 +10,14 @@
 
 all: flashloader.rom sbc_gxx.rom
 
-# To create the loader we first 
+# To create the loader we first
 flashloader.rom: makerom rloader.bin start32.o components.a
 	$(LD) -N -Ttext $(LOADADDRESS) -e _start -nostdlib -o $@.t start32.o components.a
 	objcopy -O binary -R .note -R .comment $@.t $@.bin
 	@-rm $@.t
 	cat rloader.bin $@.bin > $@
 	./makerom -i'Flash Loader Rom' $@
-	
+
 # We create a library to help the linker
 components.a: misc.o main.o io.o
 	@-rm $@ > /dev/null 2>&1
@@ -30,14 +30,14 @@
 	@-rm $@.t
 	cat rloader.bin $@.bin > $@
 	./makerom -i'Flash Loader Rom' $@
-	
+
 # We create a library to help the linker
 sbc_gxx.a: misc.o sbc_gxx_boot.o
 	@-rm $@ > /dev/null 2>&1
 	$(AR) cq $@ $(filter %.o,$^)
-	
+
 # The 16 bit boot code is written using the as86 assembler which is not syntax
-# compatible with the AT&T like 'as' assembler. Throwback from when gnu as 
+# compatible with the AT&T like 'as' assembler. Throwback from when gnu as
 # could not output 16 bit code at all.
 rloader.bin: loader.asm loader.inc
 	$(CC) $(CFLAGS) $(CPPFLAGS) -x assembler-with-cpp -E $< | $(AS86) -0 -b rloader.bin.t -
@@ -47,7 +47,7 @@
 	ln -sf ../fs/ffs2/io.c .
 	$(CC) $(CFLAGS) $(CPPFLAGS) -c io.c -o $@
 
-clean: 
+clean:
 	-rm -f *.a *.o *.bin *.rom makerom
 
 %.o: %.c
@@ -55,4 +55,4 @@
 
 %.o: %.S
 	$(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
-	
+

Index: local.h
===================================================================
RCS file: /home/cvs/mtd/boot/local.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- local.h	9 Aug 1999 18:04:57 -0000	1.1
+++ local.h	7 Nov 2005 11:14:18 -0000	1.2
@@ -3,7 +3,7 @@
 
 #include "proto.h"
 
-struct qstr 
+struct qstr
 {
    unsigned char *name;
    unsigned int len;

Index: main.c
===================================================================
RCS file: /home/cvs/mtd/boot/main.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- main.c	9 Aug 1999 18:04:57 -0000	1.1
+++ main.c	7 Nov 2005 11:14:18 -0000	1.2
@@ -9,9 +9,9 @@
    that is mapped into the bios extension region. To do so you have to
    customize the first section to allow it to speak to your flash. The
    loader reads a FFS2 filesystem directly to locate the image and read it
-   into ram. You'll need at least a 4K window size, prefferably 8K to fit 
-   the entire loader in. If you only have 4k then you have to use the 
-   SMALLER loader that omits error messages and error checking code to 
+   into ram. You'll need at least a 4K window size, prefferably 8K to fit
+   the entire loader in. If you only have 4k then you have to use the
+   SMALLER loader that omits error messages and error checking code to
    fit into 4k.
 
    TODO:
@@ -19,7 +19,7 @@
        line from the file /commandline on the flash - this would remove the
        need to hardcode one in here. Even better would be a config file, but
        I haven't the faintest idea what would be usefull to put in one!
-   
+
    ##################################################################### */
 									/*}}} */
 #include "local.h"
@@ -39,12 +39,12 @@
 
 // PageTo - Window Swapping function					/*{{{*/
 // ---------------------------------------------------------------------
-/* Handles the specific flash window implemenation. This one is for the 
+/* Handles the specific flash window implemenation. This one is for the
    Octagon board */
 void PageTo(unsigned long Window)
 {
    outb(Window | (2 << 6),PAGE_IO);
-}	    
+}
 									/*}}}*/
 
 // Defines for the linux loader
@@ -70,7 +70,7 @@
    __u8 loadflags;
    __u16 setup_move_size;
    unsigned long code32_start;
-   unsigned long ramdisk_image; 
+   unsigned long ramdisk_image;
    unsigned long ramdisk_size;
    unsigned long bootsect_kludge;
    __u16 heap_end_ptr;
@@ -101,22 +101,22 @@
    if (loc/WindowSize == (loc + count - 1)/WindowSize)
    {
       PageTo(loc/WindowSize);
-      
+
       r->behind = loc % WindowSize;
       r->ahead = WindowSize - r->behind;
       r->p = FlashWindow + r->behind;
       return r->p;
    }
-   
+
    // Doomed :>
-#ifndef SMALLER   
+#ifndef SMALLER
    if (count > sizeof(r->temp))
    {
       printk("ffs2: Reading too much");
       return 0;
    }
 #endif
-   
+
    // Need to use the temp buffer
    pos = r->temp;
    memset(r->temp,0,sizeof(r->temp));
@@ -126,7 +126,7 @@
       unsigned long behind;
       unsigned long ahead;
       PageTo(loc/WindowSize);
-      
+
       behind = loc % WindowSize;
       ahead = WindowSize - behind;
       if (left < ahead)
@@ -139,7 +139,7 @@
    r->behind = 0;
    r->ahead = count;
    r->p = r->temp;
-   return r->p;   
+   return r->p;
 }
 									/*}}}*/
 
@@ -147,7 +147,7 @@
 // ---------------------------------------------------------------------
 /* This is alike ffs2_readpage */
 static int ffs2_readfile(struct ffs_read *r,unsigned long loc,
-			 unsigned char *to,unsigned long start, 
+			 unsigned char *to,unsigned long start,
 			 unsigned long stop)
 {
    struct ffs2_entry *entry;
@@ -156,13 +156,13 @@
    unsigned long offset = 0;
    unsigned long toread;
    int res;
-   
+
    // Get the inode and follow to find the first extent
    if ((entry = ffs2_find_entry(r,loc)) == 0 ||
        isFNULL(entry->PrimaryPtr) ||
        (entry->Status & FFS_ENTRY_PRIMARY) == FFS_ENTRY_PRIMARY)
       return -1;
-   
+
    // Check for compression
    if ((entry->Status >> FFS_ENTRY_COMPIP_SHIFT) != 0xFF)
    {
@@ -170,50 +170,50 @@
 	     entry->Status >> FFS_ENTRY_COMPIP_SHIFT);
       return -1;
    }
-            
+
    cur = entry->PrimaryPtr;
    while (1)
    {
       struct ffs2_fileinfo *extent = (struct ffs2_fileinfo *)ffs2_find_entry(r,cur);
       if (extent == 0)
 	 break;
-      
+
       if (!isflagset(extent->Status,FFS_ENTRY_TYPEMASK,FFS_ENTRY_TYPEEXTENT))
 	 break;
-      
+
       // Skip cur to the next one
       if (isFNULL(extent->PrimaryPtr) == 0 &&
 	  (extent->Status & FFS_ENTRY_PRIMARY) != FFS_ENTRY_PRIMARY)
 	 cur = extent->PrimaryPtr;
       else
 	 cur = 0xFFFFFFFF;
-      
+
       if ((extent->Status & FFS_ENTRY_EXISTS) != FFS_ENTRY_EXISTS)
 	 continue;
-      
+
       // Read the fragment
       if (offset + extent->UncompressedExtentLen > start)
       {
 	 toread = extent->UncompressedExtentLen;
-	 if (stop > 0 && 
+	 if (stop > 0 &&
 	     extent->UncompressedExtentLen > stop - offset)
 	    toread = stop - offset;
-	 
+
 	 if (start >= offset)
 	    res = ffs2_copy_to_buff(r,to,extent,toread,start - offset);
 	 else
 	    res = ffs2_copy_to_buff(r,to + offset - start,extent,toread,0);
-	 
+
 	 if (res != 0)
 	    return -1;
 	 len += toread;
       }
-      
+
       offset += extent->UncompressedExtentLen;
-      
+
       if (stop > 0 && offset >= stop)
 	 return len;
-      
+
       if (cur == 0xFFFFFFFF)
 	 break;
    }
@@ -228,7 +228,7 @@
       0x90200-0x911FF       8kB   first sectors of kernel setup
       0x92200-0x931FF       4kB   primary boot loader
       0x93200-0x933FF     0.5kB   load header
-      0x93400-0x93BFF       2kB   default command line   
+      0x93400-0x93BFF       2kB   default command line
  */
 int ReadKernelImage(struct ffs_read *r,unsigned long loc)
 {
@@ -236,7 +236,7 @@
    unsigned short *TmpS;
    unsigned long setup_size;
    struct setup_header *setup;
-   
+
    // Read the floppy loader to 0x90000
    Tmp = (unsigned char *)(DEF_INITSEG << 4);
    if (ffs2_readfile(r,loc,Tmp,0,512) <= 0)
@@ -246,8 +246,8 @@
    if (Tmp[510] != 0x55 || Tmp[511] != 0xAA)
       return -1;
 #endif
-      
-   /* 1 byte value at the end of the loader is the number of sectors of setup 
+
+   /* 1 byte value at the end of the loader is the number of sectors of setup
       code */
    setup_size = (int)(Tmp[SETUP_SIZE_OFF]) * SECTSIZE;
 
@@ -255,15 +255,15 @@
    Tmp = (unsigned char *)(DEF_SETUPSEG << 4);
    if (ffs2_readfile(r,loc,Tmp,512,512+setup_size) <= 0)
       return -1;
-   
+
    // Check the setup header
    setup = (struct setup_header *)Tmp;
-   
+
 #ifndef SMALLER
-   if (memcmp(setup->magic,"HdrS",4) != 0 || 
+   if (memcmp(setup->magic,"HdrS",4) != 0 ||
        setup->version < SETUP_VERSION)
       return -1;
-   
+
    // Big Kernel?
    if ((setup->loadflags & SETUP_HIGH) == SETUP_HIGH)
       Tmp = (unsigned char *)(BIG_SYSSEG << 4);
@@ -272,7 +272,7 @@
 #else
    Tmp = (unsigned char *)(DEF_SYSSEG << 4);
 #endif
-   
+
    // Read the kernel
    if (ffs2_readfile(r,loc,Tmp,512+setup_size,0) <= 0)
       return -1;
@@ -286,7 +286,7 @@
    TmpS[0x11] = 0x93400 - 0x90000;
    Tmp = (unsigned char *)(0x93400);
    strcpy(Tmp,CMDLINE);
-   
+
    return 0;
 }
 									/*}}}*/
@@ -299,7 +299,7 @@
    unsigned short Blocks[256];
    unsigned long Pos;
    struct qstr Name;
-									   
+
    printk("FFS2 Boot Loader " __DATE__ " " __TIME__ " Starting.\n");
 
    // Create the superblock information for the FFS2 filesystem
@@ -308,7 +308,7 @@
    blocks = FlashSize/EraseSize;
    sb.BlockMap = Blocks;
    memset(sb.BlockMap,0xFF,sizeof(*sb.BlockMap)*blocks);
-   
+
    memset(&r,0,sizeof(r));
    r.super = (struct super_block *)&sb;
    if (ffs2_find_boot_block(&r,blocks) != 0 || ffs2_prepare(&r) != 0)
@@ -316,9 +316,9 @@
       printk("Failed to locate the boot block!\n");
       return 0;
    }
-   
+
    printk("Serial: %d\n",sb.Boot.SerialNumber);
-   
+
    // Locate the kernel
    Name.name = "linux";
    Name.len = 5;
@@ -327,7 +327,7 @@
       printk("Could not find '%s'\n",Name.name);
       return 0;
    }
-      
+
    if (ReadKernelImage(&r,Pos) != 0)
    {
       printk("Failed while reading image\n");

Index: makerom.c
===================================================================
RCS file: /home/cvs/mtd/boot/makerom.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- makerom.c	9 Aug 1999 18:04:57 -0000	1.1
+++ makerom.c	7 Nov 2005 11:14:18 -0000	1.2
@@ -215,7 +215,7 @@
 	{
 		for (i = pnp_hdr_offset, sum = 0; i < pnp_hdr_offset + PNP_HDR_SIZE; ++i)
 			sum += rom[i];
-		rom[pnp_hdr_offset+PNP_CHKSUM_OFF] = -sum;  
+		rom[pnp_hdr_offset+PNP_CHKSUM_OFF] = -sum;
 	}
 	/* 3c503 requires last two bytes to be MAGIC_3C503 */
 	if (is3c503 && romsize == MINROMSIZE) {

Index: misc.c
===================================================================
RCS file: /home/cvs/mtd/boot/misc.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- misc.c	9 Aug 1999 18:04:57 -0000	1.1
+++ misc.c	7 Nov 2005 11:14:18 -0000	1.2
@@ -73,9 +73,9 @@
 	register char *p;
 	char tmp[16];
 	while (*fmt) {
-	        if (*fmt == '\n') 
+	        if (*fmt == '\n')
 		        *(buf++) = '\r';
-	   
+
 		if (*fmt == '%') {	/* switch() uses more space */
 			fmt++;
 
@@ -190,7 +190,7 @@
 	extern void slowdownio();
 	unsigned long time;
 	char st;
-  
+
   	slowdownio();
 	time = currticks() + 18;	/* max wait of 1 second */
   	while ((((st = inb(K_CMD)) & K_OBUF_FUL) ||

Index: sbc_gxx_boot.c
===================================================================
RCS file: /home/cvs/mtd/boot/sbc_gxx_boot.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- sbc_gxx_boot.c	9 May 2001 10:28:06 -0000	1.1
+++ sbc_gxx_boot.c	7 Nov 2005 11:14:18 -0000	1.2
@@ -1,17 +1,17 @@
 /* sbc_mediagx_boot.c - boot kernel from flash.
- 
+
    Copyright (C) 2000 Arcom Control System Ltd
- 
+
    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
@@ -20,7 +20,7 @@
 
 A boot loader which runs and loads the kernel directly from flash.  The kernel
 command line is also read from flash.
- 
+
 Currently setup for an Arcom Control Systems SBC-MediaGX as follows
 Flash address
 00000           This boot loader BIOS extension
@@ -33,7 +33,7 @@
 
 */
 
-// Includes 
+// Includes
 
 #include "local.h"
 #include <asm/io.h>
@@ -49,7 +49,7 @@
 // - Do we support bzImages ?
 #define SUPPORT_BZIMAGES
 
-// - Where we can find the kernel 
+// - Where we can find the kernel
 #define CMDLINE_START 128*1024
 #define CMDLINE_SIZE  2*1024
 #define KERNEL_START (CMDLINE_START+CMDLINE_SIZE)
@@ -94,7 +94,7 @@
    __u8 loadflags;
    __u16 setup_move_size;
    unsigned long code32_start;
-   unsigned long ramdisk_image; 
+   unsigned long ramdisk_image;
    unsigned long ramdisk_size;
    unsigned long bootsect_kludge;
    __u16 heap_end_ptr;
@@ -109,7 +109,7 @@
 
 /*
  * Function: vPropagateA20( void )
- *        
+ *
  *           Do a PORT20 A20 propogation assertion to ensure we
  *           can talk to high memory
  */
@@ -133,8 +133,8 @@
 static inline void sbc_gxx_flash_page(unsigned long ulOfs)
 {
   int iPage = (int)(ulOfs >> WINDOW_SHIFT);
-  
-  if( iPage != iCurPage ) 
+
+  if( iPage != iCurPage )
   {
     outw( ((unsigned int)iPage) | DEVICE_ENABLE, PAGE_IO );
     iCurPage = iPage;
@@ -154,22 +154,22 @@
  *
  * Returns:     nothing
  *
- */ 
+ */
 static void sbc_gxx_flash_copy(void *pTo, unsigned long ulFrom, unsigned long ulLen)
 {
-    while(ulLen) 
+    while(ulLen)
     {
       unsigned long ulThisLen = ulLen;
 
       if (ulLen > (WINDOW_LENGTH - (ulFrom & WINDOW_MASK)))
        ulThisLen = WINDOW_LENGTH - (ulFrom & WINDOW_MASK);
-	
+
       sbc_gxx_flash_page(ulFrom);
 
       memcpy(pTo, (__u8*)(WINDOW_START + (ulFrom & WINDOW_MASK)), ulThisLen);
 
       (__u8*)pTo += ulThisLen;
-      
+
       ulFrom += ulThisLen;
       ulLen -= ulThisLen;
     }
@@ -181,7 +181,7 @@
 
 /*
  * Function: iReadKernelImage( void )
- * 
+ *
  * Description: Read in the kernel image from a region of flash
  *
  * Parameters: none
@@ -194,7 +194,7 @@
  *     0x90200-0x911FF       8kB   first sectors of kernel setup
  *     0x92200-0x931FF       4kB   primary boot loader
  *     0x93200-0x933FF     0.5kB   load header
- *     0x93400-0x93BFF       2kB   default command line   
+ *     0x93400-0x93BFF       2kB   default command line
  *
  * Returns: == 0     -    Success
  *          != 0     -    Failure
@@ -207,7 +207,7 @@
 
     unsigned long ulSetupSize;
     struct setup_header *pHdr;
-    
+
     // Read the floppy loader to 0x90000
     pTmp = (unsigned char *)(DEF_INITSEG << 4);
     sbc_gxx_flash_copy(pTmp,0+KERNEL_START,512);
@@ -219,17 +219,17 @@
       return -1;
     }
 
-    /* 1 byte value at the end of the loader is the number of sectors of setup 
+    /* 1 byte value at the end of the loader is the number of sectors of setup
        code */
     ulSetupSize = ((unsigned long)pTmp[SETUP_SIZE_OFF]) * SECTSIZE;
-    
+
     // Read the setup code
     pTmp = (unsigned char *)(DEF_SETUPSEG << 4);
     sbc_gxx_flash_copy(pTmp,512+KERNEL_START, ulSetupSize);
-   
+
     // Check the setup header
     pHdr = (struct setup_header *)pTmp;
-    
+
     // Are magic number and version OK ?
     if (memcmp(pHdr->magic,"HdrS",4) != 0 || pHdr->version < SETUP_VERSION)
     {
@@ -237,36 +237,36 @@
       return -1;
     }
 
-    // Set kernel destination	
+    // Set kernel destination
     pTmp = (unsigned char *)(pHdr->code32_start);
 
     // Dump kernel destination to screen
     printf("Loading kernel to 0x%X\n", (unsigned long)pTmp);
 
     // Is this a Big Kernel? (bzImage)
-    if ((pHdr->loadflags & SETUP_HIGH) == SETUP_HIGH) 
+    if ((pHdr->loadflags & SETUP_HIGH) == SETUP_HIGH)
       {
-      
+
 #ifndef SUPPORT_BZIMAGES
       printf( "Can't handle big images.\n" );
 	return -1;
 #else
 	// Make sure we diddle the type of loader so kernel setup will play with us...
 	pHdr->type_of_loader = LOADER_TYPE; // (emulate ETHERBOOT version 0)
-	
+
 	/* Read the kernel EEK! How long is the kernel ?
 	   - we've increased the max size from (512-10)K up to
 	   (640-10K). Uses more flash, but what can we do...*/
 	sbc_gxx_flash_copy(pTmp,512+ulSetupSize+KERNEL_START, (640-2)*1024);
 #endif
-	
-      } 
-    else 
+
+      }
+    else
       {
 	pTmp = (unsigned char *)(DEF_SYSSEG << 4);
 	sbc_gxx_flash_copy(pTmp,512+ulSetupSize+KERNEL_START,(512-10)*1024);
       }
-    
+
     /* Prepare the command line
        0x90020-0x90021     2 bytes   command line magic number
        0x90022-0x90023     2 bytes   command line offs. relative to floppy boot sec
@@ -275,12 +275,12 @@
     pTmpS = (unsigned short *)(DEF_INITSEG << 4);
     pTmpS[0x10] = 0xA33F;
     pTmpS[0x11] = 0x93400 - 0x90000;
-    
+
     pTmp = (unsigned char *)(0x93400);
     sbc_gxx_flash_copy( pTmp, CMDLINE_START, CMDLINE_SIZE );
-    
+
     printk( "Command line: %s\n", pTmp );
-    
+
     return 0;
 }
 
@@ -304,6 +304,6 @@
 
     // Start the kernel...
     xstart(DEF_BOOTLSEG << 16,0,0);
-  
+
   return 0;
 }





More information about the linux-mtd-cvs mailing list