root/arch/sparc/boot/init_me.c

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

DEFINITIONS

This source file includes following definitions.
  1. init_me

   1 /* init_me.c:  Initialize imperical constants and gather some info from
   2  *             the boot prom.
   3  *
   4  * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
   5  */
   6 
   7 #include <asm/openprom.h>  /* For property declarations and the prom structs */
   8 #include <asm/oplib.h>
   9 #include <asm/vac-ops.h>
  10 
  11 #include "imperical.h"   /* Don't ask... */
  12 
  13 #define DEBUG_INIT_ME    /* Tell me whats goin on */
  14 
  15 unsigned int nwindows;   /* Set in bare.S */
  16 unsigned int nwindowsm1;
  17 unsigned int pac_or_vac; /* 0 means "dunno" 1 means "VAC" 2 means "PAC" */
  18 unsigned int pvac_size;  /* Use the same two variables for a PAC and VAC */
  19 unsigned int pvac_linesize;
  20 unsigned int pac_size;
  21 int num_segmaps;
  22 int num_contexts;
  23 unsigned int BOGOMIPS;        /* bogosity without the VAC cache on */
  24 unsigned int BOGOMIPS_WCACHE; /* bogosity with the VAC cache */
  25 unsigned int delay_factor;
  26 
  27 extern int prom_node_root;
  28 void (*printk)(const char *str, ...);
  29 
  30 void init_me(void)
     /* [previous][next][first][last][top][bottom][index][help] */
  31 {
  32         unsigned int grrr;
  33 
  34         printk = romvec->pv_printf;
  35         prom_node_root = prom_nextnode(0);
  36         prom_getprop(prom_node_root, "mmu-npmg", &num_segmaps,
  37                      sizeof(unsigned int));
  38 
  39         pvac_size = prom_getint_default(prom_node_root, "vac-size", 65536);
  40 
  41         pvac_linesize = prom_getint_default(prom_node_root, "vac-linesize", 16);
  42         
  43         grrr = prom_getint_default(prom_node_root, "mips-on", 0);
  44         if(!grrr) {
  45                 grrr = prom_getint_default(prom_node_root, "clock-frequency", 0);
  46                 if(grrr > 15000000 && grrr < 100000000) {
  47                         BOGOMIPS = 3;
  48                         BOGOMIPS_WCACHE = grrr / 1000000;
  49                 } else {
  50                         BOGOMIPS = DEF_BOGO;
  51                         BOGOMIPS_WCACHE = DEF_BOGO;
  52                 }
  53         } else (BOGOMIPS_WCACHE = grrr, 
  54                 BOGOMIPS = prom_getint(prom_node_root, "mips-off"));
  55 
  56 #ifdef DEBUG_INIT_ME
  57         (*(romvec->pv_printf))("\nBOGOMIPS        %d\n", (int) BOGOMIPS);
  58         (*(romvec->pv_printf))("BOGOMIPS_WCACHE %d\n", (int) BOGOMIPS_WCACHE);
  59         (*(romvec->pv_printf))("pvac_size        %d\n", (int) pvac_size);
  60         (*(romvec->pv_printf))("pvac_linesize    %d\n", (int) pvac_linesize);
  61         (*(romvec->pv_printf))("num_segmaps     %d\n", (int) num_segmaps);
  62 #endif
  63 
  64         delay_factor = (BOGOMIPS > 3) ? ((BOGOMIPS - 2) >> 1) : 11;
  65 
  66         (*(romvec->pv_printf))("\nLILO: \n");
  67         return;
  68 }

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