fillsysinfo.c revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2005 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <sys/promimpl.h>
#include <sys/machsystm.h>
#include <sys/cpu_module.h>
/*
* The OpenBoot Standalone Interface supplies the kernel with
*/
/*
* structure describing properties that we are interested in querying the
* OBP for.
*/
struct getprop_info {
char *name;
};
/*
* structure used to convert between a string returned by the OBP & a type
* used within the kernel. We prefer to paramaterize rather than type.
*/
struct convert_info {
char *name;
char *realname;
};
/*
* structure describing nodes that we are interested in querying the OBP for
* properties.
*/
struct node_info {
char *name;
int size;
struct getprop_info *prop;
struct getprop_info *prop_end;
unsigned int *value;
};
/*
* macro definitions for routines that form the OBP interface
*/
#define NEXT prom_nextnode
#define CHILD prom_childnode
#define GETPROP prom_getprop
#define GETPROPLEN prom_getproplen
/* 0=quiet; 1=verbose; 2=debug */
int debug_fillsysinfo = 0;
int ncpunode;
void plat_fill_mc(dnode_t);
#pragma weak plat_fill_mc
int niobus = 0;
uint_t niommu_tsbs = 0;
/*
* Hardware watchdog support.
*/
#define CHOSEN_EEPROM "eeprom"
static dnode_t chosen_eeprom;
/*
* If this variable is non-zero, cpr should return "not supported" when
* it is queried even though it would normally be supported on this platform.
*/
/*
* Some platforms may need to support CPR even in the absence of the
* energystar-v* property (Enchilada server, for example). If this
* variable is non-zero, cpr should proceed even in the absence
* of the energystar-v* property.
*/
int cpr_platform_enable = 0;
/*
* Some nodes have functions that need to be called when they're seen.
*/
static struct wkdevice {
char *wk_namep;
#define V_OPTIONAL 0x0000
#define V_MUSTHAVE 0x0001
#define V_MAPPED 0x0002
} wkdevice[] = {
{ 0, },
};
static void map_wellknown(dnode_t);
void
{
/*
* if there is a chosen eeprom, note it (for have_eeprom())
*/
sizeof (phandle_t) &&
/*
* Get System clock frequency from root node if it exists.
*/
/*
* See if it worked
*/
}
}
}
/*
* map_wellknown - map known devices & registers
*/
static void
{
extern int status_okay(int, char *, int);
char tmp_name[MAXSYSNAME];
static void fill_address(dnode_t, char *);
int sok;
#ifdef VPRINTF
#endif /* VPRINTF */
/*
* prune subtree if status property indicating not okay
*/
if (!sok) {
char devtype_buf[OBP_MAXPROPNAME];
int size;
#ifdef VPRINTF
VPRINTF("map_wellknown: !okay status property\n");
#endif /* VPRINTF */
/*
* a status property indicating bad memory will be
* associated with a node which has a "device_type"
* property with a value of "memory-controller"
*/
OBP_DEVICETYPE)) == -1)
continue;
if (size > OBP_MAXPROPNAME) {
continue;
}
devtype_buf) == -1) {
continue;
}
continue;
/*
* ...else fall thru and process the node...
*/
}
}
(&plat_fill_mc != NULL))
}
}
static void
{
int size;
continue;
return;
continue;
}
"big\n", namep);
continue;
}
namep);
continue;
}
/* make into a native pointer */
#ifdef VPRINTF
#endif /* VPRINTF */
}
/*
* If this one is optional and there may be more than
* one, don't set V_MAPPED, which would cause us to skip it
* next time around
*/
}
}
void
{
char *namebufp;
}
return;
}
unum[0] = '\0';
namebufp += 5;
/*
* If we didn't find it in the CPU node, look in the root node.
*/
clk_freq = 0;
}
/*
* Compute scaling factor based on rate of %tick. This is used
* to convert from ticks derived from %tick to nanoseconds. See
*/
/*
* Call cpu module specific code to fill in the cpu properities
*/
}
#define IOMMU_PER_SCHIZO 2
/*
* The first psycho must always programmed up for the system clock and error
* handling purposes.
*/
static void
{
int size;
char compatible[OBP_MAXDRVNAME];
if (size == -1)
return;
niobus++;
/*
* Need two physical TSBs for Schizo-compatible nodes,
* one otherwise.
*/
compatible[0] = '\0';
else
niommu_tsbs++;
}
int
get_cpu_pagesizes(void)
{
/*
* XXXQ Get supported page sizes information from the PD
* and return a bit mask indicating which page sizes are
* supported.
*
* Return 0 when no information is available.
*/
return (0); /* XXXQ for now return 0 as no PD */
}