Lines Matching +full:em +full:- +full:uart

85  * 1-15, and have been modeled after the sun4d interrupts. The mondo
102 * or by boot -h so that the calibration tables are not used. This
115 * value possible from the 8-bit A/C convertors on each type of system
122 -16, -14, -12, -10, -8, -6, -4, -2, /* 0-7 */
123 1, 4, 6, 8, 10, 12, 13, 15, /* 8-15 */
124 16, 18, 19, 20, 22, 23, 24, 25, /* 16-23 */
125 26, 27, 28, 29, 30, 31, 32, 33, /* 24-31 */
126 34, 35, 35, 36, 37, 38, 39, 39, /* 32-39 */
127 40, 41, 41, 42, 43, 44, 44, 45, /* 40-47 */
128 46, 46, 47, 47, 48, 49, 49, 50, /* 48-55 */
129 51, 51, 52, 53, 53, 54, 54, 55, /* 56-63 */
130 55, 56, 56, 57, 57, 58, 58, 59, /* 64-71 */
131 60, 60, 61, 61, 62, 62, 63, 63, /* 72-79 */
132 64, 64, 65, 65, 66, 66, 67, 67, /* 80-87 */
133 68, 68, 69, 69, 70, 70, 71, 71, /* 88-95 */
134 72, 72, 73, 73, 74, 74, 75, 75, /* 96-103 */
135 76, 76, 77, 77, 78, 78, 79, 79, /* 104-111 */
136 80, 80, 81, 81, 82, 82, 83, 83, /* 112-119 */
137 84, 84, 85, 85, 86, 86, 87, 87, /* 120-127 */
138 88, 88, 89, 89, 90, 90, 91, 91, /* 128-135 */
139 92, 92, 93, 93, 94, 94, 95, 95, /* 136-143 */
140 96, 96, 97, 98, 98, 99, 99, 100, /* 144-151 */
141 100, 101, 101, 102, 103, 103, 104, 104, /* 152-159 */
142 105, 106, 106, 107, 107, 108, 109, 109, /* 160-167 */
149 -17, -16, -15, -14, -13, -12, -11, -10, /* 0-7 */
150 -9, -8, -7, -6, -5, -4, -3, -2, /* 8-15 */
151 -1, 0, 1, 2, 3, 4, 5, 6, /* 16-23 */
152 7, 8, 9, 10, 11, 12, 13, 13, /* 24-31 */
153 14, 15, 16, 16, 17, 18, 18, 19, /* 32-39 */
154 20, 20, 21, 22, 22, 23, 24, 24, /* 40-47 */
155 25, 25, 26, 26, 27, 27, 28, 28, /* 48-55 */
156 29, 30, 30, 31, 31, 32, 32, 33, /* 56-63 */
157 33, 34, 34, 35, 35, 36, 36, 37, /* 64-71 */
158 37, 37, 38, 38, 39, 39, 40, 40, /* 72-79 */
159 41, 41, 42, 42, 43, 43, 43, 44, /* 80-87 */
160 44, 45, 45, 46, 46, 46, 47, 47, /* 88-95 */
161 48, 48, 49, 49, 50, 50, 50, 51, /* 96-103 */
162 51, 52, 52, 53, 53, 53, 54, 54, /* 104-111 */
163 55, 55, 56, 56, 56, 57, 57, 58, /* 112-119 */
164 58, 59, 59, 59, 60, 60, 61, 61, /* 120-127 */
165 62, 62, 63, 63, 63, 64, 64, 65, /* 128-135 */
166 65, 66, 66, 67, 67, 68, 68, 68, /* 136-143 */
167 69, 69, 70, 70, 71, 71, 72, 72, /* 144-151 */
168 73, 73, 74, 74, 75, 75, 76, 76, /* 152-159 */
169 77, 77, 78, 78, 79, 79, 80, 80, /* 160-167 */
170 81, 81, 82, 83, 83, 84, 84, 85, /* 168-175 */
171 85, 86, 87, 87, 88, 88, 89, 90, /* 176-183 */
172 90, 91, 92, 92, 93, 94, 94, 95, /* 184-191 */
173 96, 96, 97, 98, 99, 99, 100, 101, /* 192-199 */
174 102, 103, 103, 104, 105, 106, 107, 108, /* 200-207 */
175 109, 110, /* 208-209 */
181 0, 0, 0, 0, 0, 0, 0, 0, /* 0-7 */
182 0, 0, 0, 0, 0, 0, 0, 0, /* 8-15 */
183 0, 0, 0, 0, 0, 0, 0, 0, /* 16-23 */
184 0, 0, 0, 0, 0, 0, 0, 0, /* 24-31 */
185 0, 0, 0, 0, 0, 0, 0, 0, /* 32-39 */
186 0, 3, 7, 10, 13, 15, 17, 19, /* 40-47 */
187 21, 23, 25, 27, 28, 30, 31, 32, /* 48-55 */
188 34, 35, 36, 37, 38, 39, 41, 42, /* 56-63 */
189 43, 44, 45, 46, 46, 47, 48, 49, /* 64-71 */
190 50, 51, 52, 53, 53, 54, 55, 56, /* 72-79 */
191 57, 57, 58, 59, 60, 60, 61, 62, /* 80-87 */
192 62, 63, 64, 64, 65, 66, 66, 67, /* 88-95 */
193 68, 68, 69, 70, 70, 71, 72, 72, /* 96-103 */
194 73, 73, 74, 75, 75, 76, 77, 77, /* 104-111 */
195 78, 78, 79, 80, 80, 81, 81, 82, /* 112-119 */
202 0, 0, 0, 0, 0, 0, 0, 0, /* 0-7 */
203 0, 0, 0, 0, 1, 2, 4, 5, /* 8-15 */
204 7, 8, 10, 11, 12, 13, 14, 15, /* 16-23 */
205 17, 18, 19, 20, 21, 22, 23, 24, /* 24-31 */
206 24, 25, 26, 27, 28, 29, 29, 30, /* 32-39 */
207 31, 32, 32, 33, 34, 35, 35, 36, /* 40-47 */
208 37, 38, 38, 39, 40, 40, 41, 42, /* 48-55 */
209 42, 43, 44, 44, 45, 46, 46, 47, /* 56-63 */
210 48, 48, 49, 50, 50, 51, 52, 52, /* 64-71 */
211 53, 54, 54, 55, 56, 57, 57, 58, /* 72-79 */
212 59, 59, 60, 60, 61, 62, 63, 63, /* 80-87 */
213 64, 65, 65, 66, 67, 68, 68, 69, /* 88-95 */
214 70, 70, 71, 72, 73, 74, 74, 75, /* 96-103 */
215 76, 77, 78, 78, 79, 80, 81, 82, /* 104-111 */
236 * These values can be tuned via /etc/system or boot -h.
253 * early on in boot, after we check the OBP 'mfg-mode' property in
256 static int temperature_chamber = -1;
352 int fhc_cpu_poweroff(struct cpu *); /* cpu_poweroff()->platform */
353 int fhc_cpu_poweron(struct cpu *); /* cpu_poweron()->platform */
431 * TODO - We need to investigate what locking needs to be done here.
513 * (the UART and SYS interrupts) so that the values of the other IGNs
516 * for UART and SYS. It is also why we don't try to change the
527 if (softsp->is_central) { in fhc_handle_imr()
530 want_igr = softsp->list->sc.board << 1; in fhc_handle_imr()
531 act_igr = *softsp->igr & 0x1f; in fhc_handle_imr()
533 *softsp->igr = want_igr; in fhc_handle_imr()
534 tmp_reg = *softsp->igr; in fhc_handle_imr()
538 /* We must now re-issue any pending interrupts. */ in fhc_handle_imr()
540 if (*(softsp->intr_regs[i].clear_reg) == 3) { in fhc_handle_imr()
541 *(softsp->intr_regs[i].clear_reg) = in fhc_handle_imr()
545 *(softsp->intr_regs[i].clear_reg); in fhc_handle_imr()
557 ASSERT(softsp->list->sc.board == FHC_BSR_TO_BD(*(softsp->bsr))); in fhc_handle_imr()
558 cent = check_central(softsp->list->sc.board); in fhc_handle_imr()
564 *(softsp->intr_regs[i].clear_reg) == 3) { in fhc_handle_imr()
568 *(softsp->intr_regs[i].clear_reg) = ISM_IDLE; in fhc_handle_imr()
573 tmp_reg = *(softsp->intr_regs[i].clear_reg); in fhc_handle_imr()
587 *(softsp->intr_regs[i].mapping_reg) = 0; in fhc_handle_imr()
592 tmp_reg = *(softsp->intr_regs[i].mapping_reg); in fhc_handle_imr()
648 softsp->dip = devi; in fhc_attach()
676 board = softsp->list->sc.board; in fhc_detach()
702 list->softsp = NULL; in fhc_detach()
705 clear_fault(list->sc.board, FT_PROM, FT_BOARD); in fhc_detach()
708 kstat_delete(softsp->fhc_ksp); in fhc_detach()
711 mutex_destroy(&softsp->poll_list_lock); in fhc_detach()
712 mutex_destroy(&softsp->ctrl_lock); in fhc_detach()
733 if (softsp->is_central) in fhc_board_type()
735 else if (ddi_getlongprop(DDI_DEV_T_ANY, softsp->dip, in fhc_board_type()
736 DDI_PROP_DONTPASS, "board-type", (caddr_t)&board_type, in fhc_board_type()
738 /* match the board-type string */ in fhc_board_type()
772 else if ((*(softsp->bsr) & FHC_UPADATA64A) || in fhc_board_type()
773 (*(softsp->bsr) & FHC_UPADATA64B)) in fhc_board_type()
785 dev_info_t *dip = softsp->dip; in fhc_unmap_regs()
787 if (softsp->id) { in fhc_unmap_regs()
788 ddi_unmap_regs(dip, 0, (caddr_t *)&softsp->id, 0, 0); in fhc_unmap_regs()
789 softsp->id = NULL; in fhc_unmap_regs()
791 if (softsp->igr) { in fhc_unmap_regs()
792 ddi_unmap_regs(dip, 1, (caddr_t *)&softsp->igr, 0, 0); in fhc_unmap_regs()
793 softsp->igr = NULL; in fhc_unmap_regs()
795 if (softsp->intr_regs[FHC_FANFAIL_INO].mapping_reg) { in fhc_unmap_regs()
797 (caddr_t *)&softsp->intr_regs[FHC_FANFAIL_INO].mapping_reg, in fhc_unmap_regs()
799 softsp->intr_regs[FHC_FANFAIL_INO].mapping_reg = NULL; in fhc_unmap_regs()
801 if (softsp->intr_regs[FHC_SYS_INO].mapping_reg) { in fhc_unmap_regs()
803 (caddr_t *)&softsp->intr_regs[FHC_SYS_INO].mapping_reg, in fhc_unmap_regs()
805 softsp->intr_regs[FHC_SYS_INO].mapping_reg = NULL; in fhc_unmap_regs()
807 if (softsp->intr_regs[FHC_UART_INO].mapping_reg) { in fhc_unmap_regs()
809 (caddr_t *)&softsp->intr_regs[FHC_UART_INO].mapping_reg, in fhc_unmap_regs()
811 softsp->intr_regs[FHC_UART_INO].mapping_reg = NULL; in fhc_unmap_regs()
813 if (softsp->intr_regs[FHC_TOD_INO].mapping_reg) { in fhc_unmap_regs()
815 (caddr_t *)&softsp->intr_regs[FHC_TOD_INO].mapping_reg, in fhc_unmap_regs()
817 softsp->intr_regs[FHC_TOD_INO].mapping_reg = NULL; in fhc_unmap_regs()
834 if (ddi_map_regs(softsp->dip, 0, in fhc_init()
835 (caddr_t *)&softsp->id, 0, 0)) { in fhc_init()
837 "registers", ddi_get_instance(softsp->dip)); in fhc_init()
845 softsp->rctrl = (uint_t *)((char *)(softsp->id) + in fhc_init()
847 softsp->ctrl = (uint_t *)((char *)(softsp->id) + in fhc_init()
849 softsp->bsr = (uint_t *)((char *)(softsp->id) + in fhc_init()
851 softsp->jtag_ctrl = (uint_t *)((char *)(softsp->id) + in fhc_init()
853 softsp->jt_master.jtag_cmd = (uint_t *)((char *)(softsp->id) + in fhc_init()
857 if (ddi_map_regs(softsp->dip, 1, in fhc_init()
858 (caddr_t *)&softsp->igr, 0, 0)) { in fhc_init()
860 "register", ddi_get_instance(softsp->dip)); in fhc_init()
869 if (ddi_map_regs(softsp->dip, 2, in fhc_init()
870 (caddr_t *)&softsp->intr_regs[FHC_FANFAIL_INO].mapping_reg, in fhc_init()
873 "IMR register", ddi_get_instance(softsp->dip)); in fhc_init()
878 if (ddi_map_regs(softsp->dip, 3, in fhc_init()
879 (caddr_t *)&softsp->intr_regs[FHC_SYS_INO].mapping_reg, in fhc_init()
882 "IMR register\n", ddi_get_instance(softsp->dip)); in fhc_init()
887 if (ddi_map_regs(softsp->dip, 4, in fhc_init()
888 (caddr_t *)&softsp->intr_regs[FHC_UART_INO].mapping_reg, in fhc_init()
890 cmn_err(CE_WARN, "fhc%d: unable to map UART " in fhc_init()
891 "IMR register\n", ddi_get_instance(softsp->dip)); in fhc_init()
896 if (ddi_map_regs(softsp->dip, 5, in fhc_init()
897 (caddr_t *)&softsp->intr_regs[FHC_TOD_INO].mapping_reg, in fhc_init()
900 "IMR register", ddi_get_instance(softsp->dip)); in fhc_init()
905 /* TODO - Make sure we are calculating the ISMR correctly. */ in fhc_init()
907 softsp->intr_regs[i].clear_reg = in fhc_init()
908 (uint_t *)((char *)(softsp->intr_regs[i].mapping_reg) + in fhc_init()
912 *(softsp->intr_regs[i].clear_reg) = ISM_IDLE; in fhc_init()
926 if ((board = (int)ddi_getprop(DDI_DEV_T_ANY, softsp->dip, in fhc_init()
927 DDI_PROP_DONTPASS, OBP_BOARDNUM, -1)) == -1) { in fhc_init()
932 board = FHC_BSR_TO_BD(*(softsp->bsr)); in fhc_init()
933 softsp->is_central = 1; in fhc_init()
941 if ((*(softsp->jtag_ctrl) & JTAG_MASTER_EN) && !softsp->is_central) { in fhc_init()
942 mutex_init(&(softsp->jt_master.lock), NULL, MUTEX_DEFAULT, in fhc_init()
944 softsp->jt_master.is_master = 1; in fhc_init()
946 softsp->jt_master.is_master = 0; in fhc_init()
952 mutex_init(&softsp->poll_list_lock, NULL, MUTEX_DRIVER, NULL); in fhc_init()
955 mutex_init(&softsp->ctrl_lock, NULL, MUTEX_DRIVER, NULL); in fhc_init()
959 softsp->poll_list[i].funcp = NULL; in fhc_init()
968 if (!(softsp->is_central)) { in fhc_init()
969 mutex_enter(&softsp->ctrl_lock); in fhc_init()
970 *(softsp->ctrl) |= FHC_NOT_BRD_PRES; in fhc_init()
972 tmp_reg = *(softsp->ctrl); in fhc_init()
977 mutex_exit(&softsp->ctrl_lock); in fhc_init()
979 /* Add kstats for all non-central instances of the FHC. */ in fhc_init()
987 if (temperature_chamber == -1) { in fhc_init()
992 if (*softsp->ctrl & FHC_LED_MID) { in fhc_init()
993 reg_fault(softsp->list->sc.board, FT_PROM, FT_BOARD); in fhc_init()
1000 *(softsp->igr) = (softsp->list->sc.board) << 1; in fhc_init()
1003 tmp_reg = *(softsp->id); in fhc_init()
1009 intr_dist_add(fhc_intrdist, (void *)softsp->dip); in fhc_init()
1023 uint_t (*funcp)(caddr_t, caddr_t) = intr_info->funcp; in fhc_intr_wrapper()
1024 caddr_t iarg1 = intr_info->arg1; in fhc_intr_wrapper()
1025 caddr_t iarg2 = intr_info->arg2; in fhc_intr_wrapper()
1026 dev_info_t *dip = intr_info->child; in fhc_intr_wrapper()
1039 *(intr_info->clear_reg) = tmpreg; in fhc_intr_wrapper()
1042 tmpreg = *(intr_info->clear_reg); in fhc_intr_wrapper()
1069 uchar_t *spurious_cntr = &softsp->spurious_zs_cntr; in fhc_zs_intr_wrapper()
1071 funcp0 = softsp->poll_list[0].funcp; in fhc_zs_intr_wrapper()
1072 funcp1 = softsp->poll_list[1].funcp; in fhc_zs_intr_wrapper()
1073 funcp0_arg1 = softsp->poll_list[0].arg1; in fhc_zs_intr_wrapper()
1074 funcp0_arg2 = softsp->poll_list[0].arg2; in fhc_zs_intr_wrapper()
1075 funcp1_arg1 = softsp->poll_list[1].arg1; in fhc_zs_intr_wrapper()
1076 funcp1_arg2 = softsp->poll_list[1].arg2; in fhc_zs_intr_wrapper()
1077 clear_reg = softsp->intr_regs[FHC_UART_INO].clear_reg; in fhc_zs_intr_wrapper()
1117 * add_intrspec - Add an interrupt specification.
1135 (softsp->list->sc.board << BD_IVINTR_SHFT)); in fhc_add_intr_impl()
1138 ino = FHC_INO(hdlp->ih_vector); in fhc_add_intr_impl()
1139 mondo_vec_reg = softsp->intr_regs[ino].mapping_reg; in fhc_add_intr_impl()
1169 mutex_enter(&softsp->poll_list_lock); in fhc_add_intr_impl()
1177 if (softsp->poll_list[zs_inst].funcp == NULL) { in fhc_add_intr_impl()
1178 softsp->poll_list[zs_inst].arg1 = in fhc_add_intr_impl()
1179 hdlp->ih_cb_arg1; in fhc_add_intr_impl()
1180 softsp->poll_list[zs_inst].arg2 = in fhc_add_intr_impl()
1181 hdlp->ih_cb_arg2; in fhc_add_intr_impl()
1182 softsp->poll_list[zs_inst].funcp = in fhc_add_intr_impl()
1184 hdlp->ih_cb_func; in fhc_add_intr_impl()
1185 softsp->poll_list[zs_inst].inum = in fhc_add_intr_impl()
1186 hdlp->ih_inum; in fhc_add_intr_impl()
1187 softsp->poll_list[zs_inst].child = rdip; in fhc_add_intr_impl()
1197 mutex_exit(&softsp->poll_list_lock); in fhc_add_intr_impl()
1214 softsp->poll_list[zs_inst].funcp, in fhc_add_intr_impl()
1215 softsp->poll_list[zs_inst].arg1, in fhc_add_intr_impl()
1216 softsp->poll_list[zs_inst].arg2); in fhc_add_intr_impl()
1229 mutex_exit(&softsp->poll_list_lock); in fhc_add_intr_impl()
1234 mutex_exit(&softsp->poll_list_lock); in fhc_add_intr_impl()
1241 fhc_arg->child = rdip; in fhc_add_intr_impl()
1242 fhc_arg->mapping_reg = mondo_vec_reg; in fhc_add_intr_impl()
1243 fhc_arg->clear_reg = (softsp->intr_regs[ino].clear_reg); in fhc_add_intr_impl()
1244 fhc_arg->softsp = softsp; in fhc_add_intr_impl()
1245 fhc_arg->funcp = in fhc_add_intr_impl()
1246 (ddi_intr_handler_t *)hdlp->ih_cb_func; in fhc_add_intr_impl()
1247 fhc_arg->arg1 = hdlp->ih_cb_arg1; in fhc_add_intr_impl()
1248 fhc_arg->arg2 = hdlp->ih_cb_arg2; in fhc_add_intr_impl()
1249 fhc_arg->inum = hdlp->ih_inum; in fhc_add_intr_impl()
1252 if (softsp->intr_list[i] == 0) { in fhc_add_intr_impl()
1253 softsp->intr_list[i] = fhc_arg; in fhc_add_intr_impl()
1268 DDI_INTR_ASSIGN_HDLR_N_ARGS(hdlp, fhc_arg->funcp, in fhc_add_intr_impl()
1269 fhc_arg->arg1, fhc_arg->arg2); in fhc_add_intr_impl()
1284 *(softsp->intr_regs[ino].clear_reg) = ISM_IDLE; in fhc_add_intr_impl()
1303 ("Mondo 0x%x mapping reg: 0x%p", hdlp->ih_vector, in fhc_add_intr_impl()
1310 tmpreg = *(softsp->id); in fhc_add_intr_impl()
1320 * remove_intrspec - Remove an interrupt specification.
1335 (softsp->list->sc.board << BD_IVINTR_SHFT)); in fhc_remove_intr_impl()
1338 ino = FHC_INO(hdlp->ih_vector); in fhc_remove_intr_impl()
1344 mutex_enter(&softsp->poll_list_lock); in fhc_remove_intr_impl()
1351 if (softsp->poll_list[i].child == rdip && in fhc_remove_intr_impl()
1352 softsp->poll_list[i].inum == hdlp->ih_inum) { in fhc_remove_intr_impl()
1353 softsp->poll_list[i].funcp = NULL; in fhc_remove_intr_impl()
1362 mutex_exit(&softsp->poll_list_lock); in fhc_remove_intr_impl()
1370 if ((softsp->poll_list[0].funcp == NULL) && in fhc_remove_intr_impl()
1371 (softsp->poll_list[1].funcp == NULL)) { in fhc_remove_intr_impl()
1373 softsp->intr_regs[FHC_UART_INO].mapping_reg; in fhc_remove_intr_impl()
1377 tmpreg = *(softsp->ctrl); in fhc_remove_intr_impl()
1383 mutex_exit(&softsp->poll_list_lock); in fhc_remove_intr_impl()
1389 if (softsp->intr_list[i]->child == rdip && in fhc_remove_intr_impl()
1390 softsp->intr_list[i]->inum == hdlp->ih_inum) in fhc_remove_intr_impl()
1396 mondo_vec_reg = softsp->intr_list[i]->mapping_reg; in fhc_remove_intr_impl()
1403 tmpreg = *(softsp->id); in fhc_remove_intr_impl()
1411 kmem_free(softsp->intr_list[i], in fhc_remove_intr_impl()
1413 softsp->intr_list[i] = 0; in fhc_remove_intr_impl()
1432 *(int *)result = hdlp->ih_scratch1; in fhc_intr_ops()
1437 if (hdlp->ih_pri == 0) { in fhc_intr_ops()
1444 (softsp->list->sc.board << BD_IVINTR_SHFT)); in fhc_intr_ops()
1447 *(int *)result = hdlp->ih_pri; in fhc_intr_ops()
1489 * DDI_CTLOPS_REPORTDEV TODO - need to implement this.
1507 * TODO - Figure out what makes sense to report here. in fhc_ctlops()
1525 * with on-board devices and we have an interrupt_number property which
1535 mondo = hdlp->ih_vector; in fhc_xlate_intrs()
1537 hdlp->ih_vector = (mondo | ign); in fhc_xlate_intrs()
1538 if (hdlp->ih_pri == 0) in fhc_xlate_intrs()
1539 hdlp->ih_pri = fhc_int_priorities[FHC_INO(mondo)]; in fhc_xlate_intrs()
1550 if (in_args->handle != NULL) in fhc_ctlops_peekpoke()
1559 err = do_poke(in_args->size, (void *)in_args->dev_addr, in fhc_ctlops_peekpoke()
1560 (void *)in_args->host_addr); in fhc_ctlops_peekpoke()
1563 err = do_peek(in_args->size, (void *)in_args->dev_addr, in fhc_ctlops_peekpoke()
1564 (void *)in_args->host_addr); in fhc_ctlops_peekpoke()
1565 result = (void *)in_args->host_addr; in fhc_ctlops_peekpoke()
1586 envstat->index = 0; in init_temp_arrays()
1589 envstat->l1[i] = NA_TEMP; in init_temp_arrays()
1593 envstat->l2[i] = NA_TEMP; in init_temp_arrays()
1597 envstat->l3[i] = NA_TEMP; in init_temp_arrays()
1601 envstat->l4[i] = NA_TEMP; in init_temp_arrays()
1605 envstat->l5[i] = NA_TEMP; in init_temp_arrays()
1608 envstat->max = NA_TEMP; in init_temp_arrays()
1609 envstat->min = NA_TEMP; in init_temp_arrays()
1610 envstat->trend = TREND_UNKNOWN; in init_temp_arrays()
1611 envstat->version = TEMP_KSTAT_VERSION; in init_temp_arrays()
1612 envstat->override = NA_TEMP; in init_temp_arrays()
1628 int count; /* Count of non-zero values in array */ in update_temp()
1629 int total; /* sum total of non-zero values in array */ in update_temp()
1645 envstat->index++; in update_temp()
1646 index = envstat->index; in update_temp()
1657 tmp_index -= 1; /* decrement by 1 for indexing */ in update_temp()
1663 if (envstat->l4[i] != NA_TEMP) { in update_temp()
1664 total += (int)envstat->l4[i]; in update_temp()
1674 envstat->l5[tmp_index] = total/count; in update_temp()
1676 envstat->l5[tmp_index] = NA_TEMP; in update_temp()
1683 tmp_index -= 1; /* decrement by 1 for indexing */ in update_temp()
1689 if (envstat->l3[i] != NA_TEMP) { in update_temp()
1690 total += (int)envstat->l3[i]; in update_temp()
1700 envstat->l4[tmp_index] = total/count; in update_temp()
1702 envstat->l4[tmp_index] = NA_TEMP; in update_temp()
1709 tmp_index -= 1; /* decrement by 1 for indexing */ in update_temp()
1715 if (envstat->l2[i] != NA_TEMP) { in update_temp()
1716 total += (int)envstat->l2[i]; in update_temp()
1726 envstat->l3[tmp_index] = total/count; in update_temp()
1728 envstat->l3[tmp_index] = NA_TEMP; in update_temp()
1735 tmp_index -= 1; /* decrement by 1 for indexing */ in update_temp()
1741 if (envstat->l1[i] != NA_TEMP) { in update_temp()
1742 total += (int)envstat->l1[i]; in update_temp()
1752 envstat->l2[tmp_index] = total/count; in update_temp()
1754 envstat->l2[tmp_index] = NA_TEMP; in update_temp()
1759 if (envstat->override != NA_TEMP) { in update_temp()
1761 real_temp = envstat->override; in update_temp()
1764 real_temp = calibrate_temp(softsp->list->sc.type, value, in update_temp()
1765 softsp->list->sc.ac_compid); in update_temp()
1768 envstat->l1[index % L1_SZ] = real_temp; in update_temp()
1771 temp_state = get_temp_state(softsp->list->sc.type, real_temp, in update_temp()
1772 softsp->list->sc.board); in update_temp()
1775 if (temp_state != envstat->state) { in update_temp()
1776 int board = softsp->list->sc.board; in update_temp()
1777 enum board_type type = softsp->list->sc.type; in update_temp()
1781 if (temp_state > envstat->state) { in update_temp()
1782 if (envstat->state == TEMP_OK) { in update_temp()
1792 envstat->temp_cnt = 0; in update_temp()
1793 envstat->state = temp_state; in update_temp()
1802 if (temperature_chamber == -1) in update_temp()
1810 envstat->shutdown_cnt = 1; in update_temp()
1811 if (temperature_chamber == -1) in update_temp()
1827 "over-temperature " in update_temp()
1845 } else if (temp_state < envstat->state) { in update_temp()
1850 envstat->shutdown_cnt = 0; in update_temp()
1853 if (envstat->temp_cnt == 0) { in update_temp()
1854 envstat->temp_cnt = TEMP_STATE_COUNT; in update_temp()
1855 } else if (--envstat->temp_cnt == 0) { in update_temp()
1882 if (envstat->state == TEMP_DANGER && in update_temp()
1886 (--shutdown_msg == 0)) { in update_temp()
1888 "shutdown due to over-" in update_temp()
1892 envstat->state = temp_state; in update_temp()
1898 envstat->temp_cnt = 0; in update_temp()
1901 if (temperature_chamber == -1) { in update_temp()
1905 if ((envstat->shutdown_cnt++ >= SHUTDOWN_COUNT) && in update_temp()
1913 softsp->list->sc.type, in update_temp()
1914 softsp->list->sc.board); in update_temp()
1927 if ((envstat->max == NA_TEMP) || (real_temp > envstat->max)) { in update_temp()
1928 envstat->max = real_temp; in update_temp()
1931 if ((envstat->min == NA_TEMP) || (real_temp < envstat->min)) { in update_temp()
1932 envstat->min = real_temp; in update_temp()
1941 enum board_type type = softsp->list->sc.type; in update_temp()
1943 envstat->trend = temp_trend(envstat); in update_temp()
1947 if (envstat->trend == TREND_RAPID_RISE && in update_temp()
1950 int board = softsp->list->sc.board; in update_temp()
1960 #define PREV_L2_INDEX(x) ((x) ? ((x) - 1) : (L2_SZ - 1))
1982 curr_index = (L2_INDEX(tempstat->index) - 1) % L2_SZ; in temp_trend()
1983 curr_temp = tempstat->l2[curr_index]; in temp_trend()
1987 for (read_cnt = 0; read_cnt < L2_SZ - 1; read_cnt++) { in temp_trend()
1988 if (tempstat->l2[prev_index] == NA_TEMP) in temp_trend()
2000 delta = curr_temp - tempstat->l2[PREV_L2_INDEX(curr_index)]; in temp_trend()
2008 prev_temp = tempstat->l2[prev_index]; in temp_trend()
2013 if (prev_temp <= curr_temp - NOISE_THRESH) { in temp_trend()
2018 } else if (delta <= -RAPID_FALL_THRESH) { /* rapid fall? */ in temp_trend()
2023 prev_temp = tempstat->l2[prev_index]; in temp_trend()
2070 kstatp = (char *)ksp->ks_data; in overtemp_kstat_update()
2071 tempstat = (struct temp_stats *)ksp->ks_private; in overtemp_kstat_update()
2087 max = tempstat->l1[0]; in overtemp_kstat_update()
2088 min = tempstat->l1[0]; in overtemp_kstat_update()
2092 if ((tempstat->l1[i] != NA_TEMP) && in overtemp_kstat_update()
2093 (tempstat->l1[i] > max)) { in overtemp_kstat_update()
2094 max = tempstat->l1[i]; in overtemp_kstat_update()
2097 if ((tempstat->l1[i] != NA_TEMP) && in overtemp_kstat_update()
2098 (tempstat->l1[i] < min)) { in overtemp_kstat_update()
2099 min = tempstat->l1[i]; in overtemp_kstat_update()
2105 if ((tempstat->l2[i] != NA_TEMP) && in overtemp_kstat_update()
2106 (tempstat->l2[i] > max)) { in overtemp_kstat_update()
2107 max = tempstat->l2[i]; in overtemp_kstat_update()
2110 if ((tempstat->l2[i] != NA_TEMP) && in overtemp_kstat_update()
2111 (tempstat->l2[i] < min)) { in overtemp_kstat_update()
2112 min = tempstat->l2[i]; in overtemp_kstat_update()
2118 if ((tempstat->l3[i] != NA_TEMP) && in overtemp_kstat_update()
2119 (tempstat->l3[i] > max)) { in overtemp_kstat_update()
2120 max = tempstat->l3[i]; in overtemp_kstat_update()
2123 if ((tempstat->l3[i] != NA_TEMP) && in overtemp_kstat_update()
2124 (tempstat->l3[i] < min)) { in overtemp_kstat_update()
2125 min = tempstat->l3[i]; in overtemp_kstat_update()
2131 if ((tempstat->l4[i] != NA_TEMP) && in overtemp_kstat_update()
2132 (tempstat->l4[i] > max)) { in overtemp_kstat_update()
2133 max = tempstat->l4[i]; in overtemp_kstat_update()
2136 if ((tempstat->l4[i] != NA_TEMP) && in overtemp_kstat_update()
2137 (tempstat->l4[i] < min)) { in overtemp_kstat_update()
2138 min = tempstat->l4[i]; in overtemp_kstat_update()
2144 if ((tempstat->l5[i] != NA_TEMP) && in overtemp_kstat_update()
2145 (tempstat->l5[i] > max)) { in overtemp_kstat_update()
2146 max = tempstat->l5[i]; in overtemp_kstat_update()
2149 if ((tempstat->l5[i] != NA_TEMP) && in overtemp_kstat_update()
2150 (tempstat->l5[i] < min)) { in overtemp_kstat_update()
2151 min = tempstat->l5[i]; in overtemp_kstat_update()
2170 kstatp = (short *)ksp->ks_data; in temp_override_kstat_update()
2171 over = (short *)ksp->ks_private; in temp_override_kstat_update()
2208 result = cpu2_table[CPU2_MX_CNT-1]; in calibrate_temp()
2214 result = cpu_table[CPU_MX_CNT-1]; in calibrate_temp()
2229 result = io_table[IO_MX_CNT-1]; in calibrate_temp()
2239 result = clock_table[CLK_MX_CNT-1]; in calibrate_temp()
2277 if ((cpa->cpu_type_info.pi_clock) >= 400) { in get_temp_state()
2283 if ((cpb->cpu_type_info.pi_clock) >= 400) { in get_temp_state()
2331 if ((fhc_ksp = kstat_create("unix", softsp->list->sc.board, in fhc_add_kstats()
2336 ddi_get_instance(softsp->dip)); in fhc_add_kstats()
2340 fhc_named_ksp = (struct fhc_kstat *)(fhc_ksp->ks_data); in fhc_add_kstats()
2343 kstat_named_init(&fhc_named_ksp->csr, in fhc_add_kstats()
2347 kstat_named_init(&fhc_named_ksp->bsr, in fhc_add_kstats()
2351 fhc_ksp->ks_update = fhc_kstat_update; in fhc_add_kstats()
2352 fhc_ksp->ks_private = (void *)softsp; in fhc_add_kstats()
2353 softsp->fhc_ksp = fhc_ksp; in fhc_add_kstats()
2363 fhcksp = (struct fhc_kstat *)ksp->ks_data; in fhc_kstat_update()
2364 softsp = (struct fhc_soft_state *)ksp->ks_private; in fhc_kstat_update()
2366 /* this is a read-only kstat. Bail out on a write */ in fhc_kstat_update()
2374 fhcksp->csr.value.ui32 = *softsp->ctrl; in fhc_kstat_update()
2375 fhcksp->bsr.value.ui32 = *softsp->bsr; in fhc_kstat_update()
2411 mutex_enter(&board->softsp->ctrl_lock); in update_board_leds()
2414 temp = *board->softsp->ctrl; in update_board_leds()
2433 *board->softsp->ctrl = temp; in update_board_leds()
2436 temp = *board->softsp->ctrl; in update_board_leds()
2441 mutex_exit(&board->softsp->ctrl_lock); in update_board_leds()
2457 * boot -h. in check_for_chamber()
2465 * An OBP option, 'mfg-mode' is being used to inform us as to in check_for_chamber()
2470 if ((options_dip = ddi_find_devinfo("options", -1, 0)) != NULL) { in check_for_chamber()
2472 mfgmode_len = prom_getproplen(options_node_id, "mfg-mode"); in check_for_chamber()
2473 if (mfgmode_len == -1) { in check_for_chamber()
2478 retval = prom_getprop(options_node_id, "mfg-mode", mfgmode); in check_for_chamber()
2479 if (retval != -1) { in check_for_chamber()
2567 mondo_vec_reg = softsp->intr_regs[i].mapping_reg; in fhc_intrdist()
2568 intr_state_reg = softsp->intr_regs[i].clear_reg; in fhc_intrdist()
2588 tmp_reg = *softsp->id; in fhc_intrdist()
2598 /* re-target the mondo and turn it on */ in fhc_intrdist()
2605 tmp_reg = *(softsp->id); in fhc_intrdist()
2634 for (list = ft_list; list != NULL; list = list->next) { in reg_fault()
2635 if ((list->f.unit == unit) && (list->f.type == type) && in reg_fault()
2636 (list->f.fclass == fclass)) { in reg_fault()
2646 list->f.unit = unit; in reg_fault()
2647 list->f.type = type; in reg_fault()
2648 list->f.fclass = fclass; in reg_fault()
2649 list->f.create_time = (time32_t)gethrestime_sec(); /* XX64 */ in reg_fault()
2650 (void) strncpy(list->f.msg, ft_str_table[type], MAX_FT_DESC); in reg_fault()
2653 list->next = ft_list; in reg_fault()
2684 for (; list != NULL; vect = &list->next, list = list->next) { in clear_fault()
2685 if ((list->f.unit == unit) && (list->f.type == type) && in clear_fault()
2686 (list->f.fclass == fclass)) { in clear_fault()
2688 *vect = list->next; in clear_fault()
2694 ft_nfaults--; in clear_fault()
2706 * in the system, then a non-zero value is returned. Else zero is returned.
2722 (void) fhc_bdlist_lock(-1); in process_fault_list()
2729 bdlist->fault = 0; in process_fault_list()
2732 for (ftlist = ft_list; ftlist != NULL; ftlist = ftlist->next) { in process_fault_list()
2741 if (ftlist->f.fclass == FT_BOARD) { in process_fault_list()
2743 if (fhc_bd_valid(ftlist->f.unit)) { in process_fault_list()
2744 bdlist = fhc_bd(ftlist->f.unit); in process_fault_list()
2745 bdlist->fault = 1; in process_fault_list()
2748 ftlist->f.unit); in process_fault_list()
2763 * Add a new memloc to the database (and keep 'em sorted by PA)
2772 ASSERT((size & (size-1)) == 0); /* size must be power of 2 */ in fhc_add_memloc()
2776 p != NULL; pp = &p->next, p = p->next) { in fhc_add_memloc()
2778 if (ipa < p->pa) { in fhc_add_memloc()
2783 p->next = *pp; in fhc_add_memloc()
2784 p->board = board; in fhc_add_memloc()
2785 p->pa = ipa; in fhc_add_memloc()
2786 p->size = size; in fhc_add_memloc()
2789 p->board, p->pa, p->size); in fhc_add_memloc()
2807 if (p->board == board) { in fhc_del_memloc()
2810 "0x%x 0x%x", board, p->pa, p->size); in fhc_del_memloc()
2812 *pp = p->next; in fhc_del_memloc()
2815 pp = &(p->next); in fhc_del_memloc()
2828 uint_t mask = ~(size-1); in fhc_find_memloc_gap()
2831 ASSERT((size & (size-1)) == 0); /* size must be power of 2 */ in fhc_find_memloc_gap()
2838 for (p = fhc_base_memloc; p != NULL; p = p->next) { in fhc_find_memloc_gap()
2841 if (base_pa + size <= p->pa) in fhc_find_memloc_gap()
2843 base_pa = p->pa + p->size; in fhc_find_memloc_gap()
2985 ksp->ks_data = NULL; in create_ft_kstats()
2986 ksp->ks_update = ft_ks_update; in create_ft_kstats()
2987 ksp->ks_snapshot = ft_ks_snapshot; in create_ft_kstats()
2988 ksp->ks_data_size = 1; in create_ft_kstats()
2989 ksp->ks_lock = &ftlist_mutex; in create_ft_kstats()
3007 ksp->ks_snaptime = gethrtime(); in ft_ks_snapshot()
3009 for (ftlist = ft_list; ftlist != NULL; ftlist = ftlist->next) { in ft_ks_snapshot()
3010 bcopy(&ftlist->f, buf, sizeof (struct ft_list)); in ft_ks_snapshot()
3029 ksp->ks_data_size = ft_nfaults * in ft_ks_update()
3032 ksp->ks_data_size = 1; in ft_ks_update()
3075 cpa->cpu_id); in fhc_board_poweroffcpus()
3079 cpa->cpu_id); in fhc_board_poweroffcpus()
3093 cpb->cpu_id); in fhc_board_poweroffcpus()
3098 cpb->cpu_id); in fhc_board_poweroffcpus()
3107 cpa->cpu_id); in fhc_board_poweroffcpus()
3111 cpa->cpu_id); in fhc_board_poweroffcpus()
3115 cpa->cpu_id); in fhc_board_poweroffcpus()
3123 cpb->cpu_id); in fhc_board_poweroffcpus()
3128 cpb->cpu_id); in fhc_board_poweroffcpus()
3132 cpb->cpu_id); in fhc_board_poweroffcpus()
3151 base = FHC_DTAG_BASE(cpa->cpu_id); in fhc_board_poweroffcpus()
3153 base = FHC_DTAG_BASE(cpb->cpu_id); in fhc_board_poweroffcpus()
3200 ASSERT((cp->cpu_flags & (CPU_EXISTS | CPU_OFFLINE | CPU_QUIESCED)) == in fhc_cpu_poweroff()
3207 board = FHC_CPU2BOARD(cp->cpu_id); in fhc_cpu_poweroff()
3209 ASSERT(fhc_bd_valid(board) && (bd_list->sc.type == CPU_BOARD)); in fhc_cpu_poweroff()
3217 * This prevents the x-trap victim from blocking when doing prom in fhc_cpu_poweroff()
3218 * IEEE-1275 calls at a high PIL level. in fhc_cpu_poweroff()
3224 * the CPU 'not ready'- (i.e. removing the CPU from cpu_ready_set) to in fhc_cpu_poweroff()
3230 xt_one_unchecked(cp->cpu_id, (xcfunc_t *)idle_stop_xcall, in fhc_cpu_poweroff()
3237 for (delays = FHC_SHUTDOWN_WAIT_MSEC; delays != 0; delays--) { in fhc_cpu_poweroff()
3243 temp = *bd_list->softsp->ctrl; in fhc_cpu_poweroff()
3246 if (FHC_CPU_IS_A(cp->cpu_id)) { in fhc_cpu_poweroff()
3261 panic("Processor %d failed during shutdown", cp->cpu_id); in fhc_cpu_poweroff()
3277 ASSERT(CPU->cpu_intr_actv == 0); in fhc_cpu_shutdown_self()
3278 ASSERT(CPU->cpu_thread == CPU->cpu_idle_thread || in fhc_cpu_shutdown_self()
3279 CPU->cpu_thread == CPU->cpu_startup_thread); in fhc_cpu_shutdown_self()
3281 CPU->cpu_flags = CPU_POWEROFF | CPU_OFFLINE | CPU_QUIESCED; in fhc_cpu_shutdown_self()
3298 int cpuid = cp->cpu_id; in fhc_cpu_start()
3313 cp->cpu_flags &= ~CPU_POWEROFF; in fhc_cpu_start()
3342 board = FHC_CPU2BOARD(cp->cpu_id); in fhc_cpu_poweron()
3346 ASSERT(bd_list->sc.type == CPU_BOARD); in fhc_cpu_poweron()
3347 ASSERT(bd_list->dev_softsp != NULL); in fhc_cpu_poweron()
3350 bd_list->dev_softsp)->tempstat.state; in fhc_cpu_poweron()
3361 ((cp_other = cpu_get(FHC_OTHER_CPU_ID(cp->cpu_id))) != NULL)) { in fhc_cpu_poweron()
3370 cp->cpu_id, cp_other->cpu_id, status_other); in fhc_cpu_poweron()
3382 * OS must flush the D-tags and execute the shutdown instruction.)
3434 FHC_BASE_NOMEM + CPU->cpu_id * FHC_MAX_ECACHE_SIZE, in os_completes_shutdown()
3435 cpunodes[CPU->cpu_id].ecache_size); in os_completes_shutdown()
3455 if (!bdp->dev_softsp) { in fhc_env_temp_state()
3458 envp = (struct environ_soft_state *)bdp->dev_softsp; in fhc_env_temp_state()
3460 return (envp->tempstat.state); in fhc_env_temp_state()