patch-2.3.9 linux/arch/mips/kernel/setup.c
Next file: linux/arch/mips/kernel/signal.c
Previous file: linux/arch/mips/kernel/scall_o32.S
Back to the patch index
Back to the overall index
- Lines: 191
- Date:
Fri Jun 25 17:40:12 1999
- Orig file:
v2.3.8/linux/arch/mips/kernel/setup.c
- Orig date:
Tue Oct 20 13:52:54 1998
diff -u --recursive --new-file v2.3.8/linux/arch/mips/kernel/setup.c linux/arch/mips/kernel/setup.c
@@ -1,4 +1,4 @@
-/* $Id: setup.c,v 1.12 1998/08/18 20:45:06 ralf Exp $
+/* $Id: setup.c,v 1.16 1999/06/17 13:25:47 ralf Exp $
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
@@ -28,6 +28,7 @@
#ifdef CONFIG_BLK_DEV_RAM
#include <linux/blk.h>
#endif
+#include <linux/ide.h>
#ifdef CONFIG_RTC
#include <linux/ioport.h>
#include <linux/timex.h>
@@ -36,7 +37,6 @@
#include <asm/asm.h>
#include <asm/bootinfo.h>
#include <asm/cachectl.h>
-#include <asm/ide.h>
#include <asm/io.h>
#include <asm/stackframe.h>
#include <asm/system.h>
@@ -76,7 +76,6 @@
* information is being use to continue the screen output just below
* the BIOS printed text and with the same text resolution.
*/
-struct drive_info_struct drive_info = DEFAULT_DRIVE_INFO;
struct screen_info screen_info = DEFAULT_SCREEN_INFO;
#ifdef CONFIG_BLK_DEV_FD
@@ -92,20 +91,20 @@
extern struct rtc_ops no_rtc_ops;
struct rtc_ops *rtc_ops;
+extern struct kbd_ops no_kbd_ops;
+struct kbd_ops *kbd_ops;
+
/*
* Setup information
*
- * These are intialized so they are in the .data section
+ * These are initialized so they are in the .data section
*/
unsigned long mips_memory_upper = KSEG0; /* this is set by kernel_entry() */
unsigned long mips_cputype = CPU_UNKNOWN;
unsigned long mips_machtype = MACH_UNKNOWN;
unsigned long mips_machgroup = MACH_GROUP_UNKNOWN;
-unsigned long mips_tlb_entries = 48; /* Guess which CPU I've got :) */
-unsigned long mips_vram_base = KSEG0;
unsigned char aux_device_present;
-extern int root_mountflags;
extern int _end;
extern char empty_zero_page[PAGE_SIZE];
@@ -114,17 +113,10 @@
* This is set up by the setup-routine at boot-time
*/
#define PARAM empty_zero_page
-#if 0
-#define ORIG_ROOT_DEV (*(unsigned short *) (PARAM+0x1FC))
-#define AUX_DEVICE_INFO (*(unsigned char *) (PARAM+0x1FF))
-#endif
-#define LOADER_TYPE (*(unsigned char *) (PARAM+0x210))
-#define KERNEL_START (*(unsigned long *) (PARAM+0x214))
-#define INITRD_START (*(unsigned long *) (PARAM+0x218))
-#define INITRD_SIZE (*(unsigned long *) (PARAM+0x21c))
static char command_line[CL_SIZE] = { 0, };
char saved_command_line[CL_SIZE];
+extern char arcs_cmdline[CL_SIZE];
/*
* The board specific setup routine sets irq_setup to point to a board
@@ -153,7 +145,11 @@
unsigned long * memory_start_p, unsigned long * memory_end_p))
{
unsigned long memory_end;
- tag* atag;
+#ifdef CONFIG_BLK_DEV_INITRD
+ unsigned long tmp;
+ unsigned long *initrd_header;
+#endif
+ void baget_setup(void);
void cobalt_setup(void);
void decstation_setup(void);
void deskstation_setup(void);
@@ -161,18 +157,6 @@
void sni_rm200_pci_setup(void);
void sgi_setup(void);
- /* Perhaps a lot of tags are not getting 'snarfed' - */
- /* please help yourself */
-
- atag = bi_TagFind(tag_machtype);
- memcpy(&mips_machtype, TAGVALPTR(atag), atag->size);
-
- atag = bi_TagFind(tag_machgroup);
- memcpy(&mips_machgroup, TAGVALPTR(atag), atag->size);
-
- atag = bi_TagFind(tag_vram_base);
- memcpy(&mips_vram_base, TAGVALPTR(atag), atag->size);
-
/* Save defaults for configuration-dependent routines. */
irq_setup = default_irq_setup;
@@ -185,14 +169,25 @@
#endif
rtc_ops = &no_rtc_ops;
+ kbd_ops = &no_kbd_ops;
switch(mips_machgroup)
{
+#ifdef CONFIG_BAGET_MIPS
+ case MACH_GROUP_UNKNOWN:
+ baget_setup();
+ break;
+#endif
#ifdef CONFIG_COBALT_MICRO_SERVER
case MACH_GROUP_COBALT:
cobalt_setup();
break;
#endif
+#ifdef CONFIG_DECSTATION
+ case MACH_GROUP_DEC:
+ decstation_setup();
+ break;
+#endif
#ifdef CONFIG_MIPS_JAZZ
case MACH_GROUP_JAZZ:
jazz_setup();
@@ -212,9 +207,6 @@
panic("Unsupported architecture");
}
- atag = bi_TagFind(tag_drive_info);
- memcpy(&drive_info, TAGVALPTR(atag), atag->size);
-
memory_end = mips_memory_upper;
/*
* Due to prefetching and similar mechanism the CPU sometimes
@@ -225,20 +217,7 @@
memory_end -= 128;
memory_end &= PAGE_MASK;
-#ifdef CONFIG_BLK_DEV_RAM
- rd_image_start = RAMDISK_FLAGS & RAMDISK_IMAGE_START_MASK;
- rd_prompt = ((RAMDISK_FLAGS & RAMDISK_PROMPT_FLAG) != 0);
- rd_doload = ((RAMDISK_FLAGS & RAMDISK_LOAD_FLAG) != 0);
-#endif
-
- atag = bi_TagFind(tag_mount_root_rdonly);
- if (atag)
- root_mountflags |= MS_RDONLY;
-
- atag = bi_TagFind(tag_command_line);
- if (atag)
- memcpy(&command_line, TAGVALPTR(atag), atag->size);
-
+ strncpy (command_line, arcs_cmdline, CL_SIZE);
memcpy(saved_command_line, command_line, CL_SIZE);
saved_command_line[CL_SIZE-1] = '\0';
@@ -247,15 +226,21 @@
*memory_end_p = memory_end;
#ifdef CONFIG_BLK_DEV_INITRD
- if (LOADER_TYPE) {
- initrd_start = INITRD_START;
- initrd_end = INITRD_START+INITRD_SIZE;
+ 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];
+ initrd_below_start_ok = 1;
if (initrd_end > memory_end) {
printk("initrd extends beyond end of memory "
"(0x%08lx > 0x%08lx)\ndisabling initrd\n",
initrd_end,memory_end);
- initrd_start = 0;
- }
+ initrd_start = 0;
+ } else
+ *memory_start_p = initrd_end;
}
#endif
}
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)