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.

4460 rom functions call

Good morning
I want to call ROM functions and I applied the example from Technical Reference Manual but the linker return errors.
I use Compiler version TI v5.0.1
With this command line:
Compiler:

--code_state=32 --abi=ti_arm9_abi -me -g --include_path="C:/ti/ccsv5/tools/compiler/arm_5.0.1/include" --include_path="C:/SDK/lib" --include_path="C:/SDK/platform/omap4/board/pandaboardes" --include_path="C:/SDK/platform/omap4" --rtti --gcc --diag_warning=225 --display_error_number -k

Linker:
--code_state=32 --abi=ti_arm9_abi -me -g --rtti --gcc --diag_warning=225 --display_error_number -k -z --stack_size=0x800 -m"SDK_Probe_OMAP4.map" --heap_size=0x800 -i"C:/ti/ccsv5/tools/compiler/arm_5.0.1/lib" -i"C:/SDK_Probe_OMAP4" -i"C:/ti/ccsv5/tools/compiler/arm_5.0.1/include" --reread_libs --warn_sections --display_error_number --ram_model

Return :


**** Build of configuration Debug for project SDK_Probe_OMAP4 ****

"C:\\ti\\ccsv5\\utils\\bin\\gmake" -k all
'Building file: ../main.c'
'Invoking: ARM Compiler'
"C:/ti/ccsv5/tools/compiler/arm_5.0.1/bin/armcl" --code_state=32 --abi=ti_arm9_abi -me -g --include_path="C:/ti/ccsv5/tools/compiler/arm_5.0.1/include" --include_path="C:/SDK/lib" --include_path="C:/SDK/platform/omap4/board/pandaboardes" --include_path="C:/SDK/platform/omap4" --rtti --gcc --diag_warning=225 --display_error_number -k --preproc_with_compile --preproc_dependency="main.pp"  "../main.c"
"main.asm", ERROR!   at line 111: [E0004] Illegal operand
        LDR r12, #0x101

"main.asm", ERROR!   at line 112: [E0002] Illegal mnemonic specified
        SMC 0x1

2 Assembly Errors, No Assembly Warnings

Errors in Source - Assembler Aborted

>> Compilation failure
gmake: *** [main.obj] Error 1
gmake: Target `all' not remade because of errors.

**** Build Finished ****

I use this function for example:

__asm("    .sect \".text:hlos_cache_clean_invalidate_range\"\n"
    "    .clink\n"
    "    .global hlos_cache_clean_invalidate_range\n"
    "hlos_cache_clean_invalidate_range:\n"
    "    PUSH {R1-R12, LR}\n"
    "    LDR r12, #0x101\n"
    "    SMC 0x1\n"
    "    PUSH {R1-R12, PC}\n"
    "    bx      lr");

or:

void hlos_cache_clean_invalidate_range()
{
    asm("    PUSH {R1-R12, LR}\n\t"
        "    LDR r12, #0x101\n\t"
        "    SMC 0x1\n\t"
        "    PUSH {R1-R12, PC}");
}

How to call ROM functions?
I want to enable and use the PL310 cache controller.

Thank you very much.

  • Iulian,

    I recommend that you look at the kernel source code for a Linux/Android release on OMAP4, such as: http://www.omappedia.com/wiki/4AI.1.7_OMAP4_Icecream_Sandwich_Release_Notes

    You can find ROM code calls for enabling the PL310 cache controller, which you can use as an example, in the files:

    • arch/arm/mm/cache-l2x0.c
    • include/asm/arch-omap4/rom_hal_api.h
    • cpu/omap4/cpu.c

    Regards,
    Gina