Solution for AM335x U-Boot LCD Driver Failure at 1280x800 Resolution


1. Problem Description

When displaying images using U-Boot on the AM335x, resolutions like 800x480 and 1024x600 work fine. However, at 1280x800 resolution, images fail to display.

uboot-logo-570x570.png

Figure 1 uboot logo


2. Analysis Method


2.1 Waveform Testing

First, test the waveform with the same parameters set in both the kernel and U-Boot:


    #define WIDTH 1280

    #define HEIGHT 800

    #define HFP 200

    #define HBP 46

    #define HSW 40

    #define VFP 40

    #define VBP 3

    #define VSW 20

    #define FRESH_HZ 40


    .width = WIDTH,

    .height = HEIGHT,

    .hfp = HFP,

    .hbp = HBP,

    .hsw = HSW,

    .vfp = VFP,

    .vbp = VBP,

    .vsw = VSW,

    .pxl_clk = (WIDTH+HFP+HBP+HSW)*(HEIGHT+VFP+VBP+VSW)*FRESH_HZ,


2.2 Kernel Waveform Results

At 1280x800 resolution, the kernel produces the following waveform frequencies:


    pclk: 64 MHz

    vsync: 47 Hz

    hsync: 40 kHz

    ac_bias: 38 kHz

    lcd_data0: ~3 MHz

    lcd_data1: ~2.5 MHz


2.3 U-Boot Waveform Results

At 1280x800 resolution, the waveform frequencies in U-Boot are:

    pclk: 64 MHz (same as kernel)

    vsync: 140 Hz (kernel: 47 Hz)

    hsync: 118 kHz (kernel: 40 kHz)

    ac_bias: 112 kHz (kernel: 38 kHz)

    lcd_data0: ~1.8 MHz (kernel: 3 MHz)

    lcd_data1: ~1.5 MHz (kernel: 2.5 MHz)


3. Root Cause Analysis

It is evident that the U-Boot waveform differs significantly from the kernel. The issue lies in the Hsync configuration. Specifically, for a width of 1280:

Formula: 16 * (msb + lsb + 1) = 1280

Calculated values: msb = 1, lsb = 0b001111.

When inspecting the register LCDC_RASTER_TIMING_0 using print, the observed value is 0x2dc79cf0, indicating the msb is not correctly set to 1.


4. Solution

The issue occurs in the RasterHparamConfig function in the Raster.c file. The relevant code is:

ppl = (ppl & 0x000003f0) | ((ppl & 0x00000400) >> 8);

HWREG(baseAddr + LCDC_RASTER_TIMING_0) = ppl; 

The problem is with the >> 8 operation. Changing it to >> 7 resolves the issue:

ppl = (ppl & 0x000003f0) | ((ppl & 0x00000400) >> 7);


Additional Information

Weathink's AM335x core board, based on the TI AM335x processor, is designed for industrial-grade applications, such as serial servers and multi-port gateways. For further assistance, please contact us or visit our website.


Tags: Array