This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Linux/AM3358: Timer register address

Part Number: AM3358

Tool/software: Linux

According to 

ti-processor-sdk-linux-am335x-evm-02.00.02.11\board-support\linux-4.1.18+gitAUTOINC+bbe8cfc1da-gbbe8cfc\arch\arm\plat-omap\include\plat\dmtimer.h define, 


struct timer_regs {
u32 tidr;
u32 tier;
u32 twer;
u32 tclr;
u32 tcrr;
u32 tldr;
u32 ttrg;
u32 twps;
u32 tmar;
u32 tcar1;
u32 tsicr;
u32 tcar2;
u32 tpir;
u32 tnir;
u32 tcvr;
u32 tocr;
u32 towr;
};

The TCLK offset should be 0x24, but according to TRM, it is 0x38h.

What is wrong?

  • Hi Tony,

    There is no mistake with TCLR register address define. Let's focus on the comments in ../arch/arm/plat-omap/include/plat/dmtimer.h :
    /*
    * The functional registers have a different base on v1 and v2 ip.
    * These registers are offsets from timer->func_base. The func_base
    * is samae as io_base for v1 and io_base + 0x14 for v2 ip.
    */
    So 0x14 is added to io_base for v2 which is defined as:
    #define OMAP_TIMER_V2_FUNC_OFFSET 0x14

    and this macro participates in address calculation of timer->func_base:

    timer->func_base = timer->io_base + OMAP_TIMER_V2_FUNC_OFFSET

    Therefore the real offset of TCLR address register is 0x24 + 0x14 = 0x38 as it is described in table 20-10.

    BR
    Tsvetolin Shulev