Using generic timer on LS1043ARBD

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Using generic timer on LS1043ARBD

1,301 Views
josillan
Contributor I

Hi,

I want to use ARM generic timer for triggering interrupt after a certain period but I'm having difficulties understanding how to set it up.  First of all it seems that there is no support for accessing the CompareValue registers (in arch/arm64/include/asm/arch_timer.h) so I guess I have to use the TimeValue view (TVAL) register? Another thing is that apparently Linux is using the non-secure physical counter so I should probaply use the virtual counters?  Now, if I configure the CNTV_TVAL_EL0, Counter-timer Virtual Timer TimerValue register it should trigger interrupt in GIC 27, right? If I check the /proc/interrupts there are only lines GIC 29 and 30 for arch_timer which means (to my understanding) that they are used by the arch_timer driver. Now, should the interrupt from Virtual timer counter be visible in /proc/stat or do I have to do some tricks to enable/unmask it?

Tags (2)
0 Kudos
1 Reply

790 Views
Pavel
NXP Employee
NXP Employee

For example there is the following on the LS1043ARDB board using SDK 2.0.

root@ls1043ardb:~# cat /proc/interrupts

           CPU0       CPU1

  1:          0          0       GIC  29 Edge      arch_timer

  2:        753        789       GIC  30 Edge      arch_timer

  3:          0          0       GIC  27 Edge      kvm guest timer

  9:          0          0       GIC  25 Edge      vgic

 10:          9          0       GIC  75 Level     fsl-ifc

 11:        365          0       GIC  94 Level     mmc0

 12:          0          0       GIC  77 Level     bman-err, qman-err, fman-err

 13:          0          0       GIC  76 Level     fman

 15:         14          0       GIC  96 Level     2100000.dspi

 16:          0          0       GIC  88 Level     2180000.i2c

 17:        452          0       GIC  86 Level     serial

 26:          0          0       GIC  92 Level     xhci-hcd:usb1

 27:          0          0       GIC  93 Level     xhci-hcd:usb3

 28:          1          0       GIC  95 Level     xhci-hcd:usb5

 29:          0          0       GIC 101 Level     3200000.sata

 32:          0          0       GIC 148 Level     MSI1

 33:          0          0       GIC 158 Level     MSI2

 34:          0          0       GIC 192 Level     MSI3

 36:          0          0       GIC 159 Level     ls-pcie-pme

 38:          0          0       GIC 193 Level     ls-pcie-pme

 46:          0          0       GIC 218 Level     QMan portal 1

 47:          0          0       GIC 220 Level     QMan portal 0

 55:          0          0       GIC 219 Level     BMan portal 1

 56:          0          0       GIC 221 Level     BMan portal 0

 58:          0          0      MSI2   0 Edge      PCIe PME, aerdrv

 60:          0          0      MSI3   0 Edge      PCIe PME, aerdrv

IPI0:       793       1376       Rescheduling interrupts

IPI1:        44         33       Function call interrupts

IPI2:         0          0       CPU stop interrupts

IPI3:         0          0       Timer broadcast interrupts

IPI4:         0          0       IRQ work interrupts

Err:          0

root@ls1043ardb:~#

 

There is the following information from SDK 2.0 documentation:

Linux Kernel Core, Virtualization

  • Linux kernel 4.1.8
  • ARMv8: AARCH64, 64-bit effective addressing, Little Endian (default), Multicore SMP, Huge Pages (hugetlbfs), Kernelbased Virtual Machine (KVM), Libvirt, Linux Containers (LXC), Docker Engine

Linux Kernel Drivers

  • LS1043A: CEETM, Crypto via SEC 5, DSPI, DPAA Networking, eDMA, eSDHC, Flextimer, GIC-400, I2C, IEEE1588, IFC NOR & NAND, MDIO, PCIE, Power Management: CPU Idle, Device Frequency Scaling (DFS), CPU Hotplug (PW15), Thermal Monitor (TMU), QDMA, QE TDM, SATA, SMMU, USB 2.0 & 3.0, UART, Watchdog timer


Have a great day,
Pavel Chubakov

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos