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:计时器寄存器地址

Guru**** 2935160 points
请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/processors-group/processors/f/processors-forum/672048/linux-am3358-timer-register-address

器件型号:AM3358

工具/软件:Linux

根据  

TI-processor-sdk-linux-am335x-evm-02.00.02.1111\board-support\linux-4.1.18+gitAUTOINC+be8cfc1da-gbbe8cfc\arch\arm\plat-omap\include\plat\dmtimer.h define、  


struct timer_regs{
u32 tidr;
u32层;
u32二进制;
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;
};

TCLK 偏移应该为0x24、但是根据 TRM、它是0x38h。

出什么问题了?

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
    您好、Tony、

    TCLR 寄存器地址定义没有错误。 让我们关注../arch/arm/plat-omap/include/plat/dmtimer.h 中的注释:
    /*
    *功能寄存器在 v1和 v2 IP 上具有不同的基址。
    *这些寄存器是来自 timer ->func_base 的偏移量。 func_base
    *对于 v1、Samae 作为 IO_BASE;对于 v2 IP、IO_BASE + 0x14。
    *
    因此、0x14被添加到 v2的 IO_BASE 中、其定义如下:
    #define OMAP-TIMER_V2_FUNC_OFFSET0x14

    这个宏参与了定时器->func_base 的地址计算:

    timer->func_base = timer->io_BASE + OMAP_timer_V2_FUNC_offset

    因此、TCLR 地址寄存器的实际偏移量为0x24 + 0x14 = 0x38、如表20-10中所述。

    BR
    Tsvetolin Shulev