Lines Matching defs:node
440 * This function walks the child nodes of a given node, extracts
441 * the "name" property, if it exists, and passes the node to a
442 * callback init function. The callback determines if this node is
443 * interesting or not. If it is, then a pointer to the node is
452 dev_info_t *node;
460 * Hold parent node busy to walk its child list
463 node = ddi_get_child(parent);
465 while (node != NULL) {
467 ret = OPL_GET_PROP(string, node, "name", &name, &len);
470 * The property does not exist for this node.
472 node = ddi_get_next_sibling(node);
476 ret = init(node, name, len);
484 node = ddi_get_next_sibling(node);
494 * root node and stores pointers to them. The following nodes
507 opl_init_root_nodes(dev_info_t *node, char *name, int len)
514 ret = OPL_GET_PROP(int, node, "portid", &portid, -1);
518 ret = OPL_GET_PROP(int, node, "board#", &board, -1);
523 opl_boards[board].cfg_cpu_chips[chip] = node;
527 ret = OPL_GET_PROP(int, node, "portid", &portid, -1);
536 opl_boards[board].cfg_cmuch_leaf = node;
541 opl_boards[board].cfg_pcich_leaf[channel][leaf] = node;
545 ret = OPL_GET_PROP(int, node, "board#", &board, -1);
551 opl_boards[board].cfg_pseudo_mc = node;
656 * pointer to a newly created node to its caller.
660 opl_set_node(dev_info_t *node, void *arg, uint_t flags)
665 probe->pr_node = node;
669 * Function to create a node in the device tree under a specified parent.
672 * single call of the function. However, we only use it to create one node
679 * newly created node. The other callback is used to return a pointer
680 * to the newly created node. The create() callback is passed by the
681 * caller of this function based on the kind of node he wishes to
684 * e_ddi_branch_create() returns with the newly created node held. We
686 * the hold for the others. E.g., the "cmp" node needs to be held. Since
687 * we hold the "cmp" node, there is no need to hold the "core" and "cpu"
714 * Function to tear down a whole branch rooted at the specified node.
716 * Although we create each node of a branch individually, we destroy
720 opl_destroy_node(dev_info_t *node)
722 if (e_ddi_branch_destroy(node, NULL, 0) != 0) {
724 (void) ddi_pathname(node, path);
725 cmn_err(CE_WARN, "OPL node removal failed: %s (%p)", path,
726 (void *)node);
735 * Set the properties for a "cpu" node.
739 opl_create_cpu(dev_info_t *node, void *arg, uint_t flags)
751 OPL_UPDATE_PROP(string, node, "name", OPL_CPU_NODE);
752 OPL_UPDATE_PROP(string, node, "device_type", OPL_CPU_NODE);
754 OPL_UPDATE_PROP(int, node, "cpuid", cpu->cpu_cpuid);
755 OPL_UPDATE_PROP(int, node, "reg", probe->pr_cpu);
757 OPL_UPDATE_PROP(string, node, "status", "okay");
763 * Create "cpu" nodes as child nodes of a given "core" node.
803 * Set the properties for a "core" node.
807 opl_create_core(dev_info_t *node, void *arg, uint_t flags)
819 OPL_UPDATE_PROP(string, node, "name", OPL_CORE_NODE);
820 OPL_UPDATE_PROP(string, node, "device_type", OPL_CORE_NODE);
821 OPL_UPDATE_PROP(string, node, "compatible", chip->chip_compatible);
823 OPL_UPDATE_PROP(int, node, "reg", probe->pr_core);
824 OPL_UPDATE_PROP(int, node, "manufacturer#", core->core_manufacturer);
825 OPL_UPDATE_PROP(int, node, "implementation#",
827 OPL_UPDATE_PROP(int, node, "mask#", core->core_mask);
829 OPL_UPDATE_PROP(int, node, "sparc-version", 9);
830 OPL_UPDATE_PROP(int, node, "clock-frequency", core->core_frequency);
832 OPL_UPDATE_PROP(int, node, "l1-icache-size", core->core_l1_icache_size);
833 OPL_UPDATE_PROP(int, node, "l1-icache-line-size",
835 OPL_UPDATE_PROP(int, node, "l1-icache-associativity",
837 OPL_UPDATE_PROP(int, node, "#itlb-entries",
840 OPL_UPDATE_PROP(int, node, "l1-dcache-size", core->core_l1_dcache_size);
841 OPL_UPDATE_PROP(int, node, "l1-dcache-line-size",
843 OPL_UPDATE_PROP(int, node, "l1-dcache-associativity",
845 OPL_UPDATE_PROP(int, node, "#dtlb-entries",
848 OPL_UPDATE_PROP(int, node, "l2-cache-size", core->core_l2_cache_size);
849 OPL_UPDATE_PROP(int, node, "l2-cache-line-size",
851 OPL_UPDATE_PROP(int, node, "l2-cache-associativity",
855 OPL_UPDATE_PROP_ARRAY(int, node, "l2-cache-sharing", sharing, 2);
857 OPL_UPDATE_PROP(string, node, "status", "okay");
863 * Create "core" nodes as child nodes of a given "cmp" node.
865 * Create the branch below each "core" node".
873 dev_info_t *parent, *node;
887 node = opl_create_node(probe);
888 if (node == NULL) {
899 probe->pr_parent = node;
909 * Set the properties for a "cmp" node.
913 opl_create_cpu_chip(dev_info_t *node, void *arg, uint_t flags)
924 OPL_UPDATE_PROP(string, node, "name", OPL_CPU_CHIP_NODE);
926 OPL_UPDATE_PROP(int, node, "portid", chip->chip_portid);
927 OPL_UPDATE_PROP(int, node, "board#", probe->pr_board);
934 OPL_UPDATE_PROP_ARRAY(int, node, "reg", (int *)&range, 4);
936 OPL_UPDATE_PROP(int, node, "#address-cells", 1);
937 OPL_UPDATE_PROP(int, node, "#size-cells", 0);
939 OPL_UPDATE_PROP(string, node, "status", "okay");
945 * Create "cmp" nodes as child nodes of the root node.
947 * Create the branch below each "cmp" node.
955 dev_info_t *node;
971 node = opl_create_node(probe);
972 if (node == NULL) {
979 cfg_cpu_chips[i] = node;
983 * We hold the "cmp" node. So, there is no need to hold
986 probe->pr_parent = node;
996 * Set the properties for a "pseudo-mc" node.
1000 opl_create_pseudo_mc(dev_info_t *node, void *arg, uint_t flags)
1015 OPL_UPDATE_PROP(string, node, "name", OPL_PSEUDO_MC_NODE);
1016 OPL_UPDATE_PROP(string, node, "device_type", "memory-controller");
1017 OPL_UPDATE_PROP(string, node, "compatible", "FJSV,oplmc");
1020 OPL_UPDATE_PROP(int, node, "portid", portid);
1026 OPL_UPDATE_PROP_ARRAY(int, node, "reg", (int *)&range, 4);
1028 OPL_UPDATE_PROP(int, node, "board#", board);
1029 OPL_UPDATE_PROP(int, node, "physical-board#",
1032 OPL_UPDATE_PROP(int, node, "#address-cells", 1);
1033 OPL_UPDATE_PROP(int, node, "#size-cells", 2);
1041 OPL_UPDATE_PROP_ARRAY(int, node, "sb-mem-ranges", (int *)&range, 4);
1056 OPL_UPDATE_PROP_ARRAY(int, node, "mc-addr", (int *)mc, j*3);
1063 ret = ndi_prop_create_boolean(DDI_DEV_T_NONE, node, "mc-addr");
1067 OPL_UPDATE_PROP_ARRAY(byte, node, "cs0-mc-pa-trans-table",
1069 OPL_UPDATE_PROP_ARRAY(byte, node, "cs1-mc-pa-trans-table",
1094 OPL_UPDATE_PROP_ARRAY(int, node, "cs-status", (int *)status,
1102 ret = ndi_prop_create_boolean(DDI_DEV_T_NONE, node,
1118 dev_info_t *node;
1128 node = opl_create_node(probe);
1129 if (node == NULL) {
1135 board_cfg->cfg_pseudo_mc = node;
2334 * Set the properties for a leaf node (Oberon leaf or CMU channel leaf).
2338 opl_create_leaf(dev_info_t *node, void *arg, uint_t flags)
2342 OPL_UPDATE_PROP(string, node, "name", OPL_PCI_LEAF_NODE);
2344 OPL_UPDATE_PROP(string, node, "status", "okay");
2408 * device tree. The callback is invoked with the devinfo node
2431 * bound state. Bring devinfo node down to linked
2516 dev_info_t *parent, *node;
2525 * Hold parent node busy to walk its child list
2529 for (node = ddi_get_child(parent); (node != NULL); node =
2530 ddi_get_next_sibling(node)) {
2532 ret = OPL_GET_PROP(string, node, "name", &name, &len);
2535 * The property does not exist for this node.
2542 ret = OPL_GET_PROP(int, node, "portid", &portid, -1);
2545 ret = OPL_GET_PROP(int, node, "board#",
2558 cfg->cfg_cmuch_leaf = node;
2566 channel][leaf] = node;
2580 * Create "pci" node and hierarchy for the Oberon channels and the
2699 dev_info_t **node;
2709 node = &board_cfg->cfg_pcich_leaf[i][j];
2713 if (*node == NULL)
2726 ret = opl_destroy_node(*node);
2734 *node = NULL;
2739 node = &board_cfg->cfg_cmuch_leaf;
2743 if (*node == NULL)
2756 if (opl_destroy_node(*node) != 0) {
2763 *node = NULL;
2769 * Destroy the "pseudo-mc" node for a board.