Beispiel #1
0
/* Initializes the FRU nodes for the FCAL backplane */
static int
do_fcal_init(picl_nodehdl_t rooth)
{
	picl_nodehdl_t		fcalbrdh;
	picl_nodehdl_t		tmph;
	int			err;

	/* Create the node for the FCAL backplane (if it exists) */
	if (ptree_get_node_by_path(platform_frupath[FCAL], &tmph) ==
	    PICL_SUCCESS) {
		err = ptree_create_node("fcal-backplane", "fru", &fcalbrdh);
		if (err != PICL_SUCCESS)
			return (err);

		err = add_ref_prop(fcalbrdh, tmph, SEEPROM_SOURCE);
		if (err != PICL_SUCCESS)
			return (err);

		err = add_void_fda_prop(fcalbrdh);
		if (err != PICL_SUCCESS)
			return (err);

		err = ptree_add_node(rooth, fcalbrdh);
		if (err != PICL_SUCCESS)
			return (err);

		err = add_ref_prop(tmph, fcalbrdh, FRU_PARENT);
		if (err != PICL_SUCCESS)
			return (err);
	}
	return (PICL_SUCCESS);
}
Beispiel #2
0
/* Initializes the FRU node for the RSC card */
static int
do_rscboard_init(picl_nodehdl_t rooth)
{
	picl_nodehdl_t		rscbrdh;
	picl_nodehdl_t		tmph;
	int			err;

	/* Create the node for the RSC board (if it exists) */
	if (ptree_get_node_by_path(platform_frupath[RSC], &tmph) ==
	    PICL_SUCCESS) {
		err = ptree_create_node("rsc-board", "fru", &rscbrdh);
		if (err != PICL_SUCCESS)
			return (err);

		err = add_ref_prop(rscbrdh, tmph, SEEPROM_SOURCE);
		if (err != PICL_SUCCESS)
			return (err);

		err = add_void_fda_prop(rscbrdh);
		if (err != PICL_SUCCESS)
			return (err);

		err = ptree_add_node(rooth, rscbrdh);
		if (err != PICL_SUCCESS)
			return (err);

		err = add_ref_prop(tmph, rscbrdh, FRU_PARENT);
		if (err != PICL_SUCCESS)
			return (err);
	}
	return (PICL_SUCCESS);
}
Beispiel #3
0
/* Initialize the FRU node for the system board */
static int
do_sysboard_init(picl_nodehdl_t rooth, picl_nodehdl_t *childh)
{
	picl_nodehdl_t		tmph;
	int			err;

	/* Create the node for the system board */
	if (ptree_get_node_by_path(platform_frupath[SYSBRD], &tmph) ==
	    PICL_SUCCESS) {
		err = ptree_create_node("system-board", "fru", childh);
		if (err != PICL_SUCCESS)
			return (err);

		err = add_ref_prop(*childh, tmph, SEEPROM_SOURCE);
		if (err != PICL_SUCCESS)
			return (err);

		err = add_void_fda_prop(*childh);
		if (err != PICL_SUCCESS)
			return (err);

		err = ptree_add_node(rooth, *childh);
		if (err != PICL_SUCCESS)
			return (err);

		err = add_ref_prop(tmph, *childh, FRU_PARENT);
		if (err != PICL_SUCCESS)
			return (err);

	}
	return (PICL_SUCCESS);
}
Beispiel #4
0
/* Creates the FRU nodes for the DIMMs on a particular CPU Module */
static int
do_dimms_init(picl_nodehdl_t rooth, int slot, int module)
{
	picl_nodehdl_t		dimmsloth;
	picl_nodehdl_t		dimmmodh;
	picl_nodehdl_t		tmph;
	int			i, c, l, err;

	for (i = 0; i < DIMMS_PER_MOD; i++) {
		/* Create the node for the memory slot */
		err = ptree_create_node("dimm-slot", "location",
		    &dimmsloth);
		if (err != PICL_SUCCESS)
			return (err);

		err = add_slot_prop(dimmsloth, i);
		if (err != PICL_SUCCESS)
			return (err);

		c = ((slot * DIMMS_PER_SLOT) +
		    (module * DIMMS_PER_MOD) + i) + CPU0_DIMM0;

		l = c - (DIMMS_PER_SLOT * slot);

		err = add_label_prop(dimmsloth, location_label[l]);
		if (err != PICL_SUCCESS)
			return (err);

		err = ptree_add_node(rooth, dimmsloth);
		if (err != PICL_SUCCESS)
			return (err);

		/* If the memory module exists, create a node for it */
		if (ptree_get_node_by_path(platform_frupath[c], &tmph) ==
		    PICL_SUCCESS) {
			err = ptree_create_node("dimm-module", "fru",
			    &dimmmodh);
			if (err != PICL_SUCCESS)
				return (err);

			err = add_ref_prop(dimmmodh, tmph, SEEPROM_SOURCE);
			if (err != PICL_SUCCESS)
				return (err);

			err = add_void_fda_prop(dimmmodh);
			if (err != PICL_SUCCESS)
				return (err);

			err = ptree_add_node(dimmsloth, dimmmodh);
			if (err != PICL_SUCCESS)
				return (err);

			err = add_ref_prop(tmph, dimmmodh, FRU_PARENT);
			if (err != PICL_SUCCESS)
				return (err);
		}
	}
	return (PICL_SUCCESS);
}
Beispiel #5
0
/* Initializes the FRU nodes for the memory modules */
static int
do_mem_init(picl_nodehdl_t rooth)
{
	picl_nodehdl_t		memsloth;
	picl_nodehdl_t		memmodh;
	picl_nodehdl_t		tmph;
	int			i, err, slotnum;

	for (i = DIMM0; i <= DIMM7; i++) {
		/* Create the node for the memory slot */
		err = ptree_create_node("mem-slot", "location", &memsloth);
		if (err != PICL_SUCCESS)
			return (err);

		slotnum = i - DIMM0;
		err = add_slot_prop(memsloth, slotnum);
		if (err != PICL_SUCCESS)
			return (err);

		err = add_label_prop(memsloth, location_label[i]);
		if (err != PICL_SUCCESS)
			return (err);

		err = ptree_add_node(rooth, memsloth);
		if (err != PICL_SUCCESS)
			return (err);

		/* If the memory exists, create a node for it */
		if (ptree_get_node_by_path(platform_frupath[i], &tmph) ==
		    PICL_SUCCESS) {
			err = ptree_create_node("mem-module", "fru", &memmodh);
			if (err != PICL_SUCCESS)
				return (err);

			err = add_ref_prop(memmodh, tmph, SEEPROM_SOURCE);
			if (err != PICL_SUCCESS)
				return (err);

			err = add_void_fda_prop(memmodh);
			if (err != PICL_SUCCESS)
				return (err);

			err = ptree_add_node(memsloth, memmodh);
			if (err != PICL_SUCCESS)
				return (err);

			err = add_ref_prop(tmph, memmodh, FRU_PARENT);
			if (err != PICL_SUCCESS)
				return (err);
		}
	}
	return (PICL_SUCCESS);
}
Beispiel #6
0
/* Initializes the FRU nodes for the CPU modules */
static int
do_cpus_init(picl_nodehdl_t rooth)
{
	picl_nodehdl_t		cpusloth;
	picl_nodehdl_t		cpumodh;
	picl_nodehdl_t		tmph;
	int			i, err;

	for (i = CPU0; i <= CPU1; i++) {
		/* Create the node for the CPU slot */
		err = ptree_create_node("cpu-slot", "location", &cpusloth);
		if (err != PICL_SUCCESS)
			return (err);

		err = add_slot_prop(cpusloth, i);
		if (err != PICL_SUCCESS)
			return (err);

		err = add_label_prop(cpusloth, location_label[i]);
		if (err != PICL_SUCCESS)
			return (err);

		err = ptree_add_node(rooth, cpusloth);
		if (err != PICL_SUCCESS)
			return (err);

		/* If the CPU module exists, create a node for it */
		if (ptree_get_node_by_path(platform_frupath[i], &tmph) ==
		    PICL_SUCCESS) {
			err = ptree_create_node("cpu-module", "fru", &cpumodh);
			if (err != PICL_SUCCESS)
				return (err);

			err = add_ref_prop(cpumodh, tmph, SEEPROM_SOURCE);
			if (err != PICL_SUCCESS)
				return (err);

			err = add_void_fda_prop(cpumodh);
			if (err != PICL_SUCCESS)
				return (err);

			err = ptree_add_node(cpusloth, cpumodh);
			if (err != PICL_SUCCESS)
				return (err);

			err = add_ref_prop(tmph, cpumodh, FRU_PARENT);
			if (err != PICL_SUCCESS)
				return (err);
		}
	}
	return (PICL_SUCCESS);
}
Beispiel #7
0
/* Hotplug routine used to add a new CPU Mem Module (with associated DIMMs) */
static int
add_cpu_module(int slotnum)
{
	picl_nodehdl_t		cpumemsloth;
	picl_nodehdl_t		cpumemmodh;
	picl_nodehdl_t		tmph;
	int			i, err;

	/* Find the node for the given CPU Memory module slot */
	if (ptree_get_node_by_path(frutree_cpu_module[slotnum],
	    &cpumemsloth) == PICL_SUCCESS) {

		i = slotnum + CPUMOD0;

		/* Make sure it's in /platform and create the frutree nodes */
		if (ptree_get_node_by_path(platform_frupath[i], &tmph) ==
		    PICL_SUCCESS) {
			err = ptree_create_node("cpu-mem-module", "fru",
			    &cpumemmodh);
			if (err != PICL_SUCCESS)
				return (err);

			err = add_ref_prop(cpumemmodh, tmph, SEEPROM_SOURCE);
			if (err != PICL_SUCCESS)
				return (err);

			err = add_void_fda_prop(cpumemmodh);
			if (err != PICL_SUCCESS)
				return (err);

			err = ptree_add_node(cpumemsloth, cpumemmodh);
			if (err != PICL_SUCCESS)
				return (err);

			err = add_ref_prop(tmph, cpumemmodh, FRU_PARENT);
			if (err != PICL_SUCCESS)
				return (err);
		}

		err = do_cpu_module_init(cpumemmodh, slotnum);
		if (err != PICL_SUCCESS)
			return (err);
	}
	return (PICL_SUCCESS);
}
Beispiel #8
0
/* Hotplug routine used to add a new power supply */
static int
add_power_supply(int slotnum)
{
	picl_nodehdl_t		powersloth;
	picl_nodehdl_t		powermodh;
	picl_nodehdl_t		tmph;
	int			i, err;

	/* Find the node for the given power supply slot */
	if (ptree_get_node_by_path(frutree_power_supply[slotnum],
	    &powersloth) == PICL_SUCCESS) {

		i = slotnum + PS0;

		/* Make sure it's in /platform and create the frutree node */
		if (ptree_get_node_by_path(platform_frupath[i], &tmph) ==
		    PICL_SUCCESS) {
			err = ptree_create_node("power-supply", "fru",
			    &powermodh);
			if (err != PICL_SUCCESS)
				return (err);

			err = add_ref_prop(powermodh, tmph, SEEPROM_SOURCE);
			if (err != PICL_SUCCESS)
				return (err);

			err = add_void_fda_prop(powermodh);
			if (err != PICL_SUCCESS)
				return (err);

			err = ptree_add_node(powersloth, powermodh);
			if (err != PICL_SUCCESS)
				return (err);

			err = add_ref_prop(tmph, powermodh, FRU_PARENT);
			if (err != PICL_SUCCESS)
				return (err);

			/* Post picl-fru-added event */
			post_frudr_event(PICL_FRU_ADDED, NULL, powermodh);
		}
	}
	return (PICL_SUCCESS);
}
Beispiel #9
0
/* Initializes the FRU nodes for the motherboard and CPU Memory modules */
static int
do_motherboard_init(picl_nodehdl_t rooth)
{
	picl_nodehdl_t		sysboardh;
	picl_nodehdl_t		cpumemsloth;
	picl_nodehdl_t		cpumemmodh;
	picl_nodehdl_t		tmph;
	int			i, err, slotnum;

	/* Create the node for the system board (if it exists) */
	if (ptree_get_node_by_path(platform_frupath[SYSBRD], &tmph) ==
	    PICL_SUCCESS) {
		err = ptree_create_node("system-board", "fru",
		    &sysboardh);
		if (err != PICL_SUCCESS)
			return (err);

		err = add_ref_prop(sysboardh, tmph, SEEPROM_SOURCE);
		if (err != PICL_SUCCESS)
			return (err);

		err = add_void_fda_prop(sysboardh);
		if (err != PICL_SUCCESS)
			return (err);

		err = ptree_add_node(rooth, sysboardh);
		if (err != PICL_SUCCESS)
			return (err);

		err = add_ref_prop(tmph, sysboardh, FRU_PARENT);
		if (err != PICL_SUCCESS)
			return (err);

		for (i = CPUMOD0; i <= CPUMOD3; i++) {
			/* Create the node for the CPU Memory slot */
			err = ptree_create_node("cpu-mem-slot", "location",
			    &cpumemsloth);
			if (err != PICL_SUCCESS)
				return (err);

			slotnum = i - CPUMOD0;
			err = add_slot_prop(cpumemsloth, slotnum);
			if (err != PICL_SUCCESS)
				return (err);

			err = add_label_prop(cpumemsloth, location_label[i]);
			if (err != PICL_SUCCESS)
				return (err);

			err = ptree_add_node(sysboardh, cpumemsloth);
			if (err != PICL_SUCCESS)
				return (err);

			/* If CPU Mem module exists, create a node for it */
			if (ptree_get_node_by_path(platform_frupath[i],
			    &tmph) == PICL_SUCCESS) {
				err = ptree_create_node("cpu-mem-module",
				    "fru", &cpumemmodh);
				if (err != PICL_SUCCESS)
					return (err);

				err = add_ref_prop(cpumemmodh, tmph,
				    SEEPROM_SOURCE);
				if (err != PICL_SUCCESS)
					return (err);

				err = add_void_fda_prop(cpumemmodh);
				if (err != PICL_SUCCESS)
					return (err);

				err = ptree_add_node(cpumemsloth, cpumemmodh);
				if (err != PICL_SUCCESS)
					return (err);

				err = add_ref_prop(tmph, cpumemmodh,
				    FRU_PARENT);
				if (err != PICL_SUCCESS)
					return (err);

				err = do_cpu_module_init(cpumemmodh, slotnum);
				if (err != PICL_SUCCESS)
					return (err);
			}
		}
	}
	return (PICL_SUCCESS);
}
Beispiel #10
0
/* Initializes the FRU nodes for the PDB and the power supplies */
static int
do_power_supplies_init(picl_nodehdl_t rooth)
{
	picl_nodehdl_t		powerbrdh;
	picl_nodehdl_t		powersloth;
	picl_nodehdl_t		powermodh;
	picl_nodehdl_t		tmph;
	int			i, err, slotnum;

	/* Create the node for the PDB (if it exists) */
	if (ptree_get_node_by_path(platform_frupath[PDB], &tmph) ==
	    PICL_SUCCESS) {
		err = ptree_create_node("power-dist-board", "fru", &powerbrdh);
		if (err != PICL_SUCCESS)
			return (err);

		err = add_ref_prop(powerbrdh, tmph, SEEPROM_SOURCE);
		if (err != PICL_SUCCESS)
			return (err);

		err = add_void_fda_prop(powerbrdh);
		if (err != PICL_SUCCESS)
			return (err);

		err = ptree_add_node(rooth, powerbrdh);
		if (err != PICL_SUCCESS)
			return (err);

		err = add_ref_prop(tmph, powerbrdh, FRU_PARENT);
		if (err != PICL_SUCCESS)
			return (err);

		for (i = PS0; i <= PS2; i++) {
			/* Create the node for the power supply slot */
			err = ptree_create_node("power-supply-slot",
			    "location", &powersloth);
			if (err != PICL_SUCCESS)
				return (err);

			slotnum = i - PS0;
			err = add_slot_prop(powersloth, slotnum);
			if (err != PICL_SUCCESS)
				return (err);

			err = add_label_prop(powersloth, location_label[i]);
			if (err != PICL_SUCCESS)
				return (err);

			err = ptree_add_node(powerbrdh, powersloth);
			if (err != PICL_SUCCESS)
				return (err);

			/* If the PS exists, create a node for it */
			if (ptree_get_node_by_path(platform_frupath[i],
			    &tmph) == PICL_SUCCESS) {
				err = ptree_create_node("power-supply",
				    "fru", &powermodh);
				if (err != PICL_SUCCESS)
					return (err);

				err = add_ref_prop(powermodh, tmph,
				    SEEPROM_SOURCE);
				if (err != PICL_SUCCESS)
					return (err);

				err = add_void_fda_prop(powermodh);
				if (err != PICL_SUCCESS)
					return (err);

				err = ptree_add_node(powersloth, powermodh);
				if (err != PICL_SUCCESS)
					return (err);

				err = add_ref_prop(tmph, powermodh, FRU_PARENT);
				if (err != PICL_SUCCESS)
					return (err);
			}
		}
	}
	return (PICL_SUCCESS);
}
Beispiel #11
0
/* Initializes the FRU nodes for the FCAL backplanes and GBIC card */
static int
do_fcal_init(picl_nodehdl_t rooth)
{
	picl_nodehdl_t		fcalsloth;
	picl_nodehdl_t		fcalmodh;
	picl_nodehdl_t		fcalgbich;
	picl_nodehdl_t		tmph;
	int			i, err, slotnum;

	for (i = FCAL0; i <= FCAL1; i++) {
		/* Create the node for the FCAL backplane slot */
		err = ptree_create_node("fcal-backplane-slot",
		    "location", &fcalsloth);
		if (err != PICL_SUCCESS)
			return (err);

		slotnum = i - FCAL0;
		err = add_slot_prop(fcalsloth, slotnum);
		if (err != PICL_SUCCESS)
			return (err);

		err = add_label_prop(fcalsloth, location_label[i]);
		if (err != PICL_SUCCESS)
			return (err);

		err = ptree_add_node(rooth, fcalsloth);
		if (err != PICL_SUCCESS)
			return (err);

		/* If the FCAL backplane exists, create a node for it */
		if (ptree_get_node_by_path(platform_frupath[i], &tmph) ==
		    PICL_SUCCESS) {
			err = ptree_create_node("fcal-backplane", "fru",
			    &fcalmodh);
			if (err != PICL_SUCCESS)
				return (err);

			err = add_ref_prop(fcalmodh, tmph, SEEPROM_SOURCE);
			if (err != PICL_SUCCESS)
				return (err);

			err = add_void_fda_prop(fcalmodh);
			if (err != PICL_SUCCESS)
				return (err);

			err = ptree_add_node(fcalsloth, fcalmodh);
			if (err != PICL_SUCCESS)
				return (err);

			err = add_ref_prop(tmph, fcalmodh, FRU_PARENT);
			if (err != PICL_SUCCESS)
				return (err);
		}
	}

	/* If the FCAL GBIC board exists, create a node for it */
	if (ptree_get_node_by_path(platform_frupath[FCALGBIC], &tmph) ==
	    PICL_SUCCESS) {
		err = ptree_create_node("fcal-gbic-board", "fru",
		    &fcalgbich);
		if (err != PICL_SUCCESS)
			return (err);

		err = add_ref_prop(fcalgbich, tmph, SEEPROM_SOURCE);
		if (err != PICL_SUCCESS)
			return (err);

		err = add_void_fda_prop(fcalgbich);
		if (err != PICL_SUCCESS)
			return (err);

		err = ptree_add_node(rooth, fcalgbich);
		if (err != PICL_SUCCESS)
			return (err);

		err = add_ref_prop(tmph, fcalgbich, FRU_PARENT);
		if (err != PICL_SUCCESS)
			return (err);
	}
	return (PICL_SUCCESS);
}