root/arch/ppc/kernel/setup.c

/* [previous][next][first][last][top][bottom][index][help] */

DEFINITIONS

This source file includes following definitions.
  1. get_cpuinfo
  2. bios32_init
  3. find_end_of_memory
  4. setup_arch
  5. sys_ioperm
  6. builtin_ramdisk_init

   1 /*
   2  *  linux/arch/ppc/kernel/setup.c
   3  *
   4  *  Copyright (C) 1995  Linus Torvalds
   5  *  Adapted from 'alpha' version by Gary Thomas
   6  */
   7 
   8 /*
   9  * bootup setup stuff..
  10  */
  11 
  12 #include <linux/errno.h>
  13 #include <linux/sched.h>
  14 #include <linux/kernel.h>
  15 #include <linux/mm.h>
  16 #include <linux/stddef.h>
  17 #include <linux/unistd.h>
  18 #include <linux/ptrace.h>
  19 #include <linux/malloc.h>
  20 #include <linux/ldt.h>
  21 #include <linux/user.h>
  22 #include <linux/a.out.h>
  23 #include <linux/tty.h>
  24 
  25 #include <asm/pgtable.h>
  26 extern PTE *Hash;
  27 extern unsigned long Hash_size, Hash_mask;
  28 
  29 char sda_root[] = "root=/dev/sda1";
  30 
  31 unsigned char aux_device_present;
  32 int get_cpuinfo(char *buffer)
     /* [previous][next][first][last][top][bottom][index][help] */
  33 {
  34 }
  35 /*
  36  * The format of "screen_info" is strange, and due to early
  37  * i386-setup code. This is just enough to make the console
  38  * code think we're on a EGA+ colour display.
  39  */
  40 struct screen_info screen_info = {
  41         0, 0,                   /* orig-x, orig-y */
  42         0, 0,                   /* unused */
  43         0,                      /* orig-video-page */
  44         0,                      /* orig-video-mode */
  45         80,                     /* orig-video-cols */
  46         0,0,0,                  /* ega_ax, ega_bx, ega_cx */
  47         25                      /* orig-video-lines */
  48 };
  49 
  50 unsigned long bios32_init(unsigned long memory_start, unsigned long memory_end)
     /* [previous][next][first][last][top][bottom][index][help] */
  51 {
  52         return memory_start;
  53 }
  54 
  55 unsigned long find_end_of_memory(void)
     /* [previous][next][first][last][top][bottom][index][help] */
  56 {
  57         unsigned char dram_size = inb(0x0804);
  58         unsigned long total;
  59 _printk("DRAM Size = %x\n", dram_size);
  60 _printk("Config registers = %x/%x/%x\n", inb(0x0800), inb(0x0801), inb(0x0802));
  61         switch (dram_size & 0x07)
  62         {
  63                 case 0:
  64                         total = 0x08000000;  /* 128M */
  65                         break;
  66                 case 1:
  67                         total = 0x02000000;  /* 32M */
  68                         break;
  69                 case 2:
  70                         total = 0x00800000;  /* 8M */
  71                         break;
  72                 case 3:
  73                         total = 0x00400000;  /* 4M - can't happen! */
  74                         break;
  75                 case 4:
  76                         total = 0x10000000;  /* 256M */
  77                         break;
  78                 case 5:
  79                         total = 0x04000000;  /* 64M */
  80                         break;
  81                 case 6:
  82                         total = 0x01000000;  /* 16M */
  83                         break;
  84                 case 7:
  85                         total = 0x04000000;  /* Can't happen */
  86                         break;
  87         }
  88         switch ((dram_size>>4) & 0x07)
  89         {
  90                 case 0:
  91                         total += 0x08000000;  /* 128M */
  92                         break;
  93                 case 1:
  94                         total += 0x02000000;  /* 32M */
  95                         break;
  96                 case 2:
  97                         total += 0x00800000;  /* 8M */
  98                         break;
  99                 case 3:
 100                         total += 0x00000000;  /* Module not present */
 101                         break;
 102                 case 4:
 103                         total += 0x10000000;  /* 256M */
 104                         break;
 105                 case 5:
 106                         total += 0x04000000;  /* 64M */
 107                         break;
 108                 case 6:
 109                         total += 0x01000000;  /* 16M */
 110                         break;
 111                 case 7:
 112                         total += 0x00000000;  /* Module not present */
 113                         break;
 114         }
 115 _printk("register total = %08X\n", total);      
 116 /* TEMP */ total = 0x01000000;
 117 /*_cnpause();   */
 118 /* CAUTION!! This can be done more elegantly! */        
 119         if (total < 0x01000000)
 120         {
 121                 Hash_size = HASH_TABLE_SIZE_64K;
 122                 Hash_mask = HASH_TABLE_MASK_64K;
 123         } else
 124         {
 125                 Hash_size = HASH_TABLE_SIZE_128K;
 126                 Hash_mask = HASH_TABLE_MASK_128K;
 127         }
 128         Hash = (PTE *)((total-Hash_size)+KERNELBASE);
 129         bzero(Hash, Hash_size);
 130         return ((unsigned long)Hash);
 131 }
 132 
 133 int size_memory;
 134 
 135 #define DEFAULT_ROOT_DEVICE 0x0200      /* fd0 */
 136 
 137 void setup_arch(char **cmdline_p,
     /* [previous][next][first][last][top][bottom][index][help] */
 138         unsigned long * memory_start_p, unsigned long * memory_end_p)
 139 {
 140 
 141   extern int _end;
 142         extern char cmd_line[];
 143 
 144         ROOT_DEV = DEFAULT_ROOT_DEVICE;
 145         aux_device_present = 0xaa;
 146         *cmdline_p = cmd_line;
 147         *memory_start_p = (unsigned long) &_end;
 148         *memory_end_p = (unsigned long *)Hash;
 149         size_memory = *memory_end_p - KERNELBASE;  /* Relative size of memory */
 150 
 151 /*      _printk("setup_arch() done!  memory_start = %08X memory_end = %08X\n"
 152                 ,*memory_start_p,*memory_end_p);*/
 153 
 154 }
 155 
 156 asmlinkage int sys_ioperm(unsigned long from, unsigned long num, int on)
     /* [previous][next][first][last][top][bottom][index][help] */
 157 {
 158         return -EIO;
 159 }
 160 
 161 extern char builtin_ramdisk_image;
 162 extern long builtin_ramdisk_size;
 163 
 164 void
 165 builtin_ramdisk_init(void)
     /* [previous][next][first][last][top][bottom][index][help] */
 166 {
 167         if (ROOT_DEV == DEFAULT_ROOT_DEVICE)
 168         {
 169                 rd_preloaded_init(&builtin_ramdisk_image, builtin_ramdisk_size);
 170         }
 171 }
 172 

/* [previous][next][first][last][top][bottom][index][help] */