Lines Matching +full:erratum +full:- +full:a008585

1 // SPDX-License-Identifier: GPL-2.0-only
29 #include <linux/arm-smccc.h>
77 [ARCH_TIMER_PHYS_SECURE_PPI] = "sec-phys",
80 [ARCH_TIMER_HYP_PPI] = "hyp-phys",
81 [ARCH_TIMER_HYP_VIRT_PPI] = "hyp-virt",
109 * 2) a roll-over time of not less than 40 years
118 return clamp_val(ilog2(min_cycles - 1) + 1, 56, 64); in arch_counter_get_width()
133 writel_relaxed((u32)val, timer->base + CNTP_CTL); in arch_timer_reg_write()
140 writeq_relaxed(val, timer->base + CNTP_CVAL_LO); in arch_timer_reg_write()
149 writel_relaxed((u32)val, timer->base + CNTV_CTL); in arch_timer_reg_write()
153 writeq_relaxed(val, timer->base + CNTV_CVAL_LO); in arch_timer_reg_write()
173 val = readl_relaxed(timer->base + CNTP_CTL); in arch_timer_reg_read()
182 val = readl_relaxed(timer->base + CNTV_CTL); in arch_timer_reg_read()
281 _retries--; \
304 * Theoretically the erratum should not occur more than twice in succession
317 _retries--; \
318 } while (unlikely((_new - _old) >> 5) && _retries); \
382 * (7ff -> 000 -> 800) and forward (7ff -> fff -> 800), ignore register values
392 _retries--; \
460 .id = "fsl,erratum-a008585",
461 .desc = "Freescale erratum a005858",
471 .id = "hisilicon,erratum-161010101",
472 .desc = "HiSilicon erratum 161010101",
481 .desc = "HiSilicon erratum 161010101",
492 .desc = "ARM erratum 858921",
502 .id = "allwinner,erratum-unknown1",
503 .desc = "Allwinner erratum UNKNOWN1",
514 .desc = "ARM erratum 1418040",
529 return of_property_read_bool(np, wa->id); in arch_timer_check_dt_erratum()
536 return this_cpu_has_cap((uintptr_t)wa->id); in arch_timer_check_local_cap_erratum()
545 const struct ate_acpi_oem_info *info = wa->id; in arch_timer_check_acpi_oem_erratum()
550 if (!memcmp(info->oem_id, table->oem_id, ACPI_OEM_ID_SIZE) && in arch_timer_check_acpi_oem_erratum()
551 !memcmp(info->oem_table_id, table->oem_table_id, ACPI_OEM_TABLE_ID_SIZE) && in arch_timer_check_acpi_oem_erratum()
552 info->oem_revision == table->oem_revision) in arch_timer_check_acpi_oem_erratum()
592 if (wa->read_cntvct_el0 || wa->read_cntpct_el0) in arch_timer_enable_workaround()
597 * out-of-line counter accessor. We may change our mind pretty in arch_timer_enable_workaround()
598 * late in the game (with a per-CPU erratum, for example), so in arch_timer_enable_workaround()
601 if (wa->read_cntvct_el0) { in arch_timer_enable_workaround()
604 } else if (wa->disable_compat_vdso && vdso_default != VDSO_CLOCKMODE_NONE) { in arch_timer_enable_workaround()
640 wa->desc, __wa->desc); in arch_timer_check_ool_workaround()
647 local ? "local" : "global", wa->desc); in arch_timer_check_ool_workaround()
674 evt->event_handler(evt); in timer_handler()
779 cnt_hi = __le32_to_cpu((__le32 __force)__raw_readl(t->base + offset_lo + 4)); in arch_counter_get_cnt_mem()
780 cnt_lo = __le32_to_cpu((__le32 __force)__raw_readl(t->base + offset_lo)); in arch_counter_get_cnt_mem()
781 tmp_hi = __le32_to_cpu((__le32 __force)__raw_readl(t->base + offset_lo + 4)); in arch_counter_get_cnt_mem()
833 * XGene-1 implements CVAL in terms of TVAL, meaning in __arch_timer_check_delta()
858 clk->features = CLOCK_EVT_FEAT_ONESHOT; in __arch_timer_setup()
861 typeof(clk->set_next_event) sne; in __arch_timer_setup()
866 clk->features |= CLOCK_EVT_FEAT_C3STOP; in __arch_timer_setup()
867 clk->name = "arch_sys_timer"; in __arch_timer_setup()
868 clk->rating = 450; in __arch_timer_setup()
869 clk->cpumask = cpumask_of(smp_processor_id()); in __arch_timer_setup()
870 clk->irq = arch_timer_ppi[arch_timer_uses_ppi]; in __arch_timer_setup()
873 clk->set_state_shutdown = arch_timer_shutdown_virt; in __arch_timer_setup()
874 clk->set_state_oneshot_stopped = arch_timer_shutdown_virt; in __arch_timer_setup()
880 clk->set_state_shutdown = arch_timer_shutdown_phys; in __arch_timer_setup()
881 clk->set_state_oneshot_stopped = arch_timer_shutdown_phys; in __arch_timer_setup()
888 clk->set_next_event = sne; in __arch_timer_setup()
891 clk->features |= CLOCK_EVT_FEAT_DYNIRQ; in __arch_timer_setup()
892 clk->name = "arch_mem_timer"; in __arch_timer_setup()
893 clk->rating = 400; in __arch_timer_setup()
894 clk->cpumask = cpu_possible_mask; in __arch_timer_setup()
896 clk->set_state_shutdown = arch_timer_shutdown_virt_mem; in __arch_timer_setup()
897 clk->set_state_oneshot_stopped = arch_timer_shutdown_virt_mem; in __arch_timer_setup()
898 clk->set_next_event = in __arch_timer_setup()
901 clk->set_state_shutdown = arch_timer_shutdown_phys_mem; in __arch_timer_setup()
902 clk->set_state_oneshot_stopped = arch_timer_shutdown_phys_mem; in __arch_timer_setup()
903 clk->set_next_event = in __arch_timer_setup()
910 clk->set_state_shutdown(clk); in __arch_timer_setup()
923 divider -= 8; in arch_timer_evtstrm_enable()
951 lsb = fls(evt_stream_div) - 1; in arch_timer_configure_evtstream()
952 if (lsb > 0 && (evt_stream_div & BIT(lsb - 1))) in arch_timer_configure_evtstream()
1051 return -EINVAL; in validate_timer_rate()
1060 * For historical reasons, when probing with DT we use whichever (non-zero)
1062 * probed has a clock-frequency property, this overrides the HW register.
1070 if (of_property_read_u32(np, "clock-frequency", &arch_timer_rate)) in arch_timer_of_configure_rate()
1177 pr_debug("disable IRQ%d cpu #%d\n", clk->irq, smp_processor_id()); in arch_timer_stop()
1242 err = -ENOMEM; in arch_timer_register()
1313 return -ENOMEM; in arch_timer_mem_register()
1315 arch_timer_mem->base = base; in arch_timer_mem_register()
1316 arch_timer_mem->evt.irq = irq; in arch_timer_mem_register()
1317 __arch_timer_setup(ARCH_TIMER_TYPE_MEM, &arch_timer_mem->evt); in arch_timer_mem_register()
1324 ret = request_irq(irq, func, IRQF_TIMER, "arch_mem_timer", &arch_timer_mem->evt); in arch_timer_mem_register()
1335 { .compatible = "arm,armv7-timer", },
1336 { .compatible = "arm,armv8-timer", },
1341 { .compatible = "arm,armv7-timer-mem", },
1351 /* We have two timers, and both device-tree nodes are probed. */ in arch_timer_needs_of_probing()
1357 * check if we have another type of timer node in device-tree. in arch_timer_needs_of_probing()
1380 * arch_timer_select_ppi() - Select suitable PPI for the current system.
1431 has_names = of_property_present(np, "interrupt-names"); in arch_timer_of_init()
1447 arch_timer_c3stop = !of_property_read_bool(np, "always-on"); in arch_timer_of_init()
1457 of_property_read_bool(np, "arm,cpu-registers-not-fw-configured")) in arch_timer_of_init()
1464 return -EINVAL; in arch_timer_of_init()
1469 "arm,no-tick-in-suspend"); in arch_timer_of_init()
1480 TIMER_OF_DECLARE(armv7_arch_timer, "arm,armv7-timer", arch_timer_of_init);
1481 TIMER_OF_DECLARE(armv8_arch_timer, "arm,armv8-timer", arch_timer_of_init);
1489 base = ioremap(frame->cntbase, frame->size); in arch_timer_mem_frame_get_cntfrq()
1491 pr_err("Unable to map frame @ %pa\n", &frame->cntbase); in arch_timer_mem_frame_get_cntfrq()
1510 cntctlbase = ioremap(timer_mem->cntctlbase, timer_mem->size); in arch_timer_mem_find_best_frame()
1513 &timer_mem->cntctlbase); in arch_timer_mem_find_best_frame()
1527 frame = &timer_mem->frame[i]; in arch_timer_mem_find_best_frame()
1528 if (!frame->valid) in arch_timer_mem_find_best_frame()
1560 irq = frame->virt_irq; in arch_timer_mem_frame_register()
1562 irq = frame->phys_irq; in arch_timer_mem_frame_register()
1567 return -EINVAL; in arch_timer_mem_frame_register()
1570 if (!request_mem_region(frame->cntbase, frame->size, in arch_timer_mem_frame_register()
1572 return -EBUSY; in arch_timer_mem_frame_register()
1574 base = ioremap(frame->cntbase, frame->size); in arch_timer_mem_frame_register()
1577 return -ENXIO; in arch_timer_mem_frame_register()
1596 int ret = -EINVAL; in arch_timer_mem_of_init()
1601 return -ENOMEM; in arch_timer_mem_of_init()
1605 timer_mem->cntctlbase = res.start; in arch_timer_mem_of_init()
1606 timer_mem->size = resource_size(&res); in arch_timer_mem_of_init()
1612 if (of_property_read_u32(frame_node, "frame-number", &n)) { in arch_timer_mem_of_init()
1613 pr_err(FW_BUG "Missing frame-number.\n"); in arch_timer_mem_of_init()
1617 pr_err(FW_BUG "Wrong frame-number, only 0-%u are permitted.\n", in arch_timer_mem_of_init()
1618 ARCH_TIMER_MEM_MAX_FRAMES - 1); in arch_timer_mem_of_init()
1621 frame = &timer_mem->frame[n]; in arch_timer_mem_of_init()
1623 if (frame->valid) { in arch_timer_mem_of_init()
1624 pr_err(FW_BUG "Duplicated frame-number.\n"); in arch_timer_mem_of_init()
1631 frame->cntbase = res.start; in arch_timer_mem_of_init()
1632 frame->size = resource_size(&res); in arch_timer_mem_of_init()
1634 frame->virt_irq = irq_of_parse_and_map(frame_node, in arch_timer_mem_of_init()
1636 frame->phys_irq = irq_of_parse_and_map(frame_node, in arch_timer_mem_of_init()
1639 frame->valid = true; in arch_timer_mem_of_init()
1645 &timer_mem->cntctlbase); in arch_timer_mem_of_init()
1646 ret = -EINVAL; in arch_timer_mem_of_init()
1660 TIMER_OF_DECLARE(armv7_arch_timer_mem, "arm,armv7-timer-mem",
1672 frame = &timer_mem->frame[i]; in arch_timer_mem_verify_cntfrq()
1674 if (!frame->valid) in arch_timer_mem_verify_cntfrq()
1682 &frame->cntbase, in arch_timer_mem_verify_cntfrq()
1685 return -EINVAL; in arch_timer_mem_verify_cntfrq()
1700 return -ENOMEM; in arch_timer_mem_acpi_init()
1729 &timer->cntctlbase); in arch_timer_mem_acpi_init()
1739 /* Initialize per-processor generic timer and memory-mapped timer(if present) */
1746 return -EINVAL; in arch_timer_acpi_init()
1780 return -EINVAL; in arch_timer_acpi_init()
1783 /* Always-on capability */ in arch_timer_acpi_init()
1795 pr_err("Failed to initialize memory-mapped timer.\n"); in arch_timer_acpi_init()
1810 return -EOPNOTSUPP; in kvm_arch_ptp_get_crosststamp()
1821 return -EOPNOTSUPP; in kvm_arch_ptp_get_crosststamp()