u-boot/drivers
Nishanth Menon ea3f534806 remoteproc: ti_k3_arm64: Program CNTFID0 register in GTC
ARMv8's generic timer[1] picks up it's graycode from GTC. However,
the frequency of the GTC is supposed to be programmed in CNTFID0[2]
register prior to enabling the GTC in CNTCR[3] register.

In K3 architecture, GTC provides a central time to many parts of the
SoC including graycode to the generic timer in the ARMv8 subsystem.
However, due to the central nature and the need to enable the counter
early in the boot process, the R5 based u-boot enables GTC and
programs it's frequency based on central needs of the system. This
may not be a constant 200MHz based on the system. The bootloader is
supposed to program the FID0 register with the correct frequency it
has sourced for GTC from the central system controller OR from PLLs
as appropriate, and TF-A is supposed[4] to use that as the frequency for
it's local timer.

Currently we are programming just the CNTCR[3] register to enable the
GTC, however we dont let TF-A know the frequency that GTC is actually
running at. A mismatch in programmed frequency and what we program for
generic timer will, as we can imagine, all kind of weird mayhem.

So, program the CNTFID0 register with the clock frequency. Note:
assigned-clock-rates should have set the clock frequency, so the only
operation we need to explicitly do is to retrieve the frequency and
program it in FID0 register.

Since the valid in K3 for GTC clock frequencies are < U32_MAX, we can
just cast the ulong and continue.

[1] https://developer.arm.com/documentation/100095/0002/generic-timer/generic-timer-register-summary/aarch64-generic-timer-register-summary
[2] https://developer.arm.com/docs/ddi0595/h/external-system-registers/cntfid0
[3] https://developer.arm.com/docs/ddi0595/h/external-system-registers/cntcr
[4] 6a22d9ea3c

Signed-off-by: Nishanth Menon <nm@ti.com>
2021-01-12 10:59:04 +05:30
..
adc dm: treewide: Rename ..._platdata variables to just ..._plat 2020-12-13 16:51:09 -07:00
ata dm: core: Access device ofnode through functions 2021-01-05 12:24:41 -07:00
axi dm: treewide: Rename auto_alloc_size members to be shorter 2020-12-13 08:00:25 -07:00
bios_emulator common: Drop linux/delay.h from common header 2020-05-18 21:19:23 -04:00
block dm: treewide: Rename dev_get_platdata() to dev_get_plat() 2020-12-13 16:51:09 -07:00
bootcount dm: treewide: Rename auto_alloc_size members to be shorter 2020-12-13 08:00:25 -07:00
bus bus: ti: am33xx: add pwm subsystem driver 2021-01-12 10:58:05 +05:30
button dm: treewide: Rename 'platdata' variables to just 'plat' 2020-12-13 16:51:08 -07:00
cache dm: treewide: Rename ofdata_to_platdata() to of_to_plat() 2020-12-13 16:51:09 -07:00
clk clk: move clk-ti-sci driver to 'ti' directory 2021-01-12 10:58:05 +05:30
core dm: core: add a function to decode display timings 2021-01-12 10:58:05 +05:30
cpu dm: treewide: Rename ..._platdata variables to just ..._plat 2020-12-13 16:51:09 -07:00
crypto dm: Rename U_BOOT_DEVICE() to U_BOOT_DRVINFO() 2021-01-05 12:26:35 -07:00
ddr Driver model: make some udevice fields private 2021-01-05 22:34:43 -05:00
demo dm: Rename U_BOOT_DEVICE() to U_BOOT_DRVINFO() 2021-01-05 12:26:35 -07:00
dfu dfu_mtd: Add provision to unlock mtd device 2020-12-31 14:41:31 +01:00
dma dm: treewide: Rename ofdata_to_platdata() to of_to_plat() 2020-12-13 16:51:09 -07:00
fastboot fastboot: getvar: fix partition-size return value 2020-09-01 14:47:43 +02:00
firmware dm: Rename DM_GET_DRIVER() to DM_DRIVER_GET() 2021-01-05 12:26:35 -07:00
fpga arm: socfpga: agilex: Enable FPGA Full Reconfiguration support 2020-10-09 17:53:12 +08:00
gpio gpio: tca642x: fix input subcommand for gpio banks > 0 2021-01-12 10:21:41 +05:30
hwspinlock dm: treewide: Rename auto_alloc_size members to be shorter 2020-12-13 08:00:25 -07:00
i2c Driver model: make some udevice fields private 2021-01-05 22:34:43 -05:00
input dm: treewide: Rename auto_alloc_size members to be shorter 2020-12-13 08:00:25 -07:00
led dm: treewide: Rename ..._platdata variables to just ..._plat 2020-12-13 16:51:09 -07:00
mailbox dm: treewide: Rename auto_alloc_size members to be shorter 2020-12-13 08:00:25 -07:00
memory dm: treewide: Rename auto_alloc_size members to be shorter 2020-12-13 08:00:25 -07:00
misc Driver model: make some udevice fields private 2021-01-05 22:34:43 -05:00
mmc Driver model: make some udevice fields private 2021-01-05 22:34:43 -05:00
mtd Xilinx changes for v2021.04 2021-01-06 07:57:33 -05:00
mux dm: Use access methods for dev/uclass private data 2021-01-05 12:24:40 -07:00
net Driver model: make some udevice fields private 2021-01-05 22:34:43 -05:00
nvme Prepare v2021.01-rc5 2021-01-05 16:20:26 -05:00
pch dm: treewide: Rename auto_alloc_size members to be shorter 2020-12-13 08:00:25 -07:00
pci Driver model: make some udevice fields private 2021-01-05 22:34:43 -05:00
pci_endpoint dm: treewide: Rename auto_alloc_size members to be shorter 2020-12-13 08:00:25 -07:00
phy Driver model: make some udevice fields private 2021-01-05 22:34:43 -05:00
pinctrl Driver model: make some udevice fields private 2021-01-05 22:34:43 -05:00
power Driver model: make some udevice fields private 2021-01-05 22:34:43 -05:00
pwm pwm: ti: am33xx: add enhanced pwm driver 2021-01-12 10:58:05 +05:30
qe net, qe: add DM support for QE UEC ethernet 2020-09-17 06:09:53 +02:00
ram dm: treewide: Rename ..._platdata variables to just ..._plat 2020-12-13 16:51:09 -07:00
remoteproc remoteproc: ti_k3_arm64: Program CNTFID0 register in GTC 2021-01-12 10:59:04 +05:30
reset Driver model: make some udevice fields private 2021-01-05 22:34:43 -05:00
rng dm: treewide: Rename ..._platdata variables to just ..._plat 2020-12-13 16:51:09 -07:00
rtc dm: Rename U_BOOT_DEVICE() to U_BOOT_DRVINFO() 2021-01-05 12:26:35 -07:00
scsi dm: treewide: Rename ..._platdata variables to just ..._plat 2020-12-13 16:51:09 -07:00
serial Xilinx changes for v2021.04 2021-01-06 07:57:33 -05:00
smem soc: qualcomm: Fix not calling dev_err with a device 2020-09-30 08:53:43 -04:00
soc dm: treewide: Rename ..._platdata variables to just ..._plat 2020-12-13 16:51:09 -07:00
sound dm: treewide: Rename ..._platdata variables to just ..._plat 2020-12-13 16:51:09 -07:00
spi spi: omap3_spi: Fix speed and mode selection 2021-01-12 10:21:41 +05:30
spmi dm: treewide: Rename auto_alloc_size members to be shorter 2020-12-13 08:00:25 -07:00
sysinfo dm: treewide: Rename auto_alloc_size members to be shorter 2020-12-13 08:00:25 -07:00
sysreset Driver model: make some udevice fields private 2021-01-05 22:34:43 -05:00
tee dm: core: Access device ofnode through functions 2021-01-05 12:24:41 -07:00
thermal dm: treewide: Rename ofdata_to_platdata() to of_to_plat() 2020-12-13 16:51:09 -07:00
timer omap: timer: fix the rate setting 2021-01-12 10:58:05 +05:30
tpm dm: treewide: Rename ofdata_to_platdata() to of_to_plat() 2020-12-13 16:51:09 -07:00
ufs dm: treewide: Rename ..._platdata variables to just ..._plat 2020-12-13 16:51:09 -07:00
usb Driver model: make some udevice fields private 2021-01-05 22:34:43 -05:00
video video: omap: move drivers to 'ti' directory 2021-01-12 10:59:04 +05:30
virtio dm: Avoid accessing seq directly 2020-12-18 20:32:21 -07:00
w1 dm: treewide: Rename ofdata_to_platdata() to of_to_plat() 2020-12-13 16:51:09 -07:00
w1-eeprom dm: treewide: Rename 'platdata' variables to just 'plat' 2020-12-13 16:51:08 -07:00
watchdog Prepare v2021.01-rc5 2021-01-05 16:20:26 -05:00
xen dm: treewide: Rename ..._platdata variables to just ..._plat 2020-12-13 16:51:09 -07:00
Kconfig board: Rename uclass to sysinfo 2020-11-06 10:18:20 +08:00
Makefile board: Rename uclass to sysinfo 2020-11-06 10:18:20 +08:00