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:am3358 outer_cache.clean_range is NULL

Part Number: AM3358


Tool/software: Linux

In linux 4.1.18 for am3358, 
the dma_map_single will call the function outer_clean_range to clean cache for "DMA_TO_DEVICE",
but source of outer_clean_range is :
static inline void outer_clean_range(phys_addr_t start, phys_addr_t end)
{
 if (outer_cache.clean_range) 
  outer_cache.clean_range(start, end);
}

But,  outer_cache.clean_range  is NULL .

the  l2x0_init in cache-l2x0.c,  will to initilize the  outer_cache, but I can not see any caller to call l2x0_init for am3358.

How to init the cache function for am3358 ?
Thank you.

  • Hi Edward,

    Do you use AM335x TI PSDK Linux? If yes, which version?

    Regards,
    Pavel
  • hi, we  use the sdk and kernel is :

    ti-processor-sdk-linux-am335x-evm-02.00.02.11/board-support/linux-4.1.18+gitAUTOINC+bbe8cfc1da-gbbe8cfc

  • hello  Pavel !

    SDK version 02_00_02_11
    linux kernel version 4.1.18-gbbe8cfc
    SDK download page software-dl.ti.com/.../index_FDS.html

  • Hi ,Pavel

    when use the spi driver for big data transfer,
    we found that: there is problem in DMA coherence between cache and ddr.

    In the machine desc in arch/arm/mach-omap2/board-generic.c, there isn't ".l2c_aux_val" or ".l2c_aux_mask":

    static const char *const am33xx_boards_compat[] __initconst = {
    "ti,am33xx",
    NULL,
    };

    DT_MACHINE_START(AM33XX_DT, "Generic AM33XX (Flattened Device Tree)")
    .reserve = omap_reserve,
    .map_io = am33xx_map_io,
    .init_early = am33xx_init_early,
    .init_machine = omap_generic_init,
    .init_late = am33xx_init_late,
    .init_time = omap3_gptimer_timer_init,
    .dt_compat = am33xx_boards_compat,
    .restart = am33xx_restart,
    MACHINE_END

    So, in arch/arm/kernel/irq.c, it will not call l2x0_of_init to initialize outer_cache :
    void __init init_IRQ(void)
    {
    int ret;

    if (IS_ENABLED(CONFIG_OF) && !machine_desc->init_irq)
    irqchip_init();
    else
    machine_desc->init_irq();

    if (IS_ENABLED(CONFIG_OF) && IS_ENABLED(CONFIG_CACHE_L2X0) &&
    (machine_desc->l2c_aux_mask || machine_desc->l2c_aux_val)) {
    if (!outer_cache.write_sec)
    outer_cache.write_sec = machine_desc->l2c_write_sec;
    ret = l2x0_of_init(machine_desc->l2c_aux_val,
    machine_desc->l2c_aux_mask);
    if (ret)
    pr_err("L2C: failed to init: %d\n", ret);
    }
    }

    The questions are:
    1. How to set machine desc's ".l2c_aux_val" and ".l2c_aux_mask" ?
    2. In l2x0_of_init, it needs device tree node to initialize l2x0_base and so on,
    How to create the device tree node for that ?

    Regards,
    Edward

  • Edward,

    From what I was able to find in TRMs and linux kernel files, I can state that L2C and L2X0 are not valid for AM335x Cortex-A8 device, but for AM437x and OMAP4 Cortex-A9 devices.

    L2C is L2 Cache Controller PL310. See below pointers for more info:

    AM437x TRM, section 3.3.1.2 PL310 l2 Cache Controller

    e2e.ti.com/.../455155

    Regards,
    Pavel