Lines Matching +full:clock +full:- +full:frequency
31 #include <sys/clock.h>
132 #define WATCHDOG_ENABLE "watchdog-enable"
147 * If this variable is non-zero, cpr should return "not supported" when
154 * energystar-v* property (Enchilada server, for example). If this
155 * variable is non-zero, cpr should proceed even in the absence
156 * of the energystar-v* property.
205 GETPROP(prom_chosennode(), CHOSEN_EEPROM, (caddr_t)&ieeprom) != -1) in map_wellknown_devices()
210 * Get System clock frequency from root node if it exists. in map_wellknown_devices()
212 if (GETPROP(root, "stick-frequency", (caddr_t)&stick_freq) != -1) in map_wellknown_devices()
220 for (wkp = wkdevice; wkp->wk_namep; ++wkp) { in map_wellknown_devices()
221 if (wkp->wk_flags == V_MUSTHAVE) { in map_wellknown_devices()
223 "device %s not mapped", wkp->wk_namep); in map_wellknown_devices()
238 * map_wellknown - map known devices & registers
266 * property with a value of "memory-controller" in map_wellknown()
269 OBP_DEVICETYPE)) == -1) in map_wellknown()
277 devtype_buf) == -1) { in map_wellknown()
282 if (strcmp(devtype_buf, "memory-controller") != 0) in map_wellknown()
289 if (GETPROP(curnode, OBP_NAME, (caddr_t)tmp_name) != -1) in map_wellknown()
291 if (GETPROP(curnode, OBP_DEVICETYPE, tmp_name) != -1 && in map_wellknown()
297 if (sok && (strcmp(tmp_name, "memory-controller") == 0) && in map_wellknown()
311 for (wkp = wkdevice; wkp->wk_namep; ++wkp) { in fill_address()
312 if (strcmp(wkp->wk_namep, namep) != 0) in fill_address()
314 if (wkp->wk_flags == V_MAPPED) in fill_address()
316 if (wkp->wk_vaddrp != NULL) { in fill_address()
317 if ((size = GETPROPLEN(curnode, OBP_ADDRESS)) == -1) { in fill_address()
328 (caddr_t)&vaddr) == -1) { in fill_address()
335 *wkp->wk_vaddrp = (caddr_t)(uintptr_t)vaddr; in fill_address()
338 (void *)*wkp->wk_vaddrp); in fill_address()
341 if (wkp->wk_func != NULL) in fill_address()
342 (*wkp->wk_func)(curnode); in fill_address()
348 if (wkp->wk_flags != V_MULTI) in fill_address()
349 wkp->wk_flags = V_MAPPED; in fill_address()
364 if (GETPROP(node, "portid", (caddr_t)&portid) != -1) in get_portid()
366 if (GETPROP(node, "upa-portid", (caddr_t)&portid) != -1) in get_portid()
368 if (GETPROP(node, "device_type", (caddr_t)&dev_type) == -1) in get_portid()
369 return (-1); in get_portid()
383 if (GETPROP(node, "portid", (caddr_t)&portid) != -1) { in get_portid()
392 return (-1); in get_portid()
404 * is for the off chance that a non-cheetah+ system may have heterogenous
408 * across all cpus otherwise set it to -1 if heterogenous.
410 * Set cpu_page_colors to -1 to signify heterogeneity of ecache setsizes
420 case -1: in adj_ecache_setsize()
426 /* set to -1 if hetergenous cpus */ in adj_ecache_setsize()
429 cpu_page_colors = -1; in adj_ecache_setsize()
434 cpu_setsize = -1; in adj_ecache_setsize()
455 if ((portid = get_portid(node, &cmpnode)) == -1) { in fill_cpu()
459 if (GETPROP(node, "cpuid", (caddr_t)&cpuid) == -1) { in fill_cpu()
470 cpunode->portid = portid; in fill_cpu()
471 cpunode->nodeid = node; in fill_cpu()
474 cpunode->fru_fmri[0] = '\0'; in fill_cpu()
476 (void) snprintf(cpunode->fru_fmri, sizeof (cpunode->fru_fmri), in fill_cpu()
499 proplen = OBP_MAXPROPNAME - 1; in fill_cpu()
508 (void) strcpy(cpunode->name, namebufp); in fill_cpu()
511 (caddr_t)&cpunode->implementation); in fill_cpu()
512 (void) GETPROP(node, "mask#", (caddr_t)&cpunode->version); in fill_cpu()
514 if (IS_CHEETAH(cpunode->implementation)) { in fill_cpu()
516 cpunode->version = REMAP_CHEETAH_MASK(cpunode->version); in fill_cpu()
518 if (GETPROP(node, "clock-frequency", (caddr_t)&clk_freq) == -1) { in fill_cpu()
523 if (GETPROP(root, "clock-frequency", (caddr_t)&clk_freq) == -1) in fill_cpu()
526 cpunode->clock_freq = clk_freq; in fill_cpu()
528 ASSERT(cpunode->clock_freq != 0); in fill_cpu()
532 * comment in sun4u/sys/clock.h for details. in fill_cpu()
534 cpunode->tick_nsec_scale = (uint_t)(((uint64_t)NANOSEC << in fill_cpu()
535 (32 - TICK_NSEC_SHIFT)) / cpunode->clock_freq); in fill_cpu()
537 (void) GETPROP(node, "#itlb-entries", (caddr_t)&tlbsize); in fill_cpu()
539 cpunode->itlb_size = (ushort_t)tlbsize; in fill_cpu()
541 (void) GETPROP(node, "#dtlb-entries", (caddr_t)&tlbsize); in fill_cpu()
543 cpunode->dtlb_size = (ushort_t)tlbsize; in fill_cpu()
552 (void) GETPROP(node, "l3-cache-size", (caddr_t)&size); in fill_cpu()
554 (void) GETPROP(node, "l2-cache-size", (caddr_t)&size); in fill_cpu()
556 cpunode->ecache_size = size; in fill_cpu()
559 (void) GETPROP(node, "l3-cache-line-size", (caddr_t)&size); in fill_cpu()
561 (void) GETPROP(node, "l2-cache-line-size", in fill_cpu()
564 cpunode->ecache_linesize = size; in fill_cpu()
567 (void) GETPROP(node, "l2-cache-associativity", (caddr_t)&size); in fill_cpu()
569 cpunode->ecache_associativity = size; in fill_cpu()
574 (void) GETPROP(node, "ecache-size", (caddr_t)&size); in fill_cpu()
576 cpunode->ecache_size = size; in fill_cpu()
579 (void) GETPROP(node, "ecache-line-size", (caddr_t)&size); in fill_cpu()
581 cpunode->ecache_linesize = size; in fill_cpu()
584 (void) GETPROP(node, "ecache-associativity", (caddr_t)&size); in fill_cpu()
586 cpunode->ecache_associativity = size; in fill_cpu()
589 /* by default set msram to non-mirrored one */ in fill_cpu()
590 cpunode->msram = ECACHE_CPU_NON_MIRROR; in fill_cpu()
592 if (GETPROPLEN(node, "msram") != -1) { in fill_cpu()
593 cpunode->msram = ECACHE_CPU_MIRROR; in fill_cpu()
596 if (GETPROPLEN(node, "msram-observed") != -1) { in fill_cpu()
597 cpunode->msram = ECACHE_CPU_MIRROR; in fill_cpu()
604 cpunode->ecache_setsize = in fill_cpu()
605 cpunode->ecache_size / cpunode->ecache_associativity; in fill_cpu()
607 adj_ecache_setsize(cpunode->ecache_setsize); in fill_cpu()
625 DDI_PROP_DONTPASS, "portid", -1)) != -1) in get_portid_ddi()
628 DDI_PROP_DONTPASS, "upa-portid", -1)) != -1) in get_portid_ddi()
633 return (-1); in get_portid_ddi()
646 DDI_PROP_DONTPASS, "portid", -1)) != -1) { in get_portid_ddi()
655 return (-1); in get_portid_ddi()
678 if ((portid = get_portid_ddi(dip, &cmpnode)) == -1) { in fill_cpu_ddi()
683 DDI_PROP_DONTPASS, "cpuid", -1)) == -1) { in fill_cpu_ddi()
694 cpunode->portid = portid; in fill_cpu_ddi()
695 cpunode->nodeid = ddi_get_nodeid(dip); in fill_cpu_ddi()
711 cpunode->fru_fmri[0] = '\0'; in fill_cpu_ddi()
713 (void) snprintf(cpunode->fru_fmri, sizeof (cpunode->fru_fmri), in fill_cpu_ddi()
727 (void) strcpy(cpunode->name, namebufp); in fill_cpu_ddi()
729 cpunode->implementation = ddi_prop_get_int(DDI_DEV_T_ANY, dip, in fill_cpu_ddi()
732 cpunode->version = ddi_prop_get_int(DDI_DEV_T_ANY, dip, in fill_cpu_ddi()
735 if (IS_CHEETAH(cpunode->implementation)) { in fill_cpu_ddi()
737 cpunode->version = REMAP_CHEETAH_MASK(cpunode->version); in fill_cpu_ddi()
740 cpunode->clock_freq = (uint32_t)ddi_prop_get_int(DDI_DEV_T_ANY, dip, in fill_cpu_ddi()
741 DDI_PROP_DONTPASS, "clock-frequency", 0); in fill_cpu_ddi()
743 ASSERT(cpunode->clock_freq != 0); in fill_cpu_ddi()
747 * comment in sun4u/sys/clock.h for details. in fill_cpu_ddi()
749 cpunode->tick_nsec_scale = (uint_t)(((uint64_t)NANOSEC << in fill_cpu_ddi()
750 (32 - TICK_NSEC_SHIFT)) / cpunode->clock_freq); in fill_cpu_ddi()
753 DDI_PROP_DONTPASS, "#itlb-entries", 0); in fill_cpu_ddi()
755 cpunode->itlb_size = (ushort_t)tlbsize; in fill_cpu_ddi()
758 DDI_PROP_DONTPASS, "#dtlb-entries", 0); in fill_cpu_ddi()
760 cpunode->dtlb_size = (ushort_t)tlbsize; in fill_cpu_ddi()
768 cpunode->ecache_size = ddi_prop_get_int(DDI_DEV_T_ANY, in fill_cpu_ddi()
769 dip, DDI_PROP_DONTPASS, "l3-cache-size", 0); in fill_cpu_ddi()
770 if (cpunode->ecache_size == 0) in fill_cpu_ddi()
771 cpunode->ecache_size = ddi_prop_get_int(DDI_DEV_T_ANY, in fill_cpu_ddi()
772 dip, DDI_PROP_DONTPASS, "l2-cache-size", 0); in fill_cpu_ddi()
773 ASSERT(cpunode->ecache_size != 0); in fill_cpu_ddi()
775 cpunode->ecache_linesize = ddi_prop_get_int(DDI_DEV_T_ANY, in fill_cpu_ddi()
776 dip, DDI_PROP_DONTPASS, "l3-cache-line-size", 0); in fill_cpu_ddi()
777 if (cpunode->ecache_linesize == 0) in fill_cpu_ddi()
778 cpunode->ecache_linesize = in fill_cpu_ddi()
780 DDI_PROP_DONTPASS, "l2-cache-line-size", 0); in fill_cpu_ddi()
781 ASSERT(cpunode->ecache_linesize != 0); in fill_cpu_ddi()
783 cpunode->ecache_associativity = ddi_prop_get_int(DDI_DEV_T_ANY, in fill_cpu_ddi()
784 dip, DDI_PROP_DONTPASS, "l2-cache-associativity", 0); in fill_cpu_ddi()
785 ASSERT(cpunode->ecache_associativity != 0); in fill_cpu_ddi()
789 cpunode->ecache_size = ddi_prop_get_int(DDI_DEV_T_ANY, in fill_cpu_ddi()
790 dip, DDI_PROP_DONTPASS, "ecache-size", 0); in fill_cpu_ddi()
791 ASSERT(cpunode->ecache_size != 0); in fill_cpu_ddi()
793 cpunode->ecache_linesize = ddi_prop_get_int(DDI_DEV_T_ANY, in fill_cpu_ddi()
794 dip, DDI_PROP_DONTPASS, "ecache-line-size", 0); in fill_cpu_ddi()
795 ASSERT(cpunode->ecache_linesize != 0); in fill_cpu_ddi()
797 cpunode->ecache_associativity = ddi_prop_get_int(DDI_DEV_T_ANY, in fill_cpu_ddi()
798 dip, DDI_PROP_DONTPASS, "ecache-associativity", 0); in fill_cpu_ddi()
799 ASSERT(cpunode->ecache_associativity != 0); in fill_cpu_ddi()
802 /* by default set msram to non-mirrored one */ in fill_cpu_ddi()
803 cpunode->msram = ECACHE_CPU_NON_MIRROR; in fill_cpu_ddi()
806 cpunode->msram = ECACHE_CPU_MIRROR; in fill_cpu_ddi()
808 "msram-observed")) { in fill_cpu_ddi()
809 cpunode->msram = ECACHE_CPU_MIRROR; in fill_cpu_ddi()
814 cpunode->ecache_setsize = in fill_cpu_ddi()
815 cpunode->ecache_size / cpunode->ecache_associativity; in fill_cpu_ddi()
817 adj_ecache_setsize(cpunode->ecache_setsize); in fill_cpu_ddi()
826 ncpunode--; in empty_cpu()
829 #ifdef SF_ERRATA_30 /* call causes fp-disabled */
890 #ifdef SF_ERRATA_30 /* call causes fp-disabled */ in check_cpus_ver()
904 cmn_err(CE_PANIC, "UltraSPARC-III versions " in check_cpus_ver()
996 * Change from mmu_page_sizes from 4 to 6 for totally-Panther domains, in check_cpus_set()
998 * other globals) to the correct value for totally-Panther domains. in check_cpus_set()
1008 * For all-Jupiter domains the cpu module will update the hwcap features in check_cpus_set()
1009 * for integer multiply-add instruction support. in check_cpus_set()
1051 * The first sysio must always programmed up for the system clock and error
1060 size = GETPROPLEN(node, "upa-portid"); in have_sbus()
1061 if (size == -1 || size > sizeof (portid)) in have_sbus()
1062 cmn_err(CE_PANIC, "upa-portid size"); in have_sbus()
1063 if (GETPROP(node, "upa-portid", (caddr_t)&portid) == -1) in have_sbus()
1064 cmn_err(CE_PANIC, "upa-portid"); in have_sbus()
1078 * The first psycho must always programmed up for the system clock and error
1089 if (size == -1) size = GETPROPLEN(node, "upa-portid"); in have_pci()
1090 if (size == -1) in have_pci()
1095 if (GETPROP(node, "portid", (caddr_t)&portid) == -1) in have_pci()
1096 if (GETPROP(node, "upa-portid", (caddr_t)&portid) == -1) in have_pci()
1115 * The first eeprom is used as the TOD clock, referenced
1131 if ((GETPROP(node, "model", buf) != -1) && in have_eeprom()
1146 if ((size = GETPROPLEN(node, OBP_ADDRESS)) == -1) in have_eeprom()
1150 if (GETPROP(node, OBP_ADDRESS, (caddr_t)&eaddr) == -1) in have_eeprom()
1164 * If we don't find an I/O board to use to check the clock, in have_eeprom()
1173 if (GETPROPLEN(node, WATCHDOG_ENABLE) != -1) in have_eeprom()
1190 if (GETPROP(node, "model", buf) != -1) { in have_rtc()
1200 * XXX - drives on if address prop doesn't exist, later falls in have_rtc()
1203 if ((size = GETPROPLEN(node, OBP_ADDRESS)) == -1) in have_rtc()
1207 if (GETPROP(node, OBP_ADDRESS, (caddr_t)&eaddr) == -1) in have_rtc()
1216 if (GETPROPLEN(node, WATCHDOG_ENABLE) != -1) in have_rtc()
1230 if (GETPROPLEN(root, WATCHDOG_ENABLE) != -1) { in have_pmc()
1237 if (GETPROP(node, OBP_ADDRESS, (caddr_t)&vaddr) == -1) { in have_pmc()
1263 if ((size = GETPROPLEN(node, OBP_ADDRESS)) == -1) in have_auxio()
1275 if (GETPROP(node, OBP_ADDRESS, (caddr_t)addr) == -1) in have_auxio()
1286 if (GETPROP(node, OBP_NAME, (caddr_t)tod_name) == -1) in have_tod()