diff -Naur linux-2.4.20/Makefile linux-2.4.20working/Makefile --- linux-2.4.20/Makefile Tue Dec 24 11:20:09 2002 +++ linux-2.4.20working/Makefile Mon Dec 23 03:04:34 2002 @@ -414,7 +414,7 @@ endif .PHONY: _modinst_post _modinst_post: _modinst_post_pcmcia - if [ -r System.map ]; then $(DEPMOD) -ae -F System.map $(depmod_opts) $(KERNELRELEASE); fi + if [ -r System.map ]; then $(DEPMOD) -ae -F System.map $(depmod_opts) $(KERNELRELEASE) || true; fi # Backwards compatibilty symlinks for people still using old versions # of pcmcia-cs with hard coded pathnames on insmod. Remove diff -Naur linux-2.4.20/arch/mips/arc/arc_con.c linux-2.4.20working/arch/mips/arc/arc_con.c --- linux-2.4.20/arch/mips/arc/arc_con.c Thu Nov 28 23:53:09 2002 +++ linux-2.4.20working/arch/mips/arc/arc_con.c Mon Dec 23 03:05:23 2002 @@ -39,7 +39,7 @@ } static struct console arc_cons = { - name: "ttyS", + name: "arc", write: prom_console_write, device: prom_console_device, setup: prom_console_setup, diff -Naur linux-2.4.20/arch/mips/boot/addinitrd.c linux-2.4.20working/arch/mips/boot/addinitrd.c --- linux-2.4.20/arch/mips/boot/addinitrd.c Thu Nov 28 23:53:09 2002 +++ linux-2.4.20working/arch/mips/boot/addinitrd.c Mon Dec 23 03:08:00 2002 @@ -2,6 +2,8 @@ * addinitrd - program to add a initrd image to an ecoff kernel * * (C) 1999 Thomas Bogendoerfer + * minor modifications, cleanup: Guido Guenther + * */ #include @@ -54,7 +56,7 @@ exit (1); } - if ((fd_vmlinux = open (argv[1],O_RDWR)) < 0) + if ((fd_vmlinux = open (argv[1],O_RDONLY)) < 0) die ("open vmlinux"); if (read (fd_vmlinux, &efile, sizeof efile) != sizeof efile) die ("read file header"); @@ -77,7 +79,12 @@ if (efile.f_magic == swab16(MIPSEBMAGIC)) swab = 1; } - + + /* make sure we have an empty data segment for the initrd */ + if( eaout.dsize || esecs[1].s_size ) { + fprintf(2,"Data segment not empty. Giving up!"); + exit(1); + } if ((fd_initrd = open (argv[2], O_RDONLY)) < 0) die ("open initrd"); if (fstat (fd_initrd, &st) < 0) diff -Naur linux-2.4.20/arch/mips/kernel/proc.c linux-2.4.20working/arch/mips/kernel/proc.c --- linux-2.4.20/arch/mips/kernel/proc.c Thu Nov 28 23:53:10 2002 +++ linux-2.4.20working/arch/mips/kernel/proc.c Mon Dec 23 03:09:16 2002 @@ -105,6 +105,11 @@ seq_printf(m, "BogoMIPS\t\t: %lu.%02lu\n", loops_per_jiffy / (500000/HZ), (loops_per_jiffy / (5000/HZ)) % 100); +#ifdef __MIPSEB__ + seq_printf(m, "byteorder\t\t: big endian\n"); +#else + seq_printf(m, "byteorder\t\t: little endian\n"); +#endif seq_printf(m, "wait instruction\t: %s\n", cpu_wait ? "yes" : "no"); seq_printf(m, "microsecond timers\t: %s\n", (mips_cpu.options & MIPS_CPU_COUNTER) ? "yes" : "no"); diff -Naur linux-2.4.20/arch/mips/kernel/setup.c linux-2.4.20working/arch/mips/kernel/setup.c --- linux-2.4.20/arch/mips/kernel/setup.c Thu Nov 28 23:53:10 2002 +++ linux-2.4.20working/arch/mips/kernel/setup.c Mon Dec 23 03:14:48 2002 @@ -236,6 +236,38 @@ } } +static inline void parse_rd_cmdline(unsigned long* rd_start, unsigned long* rd_end) +{ + char c = ' ', *to = command_line, *from = saved_command_line; + int len = 0; + unsigned long rd_size = 0; + + for (;;) { + /* + * "rd_start=0xNNNNNNNN" defines the memory address of an initrd + * "rd_size=0xNN" it's size + */ + if (c == ' ' && !memcmp(from, "rd_start=", 9)) { + if (to != command_line) + to--; + (*rd_start) = memparse(from + 9, &from); + } + if (c == ' ' && !memcmp(from, "rd_size=", 8)) { + if (to != command_line) + to--; + rd_size = memparse(from + 8, &from); + } + c = *(from++); + if (!c) + break; + if (CL_SIZE <= ++len) + break; + *(to++) = c; + } + *to = '\0'; + (*rd_end) = (*rd_start) + rd_size; +} + void __init setup_arch(char **cmdline_p) { void atlas_setup(void); @@ -264,11 +296,7 @@ unsigned long bootmap_size; unsigned long start_pfn, max_pfn, max_low_pfn, first_usable_pfn; -#ifdef CONFIG_BLK_DEV_INITRD - unsigned long tmp; - unsigned long* initrd_header; -#endif - + unsigned long end = &_end; int i; #ifdef CONFIG_BLK_DEV_FD @@ -449,23 +477,18 @@ #define MAXMEM_PFN PFN_DOWN(MAXMEM) #ifdef CONFIG_BLK_DEV_INITRD - tmp = (((unsigned long)&_end + PAGE_SIZE-1) & PAGE_MASK) - 8; - if (tmp < (unsigned long)&_end) - tmp += PAGE_SIZE; - initrd_header = (unsigned long *)tmp; - if (initrd_header[0] == 0x494E5244) { - initrd_start = (unsigned long)&initrd_header[2]; - initrd_end = initrd_start + initrd_header[1]; + parse_rd_cmdline(&initrd_start, &initrd_end); + if(initrd_start && initrd_end) + end = initrd_end; + else { + initrd_start = initrd_end = 0; } - start_pfn = PFN_UP(__pa((&_end)+(initrd_end - initrd_start) + PAGE_SIZE)); -#else +#endif /* CONFIG_BLK_DEV_INITRD */ /* * Partially used pages are not usable - thus * we are rounding upwards. */ - start_pfn = PFN_UP(__pa(&_end)); -#endif /* CONFIG_BLK_DEV_INITRD */ - + start_pfn = PFN_UP(__pa(end)); /* Find the highest page frame number we have available. */ max_pfn = 0; first_usable_pfn = -1UL; diff -Naur linux-2.4.20/arch/mips/sgi-ip22/ip22-gio.c linux-2.4.20working/arch/mips/sgi-ip22/ip22-gio.c --- linux-2.4.20/arch/mips/sgi-ip22/ip22-gio.c Thu Nov 28 23:53:10 2002 +++ linux-2.4.20working/arch/mips/sgi-ip22/ip22-gio.c Mon Dec 23 03:17:07 2002 @@ -69,14 +69,12 @@ int i; char *p = buf; - p += sprintf(p, "GIO devices found:\n"); for (i = 0; i < GIO_NUM_SLOTS; i++) { if (gio_slot[i].flags & GIO_NO_DEVICE) continue; - p += sprintf(p, " Slot %s, DeviceId 0x%02x\n", - gio_slot[i].slot_name, gio_slot[i].device); - p += sprintf(p, " BaseAddr 0x%08lx, MapSize 0x%08x\n", - gio_slot[i].base_addr, gio_slot[i].map_size); + p += sprintf(p, "%s 0x%02x 0x%08lx 0x%08x\n", + gio_slot[i].slot_name, gio_slot[i].device, + gio_slot[i].base_addr, gio_slot[i].map_size); } return p - buf; @@ -84,7 +82,16 @@ void create_gio_proc_entry(void) { - create_proc_read_entry("gio", 0, NULL, gio_read_proc, NULL); + int i; + + for (i = 0; i < GIO_NUM_SLOTS; i++) { + /* only create proc entry if we have at least one device */ + if (! (gio_slot[i].flags & GIO_NO_DEVICE)) + if( proc_mkdir("bus/gio", NULL) ) + create_proc_read_entry("bus/gio/devices", 0, + NULL, gio_read_proc, NULL); + break; + } } /** diff -Naur linux-2.4.20/arch/mips/sgi-ip22/ip22-setup.c linux-2.4.20working/arch/mips/sgi-ip22/ip22-setup.c --- linux-2.4.20/arch/mips/sgi-ip22/ip22-setup.c Thu Nov 28 23:53:10 2002 +++ linux-2.4.20working/arch/mips/sgi-ip22/ip22-setup.c Tue Dec 24 10:55:18 2002 @@ -37,9 +37,7 @@ static int remote_debug = 0; #endif -#if defined(CONFIG_SERIAL_CONSOLE) || defined(CONFIG_ARC_CONSOLE) -extern void console_setup(char *); -#endif +/* extern int console_setup(char *); */ extern void sgitime_init(void); @@ -162,19 +160,24 @@ * line and "d2" for the second serial line. */ ctype = ArcGetEnvironmentVariable("console"); - if (*ctype == 'd') { + if (ctype && *ctype == 'd') { #ifdef CONFIG_SERIAL_CONSOLE +/* if(*(ctype + 1) == '2') - console_setup("ttyS1"); + console_setup("ttyS1"); else console_setup("ttyS0"); +*/ #endif - } else { + } #ifdef CONFIG_ARC_CONSOLE - prom_flags &= PROM_FLAG_USE_AS_CONSOLE; - console_setup("ttyS0"); -#endif + else if (!ctype || *ctype != 'g') { + /* Use ARC if we don't want serial ('d') or + * Newport ('g'). */ + prom_flags |= PROM_FLAG_USE_AS_CONSOLE; +/* console_setup("arc"); */ } +#endif #ifdef CONFIG_REMOTE_DEBUG kgdb_ttyd = prom_getcmdline(); @@ -201,7 +204,7 @@ #ifdef CONFIG_VT #ifdef CONFIG_SGI_NEWPORT_CONSOLE - { + if (ctype && *ctype == 'g'){ unsigned long *gfxinfo; long (*__vec)(void) = (void *) *(long *)((PROMBLOCK)->pvector + 0x20); @@ -209,29 +212,29 @@ sgi_gfxaddr = ((gfxinfo[1] >= 0xa0000000 && gfxinfo[1] <= 0xc0000000) ? gfxinfo[1] - 0xa0000000 : 0); + + /* newport addresses? */ + if (sgi_gfxaddr == 0x1f0f0000 || sgi_gfxaddr == 0x1f4f0000) { + conswitchp = &newport_con; + + screen_info = (struct screen_info) { + 0, 0, /* orig-x, orig-y */ + 0, /* unused */ + 0, /* orig_video_page */ + 0, /* orig_video_mode */ + 160, /* orig_video_cols */ + 0, 0, 0, /* unused, ega_bx, unused */ + 64, /* orig_video_lines */ + 0, /* orig_video_isVGA */ + 16 /* orig_video_points */ + }; + } } - /* newport addresses? */ - if (sgi_gfxaddr == 0x1f0f0000 || sgi_gfxaddr == 0x1f4f0000) { - conswitchp = &newport_con; - - screen_info = (struct screen_info) { - 0, 0, /* orig-x, orig-y */ - 0, /* unused */ - 0, /* orig_video_page */ - 0, /* orig_video_mode */ - 160, /* orig_video_cols */ - 0, 0, 0, /* unused, ega_bx, unused */ - 64, /* orig_video_lines */ - 0, /* orig_video_isVGA */ - 16 /* orig_video_points */ - }; - } else { - conswitchp = &dummy_con; - } -#else -#ifdef CONFIG_DUMMY_CONSOLE - conswitchp = &dummy_con; #endif +#ifdef CONFIG_DUMMY_CONSOLE + /* Either if newport console wasn't used or failed to initialize. */ + if(conswitchp != &newport_con) + conswitchp = &dummy_con; #endif #endif diff -Naur linux-2.4.20/include/linux/console.h linux-2.4.20working/include/linux/console.h --- linux-2.4.20/include/linux/console.h Sat Aug 3 00:39:45 2002 +++ linux-2.4.20working/include/linux/console.h Tue Dec 24 10:29:21 2002 @@ -112,6 +112,7 @@ extern void release_console_sem(void); extern void console_conditional_schedule(void); extern void console_unblank(void); +extern int console_setup(char *); /* VESA Blanking Levels */ #define VESA_NO_BLANKING 0 diff -Naur linux-2.4.20/include/linux/elf.h linux-2.4.20working/include/linux/elf.h --- linux-2.4.20/include/linux/elf.h Thu Nov 28 23:53:15 2002 +++ linux-2.4.20working/include/linux/elf.h Mon Dec 23 20:44:22 2002 @@ -38,7 +38,8 @@ #define EF_MIPS_PIC 0x00000002 #define EF_MIPS_CPIC 0x00000004 #define EF_MIPS_ARCH 0xf0000000 - +#define EF_MIPS_ABI2 0x00000020 +#define EF_MIPS_ABI 0x0000f000 /* These constants define the different elf file types */ #define ET_NONE 0 #define ET_REL 1