Hi,
--- Quote Start ---
But the new confusion was that nothing appeared on the screen and Nano-X seemed running correctly:
/# nano-X &
686 nano-X
/# nanowm &
687 nanowm
/# nxclock &
688 nxclock
--- Quote End ---
Have you revised that the all DMA descriptors use physical addresses? For example,
} __attribute__ ((packed)) sgdma_desc;
# include <asm/cacheflush.h> // <-- to use 'flush_cache_all()'
static int altfb_dma_start(unsigned long start, unsigned long len)
{
unsigned long base =
(unsigned long)ioremap(SGDMABASE, ALTERA_SGDMA_IO_EXTENT);
sgdma_desc *desc, *desc1;
int ndesc = (len + DISPLAY_BYTES_PER_DESC - 1) / DISPLAY_BYTES_PER_DESC;
int ndesc_size = sizeof(sgdma_desc) * ndesc;
int i;
writel(ALTERA_SGDMA_CONTROL_SOFTWARERESET_MSK,
base + ALTERA_SGDMA_CONTROL); /* halt current transfer */
writel(0, base + ALTERA_SGDMA_CONTROL); /* disable interrupts */
writel(0xff, base + ALTERA_SGDMA_STATUS); /* clear status */
/* assume cache line size is 32, which is required by sgdma desc */
desc1 = kzalloc(ndesc_size, GFP_KERNEL);
if (desc1 == NULL)
return -ENOMEM;
// desc1 = ioremap((unsigned long)desc1, ndesc_size);
for (i = 0, desc = desc1; i < ndesc; i++, desc++) {
unsigned ctrl = ALTERA_SGDMA_DESCRIPTOR_CONTROL_OWNED_BY_HW_MSK;
desc->read_addr = (void *)start;
if (i == (ndesc - 1)) {
// desc->next = (void *)desc1;
desc->next = (void *)virt_to_phys(desc1);
desc->bytes_to_transfer = len;
ctrl |=
ALTERA_SGDMA_DESCRIPTOR_CONTROL_GENERATE_EOP_MSK;
} else {
// desc->next = (void *)(desc + 1);
desc->next = (void *)virt_to_phys((desc + 1));
desc->bytes_to_transfer = DISPLAY_BYTES_PER_DESC;
}
if (i == 0)
ctrl |=
ALTERA_SGDMA_DESCRIPTOR_CONTROL_GENERATE_SOP_MSK;
desc->control = ctrl;
start += DISPLAY_BYTES_PER_DESC;
len -= DISPLAY_BYTES_PER_DESC;
}
// writel((unsigned long)desc1, base + ALTERA_SGDMA_NEXT_DESC_POINTER);
writel(((unsigned long)virt_to_phys(desc1)), base + ALTERA_SGDMA_NEXT_DESC_POINTER);
writel(ALTERA_SGDMA_CONTROL_RUN_MSK | ALTERA_SGDMA_CONTROL_PARK_MSK,
base + ALTERA_SGDMA_CONTROL); /* start */
flush_cache_all(); // <- To flush descriptors from the cache. Indeed, it's enough to flush the D-cache.
return 0;
}# else
static int altfb_dma_start(unsigned long start, unsigned long len)
Kazu