Skip to content

Commit fb8fa94

Browse files
Manjunathappa, Prakashschandinat
authored andcommitted
video: da8xx-fb: configure FIFO threshold to reduce underflow errors
Patch works around the below silicon errata: During LCDC initialization, there is the potential for a FIFO underflow condition to occur. A FIFO underflow condition occurs when the input FIFO is completely empty and the LCDC raster controller logic that drives data to the output pins attempts to fetch data from the FIFO. When a FIFO underflow condition occurs, incorrect data will be driven out on the LCDC data pins. Software should poll the FUF bit field in the LCD_STAT register to check if an error condition has occurred or service the interrupt if FUF_EN is enabled when FUF occurs. If the FUF bit field has been set to 1, this will indicate an underflow condition has occurred and then the software should execute a reset of the LCDC via the LPSC. This problem may occur if the LCDC FIFO threshold size (LCDDMA_CTRL[TH_FIFO_READY]) is left at its default value after reset. Increasing the FIFO threshold size will reduce or eliminate underflows. Setting the threshold size to 256 double words or larger is recommended. Above issue is described in section 2.1.3 of silicon errata http://www.ti.com/lit/er/sprz313e/sprz313e.pdf Signed-off-by: Rajashekhara, Sudhakar <sudhakar.raj@ti.com> Signed-off-by: Manjunathappa, Prakash <prakash.pm@ti.com> Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
1 parent deb95c6 commit fb8fa94

2 files changed

Lines changed: 10 additions & 4 deletions

File tree

‎drivers/video/da8xx-fb.c‎

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -353,8 +353,8 @@ static void lcd_blit(int load_mode, struct da8xx_fb_par *par)
353353
lcd_enable_raster();
354354
}
355355

356-
/* Configure the Burst Size of DMA */
357-
static int lcd_cfg_dma(int burst_size)
356+
/* Configure the Burst Size and fifo threhold of DMA */
357+
static int lcd_cfg_dma(int burst_size, int fifo_th)
358358
{
359359
u32 reg;
360360

@@ -378,6 +378,9 @@ static int lcd_cfg_dma(int burst_size)
378378
default:
379379
return -EINVAL;
380380
}
381+
382+
reg |= (fifo_th << 8);
383+
381384
lcdc_write(reg, LCD_DMA_CTRL_REG);
382385

383386
return 0;
@@ -679,8 +682,8 @@ static int lcd_init(struct da8xx_fb_par *par, const struct lcd_ctrl_config *cfg,
679682
lcdc_write((lcdc_read(LCD_RASTER_TIMING_2_REG) &
680683
~LCD_INVERT_PIXEL_CLOCK), LCD_RASTER_TIMING_2_REG);
681684

682-
/* Configure the DMA burst size. */
683-
ret = lcd_cfg_dma(cfg->dma_burst_sz);
685+
/* Configure the DMA burst size and fifo threshold. */
686+
ret = lcd_cfg_dma(cfg->dma_burst_sz, cfg->fifo_th);
684687
if (ret < 0)
685688
return ret;
686689

‎include/video/da8xx-fb.h‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,9 @@ struct lcd_ctrl_config {
8282

8383
/* Raster Data Order Select: 1=Most-to-least 0=Least-to-most */
8484
unsigned char raster_order;
85+
86+
/* DMA FIFO threshold */
87+
int fifo_th;
8588
};
8689

8790
struct lcd_sync_arg {

0 commit comments

Comments
 (0)