⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 tqm8xx.patch

📁 linux交叉编译环境个软件和内核的补丁。
💻 PATCH
📖 第 1 页 / 共 5 页
字号:
 static char *rpxsig = "RPXsignature=1.0\nNAME=LINUX\nSTART=FF840000\nVERSION=1.0\n";+#endif  /*  * Please send me load/board info and such data for hardware not@@ -40,15 +42,25 @@  * and zeros the BSS space, it also writes over the information we  * save here and pass to the kernel (command line and board info).  * On these boards, we grab some known memory holes to hold this information.+ *+ * On the TQM modules there is enough memory to chose a safe place.  */ char	cmd_buf[256]; char	*cmd_line = cmd_buf; -char	*root_string = "root=/dev/nfs rw";+#if (defined(CONFIG_TQM860) || defined(CONFIG_TQM8xxL))+char nfsserv_ip[] = TQM_SERVER_IP;+#endif++char	*ramroot_string  = "root=/dev/ram";+char	*root_string     = "root=/dev/nfs rw"; char	*nfsaddrs_string = "nfsaddrs=";-char	*nfsroot_string = "nfsroot=";-char	*defroot_string = "/sys/mbxroot";-char	*ramroot_string = "root=/dev/ram";+char	*nfsroot_string  = "nfsroot=";+#if (defined(CONFIG_TQM860) || defined(CONFIG_TQM8xxL))+char	*defroot_string  = TQM_SERVER_DIR;+#else+char	*defroot_string  = "/sys/mbxroot";+#endif	/* CONFIG_TQM8xx */ int	do_ipaddrs(char **cmd_cp, int echo); void	do_nfsroot(char **cmd_cp, char *dp); int	strncmp(const char * cs,const char * ct,size_t count);@@ -71,12 +83,21 @@ void pause() { 	puts("pause\n");+	udelay(1000000); }  void exit() { 	puts("exit\n");+#if (defined(CONFIG_TQM860) || defined(CONFIG_TQM8xxL))+	asm ("	lis	3,0x4000+		ori	3,3,0x0100+		mtlr	3+		blr+	");+#else 	while(1); +#endif	/* CONFIG_TQM8xx */ }  /* The MPC8xx is just the serial port.@@ -105,8 +126,6 @@          while ( ( c = *s++ ) != '\0' ) {                 serial_putchar(c);-                if ( c == '\n' )-                        serial_putchar('\r');         } } @@ -153,7 +172,7 @@ 	avail_ram += size; 	if (avail_ram > end_avail) { 		puts("oops... out of memory\n");-		pause();+		exit(); 	} 	return p; }@@ -202,7 +221,9 @@ 	s.zfree = zfree; 	r = inflateInit2(&s, -MAX_WBITS); 	if (r != Z_OK) {-		puts("inflateInit2 returned %d\n");+		puts("inflateInit2 returned ");+		puthex(r);+		putc('\n'); 		exit(); 	} 	s.next_in = src + i;@@ -211,7 +232,9 @@ 	s.avail_out = dstlen; 	r = inflate(&s, Z_FINISH); 	if (r != Z_OK && r != Z_STREAM_END) {-		puts("inflate returned %d\n");+		puts("inflate returned ");+		puthex(r);+		putc('\n'); 		exit(); 	} 	*lenp = s.next_out - (unsigned char *) dst;@@ -229,6 +252,14 @@ 	unsigned long i; 	char	*dp; +#ifdef	DEBUG+	puts("decompress_kernel: load_addr=");puthex(load_addr);+	puts(" num_words=");puthex(num_words);+	puts(" cksum=");puthex(cksum);+	puts(" bd_info=");puthex(residual);+	puts("\n");+#endif+ 	/* Grab some space for the command line and board info.  Since 	 * we no longer use the ELF header, but it was loaded, grab 	 * that space.@@ -236,12 +267,24 @@ #ifdef CONFIG_MBX 	cmd_line = (char *)(load_addr - 0x10000); #else+# if (defined(CONFIG_TQM860) || defined(CONFIG_TQM8xxL))+	cmd_line = ((char *)bp)+sizeof(bd_t);+# else 	cmd_line = (char *)(0x200000);+# endif #endif++# if (defined(CONFIG_TQM860) || defined(CONFIG_TQM8xxL))+	/* no need to copy on TQM board */+	hold_residual = bp;+	puts("RAM size:      ");puthex(bp->bi_memsize);puts("\n");+#else 	hold_residual = (bd_t *)(cmd_line + sizeof(cmd_buf)); 	/* copy board data */ 	if (bp) 		memcpy(hold_residual,bp,sizeof(bd_t));+#endif	/* CONFIG_TQM8xx */+  #if 0 	/* MBX/prep sometimes put the residual/board info at the end of mem @@ -268,7 +311,7 @@ 	puts(" "); puthex((unsigned long)(load_addr + (4*num_words))); puts("\n"); 	if ( (unsigned long)load_addr != (unsigned long)&start ) 	{-		puts("relocated to:  "); puthex((unsigned long)&start);+		puts("Relocated to:  "); puthex((unsigned long)&start); 		puts(" "); 		puthex((unsigned long)((unsigned long)&start + (4*num_words))); 		puts("\n");@@ -276,7 +319,7 @@  	if ( bp ) 	{-		puts("board data at: "); puthex((unsigned long)bp);+		puts("Board Data at: "); puthex((unsigned long)bp); 		puts(" "); 		puthex((unsigned long)((unsigned long)bp + sizeof(bd_t))); 		puts("\n");@@ -287,6 +330,9 @@ 		puts("\n"); 	} +	puts("Boot args at:  "); puthex((unsigned long)cmd_line);+	puts (" "); puthex(((unsigned long)cmd_line)+512); puts("\n");+ 	/* we have to subtract 0x10000 here to correct for objdump including the 	   size of the elf header which we strip -- Cort */ 	zimage_start = (char *)(load_addr - 0x10000 + ZIMAGE_OFFSET);@@ -302,10 +348,15 @@ 	 * setup avail_ram - this is the first part of ram usable 	 * by the uncompress code. -- Cort 	 */+#if (defined(CONFIG_TQM860) || defined(CONFIG_TQM8xxL))+	avail_ram = (char *)PAGE_ALIGN((unsigned long)&start+(num_words*4));+#else 	avail_ram = (char *)PAGE_ALIGN((unsigned long)zimage_start+zimage_size);+ 	if ( ((load_addr+(num_words*4)) > (unsigned long) avail_ram) 		&& (load_addr <= 0x01000000) ) 		avail_ram = (char *)(load_addr+(num_words*4));+ 	if ( (((unsigned long)&start+(num_words*4)) > (unsigned long) avail_ram) 		&& (load_addr <= 0x01000000) ) 		avail_ram = (char *)((unsigned long)&start+(num_words*4));@@ -322,10 +373,20 @@ 	 */ 	if ((unsigned long)zimage_start > 0x01000000) 		avail_ram = (char *)PAGE_ALIGN((unsigned long)hold_residual + sizeof(bd_t));+#endif	/* CONFIG_TQM8xx */  	/* relocate initrd */ 	if ( initrd_start ) 	{+		/*+		 * XXX+		 * Only 16 MB accessable during early boot ? Make sure -- wd+		 * XXX+		 */+		if (end_avail > (char *)(16<<20) ) {+			end_avail = (char *)(16<<20);+		} /* end XXX */+ 		puts("initrd at:     "); puthex(initrd_start); 		puts(" "); puthex(initrd_end); puts("\n"); @@ -357,6 +418,90 @@ 	timer = 0; 	cp = cmd_line; +#if (defined(CONFIG_TQM860) || defined(CONFIG_TQM8xxL))+	/*+	 * For the TQM boards, we default to a "sensible" default:+	 * When an initrd is present, we assume it contains the+	 * ramdisk that is to be used as root filesystem;+	 * otherwise, the root is NFS mounted.+	 */+	if (initrd_start) {+		dp = ramroot_string;			/* root=/dev/ram	*/+		while (*dp) {+			putc(*cp++ = *dp++);+		}+	} else {+		int i;+		int ip = bp->bi_ip_addr;+		unsigned char *byte = (char *)&ip;++		dp = root_string;			/* root=/dev/nfs	*/+		while (*dp) {+			putc(*cp++ = *dp++);+		}+		putc(' '); *cp++ = ' ';++		dp = nfsroot_string;		/* nfsroot=y.y.y.y:/LinuxPPC	*/+		while (*dp) {+			putc(*cp++ = *dp++);+		}+		dp = nfsserv_ip;+		while (*dp) {+			putc(*cp++ = *dp++);+		}+		putc(*cp++ = ':');+		dp = defroot_string;+		while (*dp) {+			putc(*cp++ = *dp++);+		}+		putc(' '); *cp++ = ' ';++		dp = nfsaddrs_string;		/* nfsaddrs=x.x.x.x:y.y.y.y	*/+		while (*dp) {+			putc(*cp++ = *dp++);+		}+		/* add IP addresses as <my_ip>:<serv_ip> */+		for (i=0; i<4; ++i, ++byte) {+			int n;++			if ((n = *byte/100) != 0) {+				putc(*cp++ = n+'0');+				*byte -= 100*n;+			}+			if ((n = *byte/10) != 0) {+				putc(*cp++ = n+'0');+				*byte -= 10*n;+			}+			n = *byte;+			putc(*cp++ = n+'0');+			if (i<3) {+				putc(*cp++ = '.');+			}+		}+		putc(*cp++ = ':');+		dp = nfsserv_ip;+		while (*dp) {+			putc(*cp++ = *dp++);+		}+#if (defined(TQM_NEED_GW) || defined(TQM_NEED_NM))+		putc(*cp++ = ':');+#endif+#ifdef	TQM_NEED_GW+		dp = TQM_GATEWAY_IP;+		while (*dp) {+			putc(*cp++ = *dp++);+		}+#endif	/* TQM_NEED_GW */+#ifdef	TQM_NEED_NM+		putc(*cp++ = ':');+		dp = TQM_NETMASK;+		while (*dp) {+			putc(*cp++ = *dp++); +		}+#endif  /* TQM_NEED_NM */+	}+#endif	/* CONFIG_TQM8xx */+ #if 1 	while (timer++ < 5*1000) { 		if (tstc()) {@@ -373,7 +518,7 @@ 			} 			break;  /* Exit 'timer' loop */ 		}-		udelay(500);  /* 1 msec */+		udelay(1000);  /* 1 msec */ 	} #endif 	*cp = 0;@@ -398,7 +543,7 @@  	puts("\n"); -	puts("Uncompressing Linux...");+	puts("Uncompressing Linux... ");  	gunzip(0, 0x400000, zimage_start, &zimage_size); 	puts("done.\n");+ diff -u linux-2.2.13/include/asm-ppc/mpc8xx.h.ORIG linux-2.2.13/include/asm-ppc/mpc8xx.h--- linux-2.2.13/include/asm-ppc/mpc8xx.h.ORIG	Sat Oct 23 01:10:04 1999+++ linux-2.2.13/include/asm-ppc/mpc8xx.h	Sun Jan  9 17:19:24 2000@@ -12,6 +12,10 @@ #include <asm/mbx.h> #endif +#if(defined(CONFIG_TQM860) || defined(CONFIG_TQM8xxL))+#include <asm/tqm8xx.h>+#endif+ #ifdef CONFIG_FADS #include <asm/fads.h> #endif+ diff -u linux-2.2.13/include/asm-ppc/processor.h.ORIG linux-2.2.13/include/asm-ppc/processor.h--- linux-2.2.13/include/asm-ppc/processor.h.ORIG	Sun Jan  9 16:04:03 2000+++ linux-2.2.13/include/asm-ppc/processor.h	Sun Jan  9 16:47:00 2000@@ -95,6 +95,8 @@ #define _MACH_bseip   128 /* Bright Star Engineering ip-Engine */ #define _MACH_yk      256 /* Motorola Yellowknife */ #define _MACH_rpxclassic 512  /* RPCG RPX-Classic 8xx board */+#define	_MACH_tqm8xxL	1024  /* TQ Systems TQM8xxL mini module */+#define	_MACH_tqm860	1025  /* TQ Systems TQM860  mini module */  /* see residual.h for these */ #define _PREP_Motorola 0x01  /* motorola prep */+ diff -u linux-2.2.13/include/asm-ppc/tqm8xx.h.ORIG linux-2.2.13/include/asm-ppc/tqm8xx.h--- linux-2.2.13/include/asm-ppc/tqm8xx.h.ORIG	Sun Jan  8 20:41:06 2000+++ linux-2.2.13/include/asm-ppc/tqm8xx.h	Sun Jan  9 17:19:20 2000@@ -0,0 +1,61 @@++/*+ * A collection of structures, addresses, and values associated with+ * the TQ Systems TQM8xx(L) modules.  This was originally created for the+ * MBX860, and probably needs revisions for other boards (like the 821).+ * When this file gets out of control, we can split it up into more+ * meaningful pieces.+ *+ * Based on mbx.h, Copyright (c) 1997 Dan Malek (dmalek@jlc.net)+ *+ * Copyright (c) 1999,2000 Wolfgang Denk (wd@denx.de)+ */+#ifndef __MACH_TQM8xx_DEFS+#define __MACH_TQM8xx_DEFS++#ifndef __ASSEMBLY__++/* A Board Information structure that is given to a program when+ * EPPC-Bug starts it up.+ */+typedef struct bd_info {+	 unsigned long	bi_memstart;	/* start of  DRAM memory		*/+	 unsigned long	bi_memsize;	/* size  of  DRAM memory in bytes	*/+	 unsigned long	bi_flashstart;	/* start of FLASH memory		*/+	 unsigned long	bi_flashsize;	/* size  of FLASH memory		*/+	 unsigned long	bi_flashoffset;	/* reserved area for startup monitor	*/+	 unsigned long	bi_sramstart;	/* start of  SRAM memory		*/+	 unsigned long	bi_sramsize;	/* size  of  SRAM memory		*/+	 unsigned long	bi_immr_base;	/* base of IMMR register		*/+	 unsigned long	bi_bootflags;	/* boot / reboot flag (for LynxOS)	*/+	 unsigned long	bi_ip_addr;	/* IP Address				*/+	 unsigned char	bi_enetaddr[6];	/* Ethernet adress			*/+	 unsigned char	bi_reserved[2];	/* -- just for alignment --		*/+	 unsigned long	bi_putchar;	/* Addr of monitor putchar() to Console	*/+	 unsigned long	bi_intfreq;	/* Internal Freq, in MHz		*/+	 unsigned long	bi_busfreq;	/* Bus Freq, in MHz			*/+	 unsigned long	bi_baudrate;	/* Console Baudrate			*/+} bd_t;++#endif /* __ASSEMBLY__ */++#define	TQM_IMMR_BASE	0xFFF00000	/* phys. addr of IMMR			*/+#define	TQM_IMAP_SIZE	(64 * 1024)	/* size of mapped area			*/++#define	IMAP_ADDR	TQM_IMMR_BASE	/* physical base address of IMMR area	*/+#define IMAP_SIZE	TQM_IMAP_SIZE	/* mapped size of IMMR area		*/++/* We don't use the 8259.+*/+#define NR_8259_INTS	0++/* Generic 8xx type+*/+#ifdef	CONFIG_TQM8xxL+#define _MACH_8xx (_MACH_tqm8xxL)+#endif+#ifdef	CONFIG_TQM860+#define _MACH_8xx (_MACH_tqm8xxL)+#endif++#endif	/* __MACH_TQM8xx_DEFS */+ diff -u linux-2.2.13/arch/ppc/mbxboot/head_tqm.S.ORIG linux-2.2.13/arch/ppc/mbxboot/head_tqm.S--- linux-2.2.13/arch/ppc/mbxboot/head_tqm.S.ORIG	Mon Jan 10 01:02:08 2000+++ linux-2.2.13/arch/ppc/mbxboot/head_tqm.S	Mon Jan 10 01:00:06 2000@@ -0,0 +1,384 @@+#include <linux/config.h>+#include "../kernel/ppc_defs.h"+#include "../kernel/ppc_asm.tmpl"

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -