/* * If PSCI is available then most likely we are running on PSCI-enabled * U-Boot which, we assume, has already taken care of resetting CNTVOFF * and updating counter module before switching to non-secure mode * and we don't need to.
*/ #ifdef CONFIG_ARM_PSCI_FW if (psci_ops.cpu_on)
need_update = false; #endif
if (need_update == false) goto skip_update;
secure_cntvoff_init();
if (of_machine_is_compatible("renesas,r8a7745") ||
of_machine_is_compatible("renesas,r8a77470") ||
of_machine_is_compatible("renesas,r8a7792") ||
of_machine_is_compatible("renesas,r8a7794")) {
freq = 260000000 / 8; /* ZS / 8 */
} else { /* At Linux boot time the r8a7790 arch timer comes up * with the counter disabled. Moreover, it may also report * a potentially incorrect fixed 13 MHz frequency. To be * correct these registers need to be updated to use the * frequency EXTAL / 2.
*/
freq = get_extal_freq() / 2;
}
/* Remap "armgcnt address map" space */
base = ioremap(0xe6080000, PAGE_SIZE);
/* * Update the timer if it is either not running, or is not at the * right frequency. The timer is only configurable in secure mode * so this avoids an abort if the loader started the timer and * entered the kernel in non-secure mode.
*/
if ((ioread32(base + CNTCR) & 1) == 0 ||
ioread32(base + CNTFID0) != freq) { /* Update registers with correct frequency */
iowrite32(freq, base + CNTFID0); asmvolatile("mcr p15, 0, %0, c14, c0, 0" : : "r" (freq));
/* make sure arch timer is started by setting bit 0 of CNTCR */
iowrite32(1, base + CNTCR);
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.