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

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