/* Creates the FRU nodes for the CPU Module and associated DIMMs */ static int do_cpu_module_init(picl_nodehdl_t rooth, int slot) { picl_nodehdl_t cpumodh; int i, c, err; for (i = 0; i <= 1; i++) { err = ptree_create_node("cpu-module", "location", &cpumodh); if (err != PICL_SUCCESS) return (err); err = add_slot_prop(cpumodh, i); if (err != PICL_SUCCESS) return (err); c = CPU0_DIMM0 + DIMMS_PER_SLOT + i; err = add_label_prop(cpumodh, location_label[c]); if (err != PICL_SUCCESS) return (err); err = ptree_add_node(rooth, cpumodh); if (err != PICL_SUCCESS) return (err); /* Create the nodes for the memory (if they exist) */ err = do_dimms_init(cpumodh, slot, i); if (err != PICL_SUCCESS) return (err); } return (PICL_SUCCESS); }
/* 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); }
/* 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); }
/* 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); }
/* 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); }
/* 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); }
/* 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); }