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.

AM3359 McASP config address different to TRM

I trying to debug a Linux davinci-mcasp sound driver on a BeagleBoneBlack. I want to set a breakpoint whenever any of the McASP registers is accessed. The AM335x TRM shows the McASP Config registers at 0x48038000 through 0x48039FFF. However, when I step through the davinci-mcasp driver, it is accessing these registers at 0xFA038000 through 0xFA039FFF. Can anyone explain why the discrepancy between the TRM and what I'm seeing when I single step through the driver? 

Regards,

John

  • John,

    CCS will use virtual addresses that the linux kernel has set up, so when you use the memory browser the addresses in the TRM will have an offset.

    You can find more detail on this in our CCS linux kernel debug lab at step 16:

    http://processors.wiki.ti.com/index.php/Sitara_Linux_Training:_uboot_linux_debug_with_ccsv5#Perform_Linux_Kernel_Debug

    Regards,

    Josh

  • HI Josh,

    Thank you. Thank is exactly the info I needed. 

    Thank you again,

    John

  • Hi Josh,

    After a little more research, I found the following:

    In Linux Kernel v3.8, the files are different:

    arch/arm/mach-omap2/iomap.h 

    line 36

    #define OMAP2_L4_IO_OFFSET 0xb2000000

    line 109

    #define L4_34XX_VIRT (L4_34XX_PHYS + OMAP2_L4_IO_OFFSET) 

    Reading the document you referenced, it is not clear why there is a virtual address in the Linux kernel when accessing hardware registers? My guess is that different TI processors map the same peripherals at different addresses and the virtual address is used to abstract away these differences. Is this correct, or is there some other reason not to use the base address?

    Regards,

    John

  • Hi John,

    The actual addresses of the registers are not used in linux because of  the Memory Management Unit; all physical addresses will be translated into virtual addresses when you access them while linux is running.

    Josh

  • HI Josh,

    Yeah, I get that, but that wasn't my question. I was wondering why TI choose to map the peripheral physical addresses to virtual addresses in Linux. Was this to abstract away the family of TI processor memory map differences?

    Regards,

    John

  • It's not to abstract the family of TI processor. ARM Linux has a standard memory map. If you look in your kernel tree source in Documentation/arm/memory.txt you will see the memory map layout. If I remember correctly, the peripheral registers are mapped in VMALLOC_START to VMALLOC_END-1 (which ix 0xFF000000). You can also see the memory mapping when you boot a kernel. The console will show

    [    0.000000] Virtual kernel memory layout:
    [    0.000000]     vector  : 0xffff0000 - 0xffff1000   (   4 kB)
    [    0.000000]     fixmap  : 0xfff00000 - 0xfffe0000   ( 896 kB)
    [    0.000000]     vmalloc : 0xf0000000 - 0xff000000   ( 240 MB)
    [    0.000000]     lowmem  : 0xc0000000 - 0xef800000   ( 760 MB)
    [    0.000000]     pkmap   : 0xbfe00000 - 0xc0000000   (   2 MB)
    [    0.000000]     modules : 0xbf000000 - 0xbfe00000   (  14 MB)
    [    0.000000]       .text : 0xc0008000 - 0xc0786ce8   (7676 kB)
    [    0.000000]       .init : 0xc0787000 - 0xc07df380   ( 353 kB)
    [    0.000000]       .data : 0xc07e0000 - 0xc086e980   ( 571 kB)
    [    0.000000]        .bss : 0xc086e98c - 0xc08abfec   ( 246 kB)

    Steve K.