Igor,
Here is the code that is executed before writing to the TCM:
void __iomem* m4rcr;
void __iomem* ccgr;
void __iomem* mem;
uint32_t m4_data;
struct m4loader_drv* m4_dev = to_m4loader_drv(filep);
m4_dev->current_buffer_index = 0;
if ((request_mem_region(0x3039000C, 32, "SRC_M4RCR")) == NULL)
{
dev_err(&m4_dev->pdev->dev, "Failed to get m4rcr region\n");
return -1;
}
m4rcr = ioremap_nocache(0x3039000C, 32);
m4_data = ioread8(m4rcr);
iowrite8(m4_data | (1 << 2), m4rcr);
dev_info(&m4_dev->pdev->dev, "Waiting for reset..\n");
while (m4_data & 0x04)
{
m4_data = ioread8(m4rcr);
}
dev_info(&m4_dev->pdev->dev, "Reset Finished\n");
iounmap(m4rcr);
release_mem_region(0x3039000C, 32);
if ((request_mem_region(0x30384014, 32, "CCM_CCGR1")) == NULL)
{
dev_err(&m4_dev->pdev->dev, "Failed to get CCM_CCGR3 region\n");
return -1;
}
ccgr = ioremap_nocache(0x30384014, 32);
m4_data = ioread16(ccgr);
printk(KERN_INFO "Read 0x%08x from CCGR1", m4_data);
iowrite16(m4_data | (0x3), ccgr);
dev_info(&m4_dev->pdev->dev, "Starting M4 clock...\n");
m4_data = ioread16(ccgr);
printk(KERN_INFO "Read 0x%08x from CCGR1", m4_data);
if ((m4_data & 0x3) != 0x3)
{
dev_err(&m4_dev->pdev->dev, "Unable to start M4 clock...\n");
return -EIO;
}
iounmap(ccgr);
release_mem_region(0x30384014, 32);
return 0;
I have found that with clk_unused_ignore and just calling bootaux on the tcm in uboot allows the write to TCM to work.
Any idea which clocks I need to enable in arch/arm/mach-imx/clk-imx7d.c that would allow linux to properly configure the
system without uboot being involved?