Lines Matching +full:erratum +full:- +full:unknown1
1 // SPDX-License-Identifier: GPL-2.0-only
99 writel_relaxed(val, timer->base + CNTP_CTL); in arch_timer_reg_write()
102 writel_relaxed(val, timer->base + CNTP_TVAL); in arch_timer_reg_write()
109 writel_relaxed(val, timer->base + CNTV_CTL); in arch_timer_reg_write()
112 writel_relaxed(val, timer->base + CNTV_TVAL); in arch_timer_reg_write()
130 val = readl_relaxed(timer->base + CNTP_CTL); in arch_timer_reg_read()
133 val = readl_relaxed(timer->base + CNTP_TVAL); in arch_timer_reg_read()
140 val = readl_relaxed(timer->base + CNTV_CTL); in arch_timer_reg_read()
143 val = readl_relaxed(timer->base + CNTV_TVAL); in arch_timer_reg_read()
223 _retries--; \
256 * Theoretically the erratum should not occur more than twice in succession
269 _retries--; \
270 } while (unlikely((_new - _old) >> 5) && _retries); \
344 * (7ff -> 000 -> 800) and forward (7ff -> fff -> 800), ignore register values
354 _retries--; \
373 return read_sysreg(cntp_cval_el0) - sun50i_a64_read_cntpct_el0(); in sun50i_a64_read_cntp_tval_el0()
378 return read_sysreg(cntv_cval_el0) - sun50i_a64_read_cntvct_el0(); in sun50i_a64_read_cntv_tval_el0()
427 .id = "fsl,erratum-a008585",
428 .desc = "Freescale erratum a005858",
440 .id = "hisilicon,erratum-161010101",
441 .desc = "HiSilicon erratum 161010101",
452 .desc = "HiSilicon erratum 161010101",
465 .desc = "ARM erratum 858921",
473 .id = "allwinner,erratum-unknown1",
474 .desc = "Allwinner erratum UNKNOWN1",
487 .desc = "ARM erratum 1418040",
502 return of_property_read_bool(np, wa->id); in arch_timer_check_dt_erratum()
509 return this_cpu_has_cap((uintptr_t)wa->id); in arch_timer_check_local_cap_erratum()
518 const struct ate_acpi_oem_info *info = wa->id; in arch_timer_check_acpi_oem_erratum()
523 if (!memcmp(info->oem_id, table->oem_id, ACPI_OEM_ID_SIZE) && in arch_timer_check_acpi_oem_erratum()
524 !memcmp(info->oem_table_id, table->oem_table_id, ACPI_OEM_TABLE_ID_SIZE) && in arch_timer_check_acpi_oem_erratum()
525 info->oem_revision == table->oem_revision) in arch_timer_check_acpi_oem_erratum()
565 if (wa->read_cntvct_el0 || wa->read_cntpct_el0) in arch_timer_enable_workaround()
570 * out-of-line counter accessor. We may change our mind pretty in arch_timer_enable_workaround()
571 * late in the game (with a per-CPU erratum, for example), so in arch_timer_enable_workaround()
574 if (wa->read_cntvct_el0) { in arch_timer_enable_workaround()
577 } else if (wa->disable_compat_vdso && vdso_default != VDSO_CLOCKMODE_NONE) { in arch_timer_enable_workaround()
613 wa->desc, __wa->desc); in arch_timer_check_ool_workaround()
620 local ? "local" : "global", wa->desc); in arch_timer_check_ool_workaround()
647 evt->event_handler(evt); in timer_handler()
756 clk->features = CLOCK_EVT_FEAT_ONESHOT; in __arch_timer_setup()
759 typeof(clk->set_next_event) sne; in __arch_timer_setup()
764 clk->features |= CLOCK_EVT_FEAT_C3STOP; in __arch_timer_setup()
765 clk->name = "arch_sys_timer"; in __arch_timer_setup()
766 clk->rating = 450; in __arch_timer_setup()
767 clk->cpumask = cpumask_of(smp_processor_id()); in __arch_timer_setup()
768 clk->irq = arch_timer_ppi[arch_timer_uses_ppi]; in __arch_timer_setup()
771 clk->set_state_shutdown = arch_timer_shutdown_virt; in __arch_timer_setup()
772 clk->set_state_oneshot_stopped = arch_timer_shutdown_virt; in __arch_timer_setup()
778 clk->set_state_shutdown = arch_timer_shutdown_phys; in __arch_timer_setup()
779 clk->set_state_oneshot_stopped = arch_timer_shutdown_phys; in __arch_timer_setup()
786 clk->set_next_event = sne; in __arch_timer_setup()
788 clk->features |= CLOCK_EVT_FEAT_DYNIRQ; in __arch_timer_setup()
789 clk->name = "arch_mem_timer"; in __arch_timer_setup()
790 clk->rating = 400; in __arch_timer_setup()
791 clk->cpumask = cpu_possible_mask; in __arch_timer_setup()
793 clk->set_state_shutdown = arch_timer_shutdown_virt_mem; in __arch_timer_setup()
794 clk->set_state_oneshot_stopped = arch_timer_shutdown_virt_mem; in __arch_timer_setup()
795 clk->set_next_event = in __arch_timer_setup()
798 clk->set_state_shutdown = arch_timer_shutdown_phys_mem; in __arch_timer_setup()
799 clk->set_state_oneshot_stopped = arch_timer_shutdown_phys_mem; in __arch_timer_setup()
800 clk->set_next_event = in __arch_timer_setup()
805 clk->set_state_shutdown(clk); in __arch_timer_setup()
830 if (pos > 1 && !(evt_stream_div & (1 << (pos - 2)))) in arch_timer_configure_evtstream()
831 pos--; in arch_timer_configure_evtstream()
906 return -EINVAL; in validate_timer_rate()
915 * For historical reasons, when probing with DT we use whichever (non-zero)
917 * probed has a clock-frequency property, this overrides the HW register.
925 if (of_property_read_u32(np, "clock-frequency", &arch_timer_rate)) in arch_timer_of_configure_rate()
1028 pr_debug("disable IRQ%d cpu #%d\n", clk->irq, smp_processor_id()); in arch_timer_stop()
1034 clk->set_state_shutdown(clk); in arch_timer_stop()
1097 err = -ENOMEM; in arch_timer_register()
1168 return -ENOMEM; in arch_timer_mem_register()
1170 t->base = base; in arch_timer_mem_register()
1171 t->evt.irq = irq; in arch_timer_mem_register()
1172 __arch_timer_setup(ARCH_TIMER_TYPE_MEM, &t->evt); in arch_timer_mem_register()
1179 ret = request_irq(irq, func, IRQF_TIMER, "arch_mem_timer", &t->evt); in arch_timer_mem_register()
1189 { .compatible = "arm,armv7-timer", },
1190 { .compatible = "arm,armv8-timer", },
1195 { .compatible = "arm,armv7-timer-mem", },
1205 /* We have two timers, and both device-tree nodes are probed. */ in arch_timer_needs_of_probing()
1211 * check if we have another type of timer node in device-tree. in arch_timer_needs_of_probing()
1234 * arch_timer_select_ppi() - Select suitable PPI for the current system.
1291 arch_timer_c3stop = !of_property_read_bool(np, "always-on"); in arch_timer_of_init()
1301 of_property_read_bool(np, "arm,cpu-registers-not-fw-configured")) in arch_timer_of_init()
1308 return -EINVAL; in arch_timer_of_init()
1313 "arm,no-tick-in-suspend"); in arch_timer_of_init()
1324 TIMER_OF_DECLARE(armv7_arch_timer, "arm,armv7-timer", arch_timer_of_init);
1325 TIMER_OF_DECLARE(armv8_arch_timer, "arm,armv8-timer", arch_timer_of_init);
1333 base = ioremap(frame->cntbase, frame->size); in arch_timer_mem_frame_get_cntfrq()
1335 pr_err("Unable to map frame @ %pa\n", &frame->cntbase); in arch_timer_mem_frame_get_cntfrq()
1354 cntctlbase = ioremap(timer_mem->cntctlbase, timer_mem->size); in arch_timer_mem_find_best_frame()
1357 &timer_mem->cntctlbase); in arch_timer_mem_find_best_frame()
1371 frame = &timer_mem->frame[i]; in arch_timer_mem_find_best_frame()
1372 if (!frame->valid) in arch_timer_mem_find_best_frame()
1404 irq = frame->virt_irq; in arch_timer_mem_frame_register()
1406 irq = frame->phys_irq; in arch_timer_mem_frame_register()
1411 return -EINVAL; in arch_timer_mem_frame_register()
1414 if (!request_mem_region(frame->cntbase, frame->size, in arch_timer_mem_frame_register()
1416 return -EBUSY; in arch_timer_mem_frame_register()
1418 base = ioremap(frame->cntbase, frame->size); in arch_timer_mem_frame_register()
1421 return -ENXIO; in arch_timer_mem_frame_register()
1442 int ret = -EINVAL; in arch_timer_mem_of_init()
1447 return -ENOMEM; in arch_timer_mem_of_init()
1451 timer_mem->cntctlbase = res.start; in arch_timer_mem_of_init()
1452 timer_mem->size = resource_size(&res); in arch_timer_mem_of_init()
1458 if (of_property_read_u32(frame_node, "frame-number", &n)) { in arch_timer_mem_of_init()
1459 pr_err(FW_BUG "Missing frame-number.\n"); in arch_timer_mem_of_init()
1464 pr_err(FW_BUG "Wrong frame-number, only 0-%u are permitted.\n", in arch_timer_mem_of_init()
1465 ARCH_TIMER_MEM_MAX_FRAMES - 1); in arch_timer_mem_of_init()
1469 frame = &timer_mem->frame[n]; in arch_timer_mem_of_init()
1471 if (frame->valid) { in arch_timer_mem_of_init()
1472 pr_err(FW_BUG "Duplicated frame-number.\n"); in arch_timer_mem_of_init()
1481 frame->cntbase = res.start; in arch_timer_mem_of_init()
1482 frame->size = resource_size(&res); in arch_timer_mem_of_init()
1484 frame->virt_irq = irq_of_parse_and_map(frame_node, in arch_timer_mem_of_init()
1486 frame->phys_irq = irq_of_parse_and_map(frame_node, in arch_timer_mem_of_init()
1489 frame->valid = true; in arch_timer_mem_of_init()
1495 &timer_mem->cntctlbase); in arch_timer_mem_of_init()
1496 ret = -EINVAL; in arch_timer_mem_of_init()
1510 TIMER_OF_DECLARE(armv7_arch_timer_mem, "arm,armv7-timer-mem",
1522 frame = &timer_mem->frame[i]; in arch_timer_mem_verify_cntfrq()
1524 if (!frame->valid) in arch_timer_mem_verify_cntfrq()
1532 &frame->cntbase, in arch_timer_mem_verify_cntfrq()
1535 return -EINVAL; in arch_timer_mem_verify_cntfrq()
1550 return -ENOMEM; in arch_timer_mem_acpi_init()
1579 &timer->cntctlbase); in arch_timer_mem_acpi_init()
1589 /* Initialize per-processor generic timer and memory-mapped timer(if present) */
1596 return -EINVAL; in arch_timer_acpi_init()
1630 return -EINVAL; in arch_timer_acpi_init()
1633 /* Always-on capability */ in arch_timer_acpi_init()
1645 pr_err("Failed to initialize memory-mapped timer.\n"); in arch_timer_acpi_init()