Lines Matching refs:chiptod
108 PnvChipTOD *chiptod = PNV_CHIPTOD(opaque); in pnv_chiptod_xscom_read() local
120 if (chiptod->tod_state == tod_running) { in pnv_chiptod_xscom_read()
126 if (chiptod->primary) { in pnv_chiptod_xscom_read()
128 } else if (chiptod->secondary) { in pnv_chiptod_xscom_read()
135 val = chiptod->pss_mss_ctrl_reg; in pnv_chiptod_xscom_read()
141 val = chiptod->tod_error; in pnv_chiptod_xscom_read()
144 if (chiptod->tod_state == tod_running) { in pnv_chiptod_xscom_read()
158 static void chiptod_receive_ttype(PnvChipTOD *chiptod, uint32_t trigger) in chiptod_receive_ttype() argument
162 if (chiptod->tod_state != tod_not_set) { in chiptod_receive_ttype()
165 chiptod->tod_state); in chiptod_receive_ttype()
167 chiptod->tod_state = tod_running; in chiptod_receive_ttype()
172 chiptod->tod_state = tod_not_set; in chiptod_receive_ttype()
189 PnvChipTOD *chiptod = &chip9->chiptod; in chiptod_power9_broadcast_ttype() local
191 if (chiptod != sender) { in chiptod_power9_broadcast_ttype()
192 chiptod_receive_ttype(chiptod, trigger); in chiptod_power9_broadcast_ttype()
205 PnvChipTOD *chiptod = &chip10->chiptod; in chiptod_power10_broadcast_ttype() local
207 if (chiptod != sender) { in chiptod_power10_broadcast_ttype()
208 chiptod_receive_ttype(chiptod, trigger); in chiptod_power10_broadcast_ttype()
231 static PnvCore *chiptod_power9_tx_ttype_target(PnvChipTOD *chiptod, in chiptod_power9_tx_ttype_target() argument
247 return pnv_chip_get_core_by_xscom_base(chiptod->chip, addr & ~0xfff); in chiptod_power9_tx_ttype_target()
251 return pnv_chip_find_core(chiptod->chip, core_id); in chiptod_power9_tx_ttype_target()
255 static PnvCore *chiptod_power10_tx_ttype_target(PnvChipTOD *chiptod, in chiptod_power10_tx_ttype_target() argument
277 return pnv_chip_get_core_by_xscom_base(chiptod->chip, addr & ~0xfff); in chiptod_power10_tx_ttype_target()
289 PnvChipTOD *chiptod = PNV_CHIPTOD(opaque); in pnv_chiptod_xscom_write() local
290 PnvChipTODClass *pctc = PNV_CHIPTOD_GET_CLASS(chiptod); in pnv_chiptod_xscom_write()
298 if (chiptod->primary) { in pnv_chiptod_xscom_write()
304 chiptod->pss_mss_ctrl_reg = val & PPC_BITMASK(0, 31); in pnv_chiptod_xscom_write()
316 chiptod->slave_pc_target = pctc->tx_ttype_target(chiptod, val); in pnv_chiptod_xscom_write()
317 if (!chiptod->slave_pc_target) { in pnv_chiptod_xscom_write()
324 chiptod->tod_error &= ~val; in pnv_chiptod_xscom_write()
332 chiptod->tod_state = tod_not_set; in pnv_chiptod_xscom_write()
336 if (chiptod->tod_state != tod_not_set) { in pnv_chiptod_xscom_write()
339 chiptod->tod_state); in pnv_chiptod_xscom_write()
342 chiptod->tod_state = tod_stopped; in pnv_chiptod_xscom_write()
344 chiptod->tod_state = tod_running; in pnv_chiptod_xscom_write()
355 if (chiptod->tod_state != tod_running) { in pnv_chiptod_xscom_write()
358 chiptod->tod_state); in pnv_chiptod_xscom_write()
363 } else if (chiptod->slave_pc_target == NULL) { in pnv_chiptod_xscom_write()
367 PnvCore *pc = chiptod->slave_pc_target; in pnv_chiptod_xscom_write()
389 if (chiptod->tod_state != tod_stopped) { in pnv_chiptod_xscom_write()
392 chiptod->tod_state); in pnv_chiptod_xscom_write()
394 chiptod->tod_state = tod_running; in pnv_chiptod_xscom_write()
399 pctc->broadcast_ttype(chiptod, offset); in pnv_chiptod_xscom_write()
421 PnvChipTOD *chiptod = PNV_CHIPTOD(dev); in pnv_chiptod_dt_xscom() local
434 if (chiptod->primary) { in pnv_chiptod_dt_xscom()
436 } else if (chiptod->secondary) { in pnv_chiptod_dt_xscom()
526 PnvChipTOD *chiptod = PNV_CHIPTOD(dev); in pnv_chiptod_reset() local
528 chiptod->pss_mss_ctrl_reg = 0; in pnv_chiptod_reset()
529 if (chiptod->primary) { in pnv_chiptod_reset()
530 chiptod->pss_mss_ctrl_reg |= PPC_BIT(1); /* TOD is master */ in pnv_chiptod_reset()
533 chiptod->pss_mss_ctrl_reg |= PPC_BIT(2); in pnv_chiptod_reset()
535 chiptod->tod_error = 0; in pnv_chiptod_reset()
536 chiptod->tod_state = tod_error; in pnv_chiptod_reset()
541 PnvChipTOD *chiptod = PNV_CHIPTOD(dev); in pnv_chiptod_realize() local
542 PnvChipTODClass *pctc = PNV_CHIPTOD_GET_CLASS(chiptod); in pnv_chiptod_realize()
545 pnv_xscom_region_init(&chiptod->xscom_regs, OBJECT(dev), in pnv_chiptod_realize()
546 &pnv_chiptod_xscom_ops, chiptod, "xscom-chiptod", in pnv_chiptod_realize()
549 qemu_register_reset(pnv_chiptod_reset, chiptod); in pnv_chiptod_realize()
554 PnvChipTOD *chiptod = PNV_CHIPTOD(dev); in pnv_chiptod_unrealize() local
556 qemu_unregister_reset(pnv_chiptod_reset, chiptod); in pnv_chiptod_unrealize()