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.

AM335x silicon errata fix in Android JB4.2(kernel3.2) rootfs

Other Parts Discussed in Thread: DA8XX

Hi all,

I am working on custom Beagleboneblack board. There is an issue with AM335x silicon errata expained in 3.1.1(attached here). I have taken care in the kenel. The read and blue colors are swaped in the kernel. I have done below changes in the kernel and it is working fine, means kernel logo colors are displayed properly. Now issue with bootanmation and application images colors are not displayed properly. Looks like kernel driver code changes are not effected in the rootfs. Please let me know if anyone know where to fix this issue in the rootfs or any pointers to advise.

Here is the kernel code changes.

--- a/kernel/drivers/video/da8xx-fb.c
+++ b/kernel/drivers/video/da8xx-fb.c
@@ -1104,12 +1104,20 @@ static int fb_check_var(struct fb_var_screeninfo *var,
case 32:
var->transp.offset = 24;
var->transp.length = 8;
- var->red.offset = 16;
+/* var->red.offset = 16;
var->red.length = 8;
var->green.offset = 8;
var->green.length = 8;
var->blue.offset = 0;
+ var->blue.length = 8; */
+//Fix for 3.1.1 am335x silicon errata , bpp=32 from the board file
+ var->red.offset = 0;
+ var->red.length = 8;
+ var->green.offset = 8;
+ var->green.length = 8;
+ var->blue.offset = 16;
var->blue.length = 8;
+
break;
default:
err = -EINVAL;

***********************************************************************

Here is the board file changes.

/* LCD */
static const struct display_panel disp_panel = {
WVGA,
32,
32,
COLOR_ACTIVE,
};

static struct lcd_ctrl_config lcd_cfg = {
&disp_panel,
.ac_bias = 255,
.ac_bias_intrpt = 0,
.dma_burst_sz = 16,
.bpp = 32,
.fdd = 0x80,
/* .tft_alt_mode = 0,*/ /*to fix swap issue mentioned in the am335x silicon errata*/
.tft_alt_mode = 1,
.stn_565_mode = 0,
.mono_8bit_mode = 0,
.invert_line_clock = 1,
.invert_frm_clock = 1,
.sync_edge = 0,
.sync_ctrl = 1,
.raster_order = 0,
};

**********************************************************************

--- a/hardware/ti/sgx/services4/3rdparty/dc_ti335x_linux/omaplfb_displayclass.c
+++ b/hardware/ti/sgx/services4/3rdparty/dc_ti335x_linux/omaplfb_displayclass.c
@@ -1413,12 +1413,21 @@ static OMAPLFB_ERROR OMAPLFBInitFBDev(OMAPLFB_DEVINFO *psDevInfo)
}
else if(psLINFBInfo->var.bits_per_pixel == 32)
{
- if((psLINFBInfo->var.red.length == 8) &&
+ /*if((psLINFBInfo->var.red.length == 8) &&
(psLINFBInfo->var.green.length == 8) &&
(psLINFBInfo->var.blue.length == 8) &&
(psLINFBInfo->var.red.offset == 16) &&
(psLINFBInfo->var.green.offset == 8) &&
(psLINFBInfo->var.blue.offset == 0) &&
+ (psLINFBInfo->var.red.msb_right == 0))*/
+
+ /*fix for AM335x silicon errata*/
+ if((psLINFBInfo->var.red.length == 8) &&
+ (psLINFBInfo->var.green.length == 8) &&
+ (psLINFBInfo->var.blue.length == 8) &&
+ (psLINFBInfo->var.red.offset == 0) &&
+ (psLINFBInfo->var.green.offset == 8) &&
+ (psLINFBInfo->var.blue.offset == 16) &&
(psLINFBInfo->var.red.msb_right == 0))
{
psPVRFBInfo->ePixelFormat = PVRSRV_PIXEL_FORMAT_ARGB8888;

************************************************************************************

Thanks in advance.

0081.AM335x_silicaon_errata_sprz360f.pdf

  • Hi all,

    Please find the logcat log here.  I could not able to find any log related to offset, might be it is not enabled. Kindly give some pointers or is there any rootfs patch is avialble???

    W/InterfaceController( 72): Warning (Cannot load library: load_library(linker.cpp:745): library "/system/lib/libnetcmdiface.so" not found) while opening the net interface command library
    D/Vold ( 69): Volume sdcard state changing 0 (No-Media) -> 2 (Pending)
    D/Vold ( 69): Volume sdcard state changing 2 (Pending) -> 1 (Idle-Unmounted)
    I/SurfaceFlinger( 74): SurfaceFlinger is starting
    I/SurfaceFlinger( 74): SurfaceFlinger's main thread ready to run. Initializing graphics H/W...
    D/libEGL ( 74): loaded /system/lib/egl/libEGL_POWERVR_SGX530_125.so
    D/libEGL ( 74): loaded /system/lib/egl/libGLESv1_CM_POWERVR_SGX530_125.so
    D/libEGL ( 74): loaded /system/lib/egl/libGLESv2_POWERVR_SGX530_125.so
    E/uim-sysfs( 71): uim: Inside st_uart_config
    E/uim-sysfs( 71): uim:install set to 1
    E/uim-sysfs( 71): uim: Inside set_baud_rate
    E/uim-sysfs( 71): uim: set_baud_rate() done
    E/uim-sysfs( 71): uim: Inside read_firmware_version
    E/uim-sysfs( 71): uim: Inside read_hci_event
    E/uim-sysfs( 71): uim: read_hci_event
    E/SurfaceFlinger( 74): hwcomposer module not found
    W/SurfaceFlinger( 74): getting VSYNC period from fb HAL: 14437306
    W/SurfaceFlinger( 74): no suitable EGLConfig found, trying without EGL_FRAMEBUFFER_TARGET_ANDROID
    I/SurfaceFlinger( 74): EGL informations:
    I/SurfaceFlinger( 74): vendor : Android
    I/SurfaceFlinger( 74): version : 1.4 Android META-EGL
    I/SurfaceFlinger( 74): extensions: EGL_KHR_image EGL_KHR_image_base EGL_KHR_gl_texture_2D_image EGL_KHR_gl_texture_cubemap_image EGL_KHR_gl_renderbuffer_image EGL_KHR_fence_sync EGL_ANDROID_image_native_buffer
    I/SurfaceFlinger( 74): Client API: OpenGL_ES
    I/SurfaceFlinger( 74): EGLSurface: 8-8-8-8, config=0x2
    I/SurfaceFlinger( 74): OpenGL ES informations:
    I/SurfaceFlinger( 74): vendor : Imagination Technologies
    I/SurfaceFlinger( 74): renderer : PowerVR SGX 530
    I/SurfaceFlinger( 74): version : OpenGL ES-CM 1.1
    I/SurfaceFlinger( 74): extensions: GL_EXT_debug_marker GL_OES_byte_coordinates GL_OES_fixed_point GL_OES_single_precision GL_OES_matrix_get GL_OES_read_format GL_OES_compressed_paletted_texture GL_OES_point_sprite GL_OES_point_size_array GL_OES_matrix_palette GL_OES_draw_texture GL_OES_query_matrix GL_OES_texture_env_crossbar GL_OES_texture_mirrored_repeat GL_OES_texture_cube_map GL_OES_blend_subtract GL_OES_blend_func_separate GL_OES_blend_equation_separate GL_OES_stencil_wrap GL_OES_extended_matrix_palette GL_OES_framebuffer_object GL_OES_rgb8_rgba8 GL_OES_depth24 GL_OES_stencil8 GL_OES_compressed_ETC1_RGB8_texture GL_OES_mapbuffer GL_OES_EGL_image GL_OES_EGL_image_external GL_EXT_multi_draw_arrays GL_OES_required_internalformat GL_IMG_read_format GL_IMG_texture_compression_pvrtc GL_IMG_texture_format_BGRA8888 GL_EXT_texture_format_BGRA8888 GL_OES_egl_sync GL_IMG_vertex_array_object GL_APPLE_texture_2D_limited_npot
    I/SurfaceFlinger( 74): GL_MAX_TEXTURE_SIZE = 2048
    I/SurfaceFlinger( 74): GL_MAX_VIEWPORT_DIMS = 2048 x 2048

    Thanks

  • Hi all,

    Looks like while running rootfs images blue and red offset are not affected in display driver.  Here is the log attached. which rootfs module we have to look for further analysis. Please any help????

    *****************************************************************************************************************

    [ 42.611450] drivers/video/da8xx-fb.c:fb_check_var:1162: red offset=0 blue offset=16

    [ 42.802978] drivers/video/da8xx-fb.c:fb_check_var:1079: bits_per_pixel=32
    [ 42.803009] drivers/video/da8xx-fb.c:fb_check_var:1162: red offset=0 blue offset=16
    [ 42.861267] drivers/video/da8xx-fb.c:fb_check_var:1079: bits_per_pixel=32
    [ 42.861297] drivers/video/da8xx-fb.c:fb_check_var:1162: red offset=0 blue offset=16
    [ 43.066589] drivers/video/da8xx-fb.c:fb_check_var:1079: bits_per_pixel=32
    [ 43.066619] drivers/video/da8xx-fb.c:fb_check_var:1162: red offset=0 blue offset=16
    [ 43.322906] drivers/video/da8xx-fb.c:fb_check_var:1079: bits_per_pixel=32
    [ 43.322906] drivers/video/da8xx-fb.c:fb_check_var:1162: red offset=0 blue offset=16
    [ 43.568664] drivers/video/da8xx-fb.c:fb_check_var:1079: bits_per_pixel=32
    [ 43.568695] drivers/video/da8xx-fb.c:fb_check_var:1162: red offset=0 blue offset=16
    [ 43.661529] request_suspend_state: wakeup (3->0) at 43630992180 (2000-01-01 00:00:41.241549687 UTC)
    [ 43.785247] drivers/video/da8xx-fb.c:fb_check_var:1079: bits_per_pixel=32
    [ 43.785278] drivers/video/da8xx-fb.c:fb_check_var:1162: red offset=0 blue offset=16
    [ 43.849822] drivers/video/da8xx-fb.c:fb_check_var:1079: bits_per_pixel=32
    [ 43.849853] drivers/video/da8xx-fb.c:fb_check_var:1162: red offset=0 blue offset=16
    [ 43.881439] drivers/video/da8xx-fb.c:fb_check_var:1079: bits_per_pixel=32
    [ 43.881439] drivers/video/da8xx-fb.c:fb_check_var:1162: red offset=0 blue offset=16
    [ 44.076507] drivers/video/da8xx-fb.c:fb_check_var:1079: bits_per_pixel=32
    [ 44.076538] drivers/video/da8xx-fb.c:fb_check_var:1162: red offset=0 blue offset=16
    [ 44.333892] drivers/video/da8xx-fb.c:fb_check_var:1079: bits_per_pixel=32
    [ 44.333923] drivers/video/da8xx-fb.c:fb_check_var:1162: red offset=0 blue offset=16
    [ 44.578826] drivers/video/da8xx-fb.c:fb_check_var:1079: bits_per_pixel=32
    [ 44.578857] drivers/video/da8xx-fb.c:fb_check_var:1162: red offset=0 blue offset=16
    [ 44.826690] drivers/video/da8xx-fb.c:fb_check_var:1079: bits_per_pixel=32
    [ 44.826721] drivers/video/da8xx-fb.c:fb_check_var:1162: red offset=0 blue offset=16
    [ 45.084289] drivers/video/da8xx-fb.c:fb_check_var:1079: bits_per_pixel=32
    [ 45.084320] drivers/video/da8xx-fb.c:fb_check_var:1162: red offset=0 blue offset=16
    [ 45.200683] drivers/video/da8xx-fb.c:fb_check_var:1079: bits_per_pixel=32
    [ 45.200683] drivers/video/da8xx-fb.c:fb_check_var:1162: red offset=0 blue offset=16
    [ 45.329833] drivers/video/da8xx-fb.c:fb_check_var:1079: bits_per_pixel=32
    [ 45.329864] drivers/video/da8xx-fb.c:fb_check_var:1162: red offset=0 blue offset=16
    [ 45.577423] drivers/video/da8xx-fb.c:fb_check_var:1079: bits_per_pixel=32
    [ 45.577453] drivers/video/da8xx-fb.c:fb_check_var:1162: red offset=0 blue offset=16
    [ 45.834960] drivers/video/da8xx-fb.c:fb_check_var:1079: bits_per_pixel=32

    ************************************************************************************************************************************

    0207.red_blue_offset_swap.txt

  • Hi all,

    Some more updates....
    I am not getting the logcat messages from gralloc module, but on board gralloc module is available shown below, Please let me know do we have to add any configuration file to execute the same????

    root@android:/system/lib/hw # ll
    -rw-r--r-- root root 5436 2015-07-30 10:29 audio.primary.default.so
    -rw-r--r-- root root 75236 2015-07-30 10:29 audio_policy.default.so
    -rw-r--r-- root root 753380 2015-07-30 10:29 bluetooth.default.so
    -rw-r--r-- root root 132896 2015-07-30 10:29 camera.goldfish.so
    -rw-r--r-- root root 9564 2015-07-30 10:29 gps.goldfish.so
    -rw-r--r-- root root 9796 2015-07-30 10:29 gralloc.default.so
    -rw-r--r-- root root 22460 2015-07-30 10:29 gralloc.omap3.so
    -rw-r--r-- root root 9484 2015-07-30 10:29 keystore.default.so
    -rw-r--r-- root root 9568 2015-07-30 10:29 lights.am335xevm.so
    -rw-r--r-- root root 5368 2015-07-30 10:29 lights.goldfish.so
    -rw-r--r-- root root 5372 2015-07-30 10:29 local_time.default.so
    -rw-r--r-- root root 5372 2015-07-30 10:29 power.default.so
    -rw-r--r-- root root 9524 2015-07-30 10:29 sensors.goldfish.so

    Thanks in advance
  • Hello,

    Are you trying to use a screen through the pins muxed as a 24bits LCD connector?
    If so, please revert all your changes; then inside drivers/video/da8xx-fb.c, add an element in the "known_lcd_panels" array.
    For example:

    [10] = {
        .name = "YourScreenName",
        .width = XXX,
        .height = YYY,
        /* other screen parameters: front porch, back porch... */
    },

    Then inside arch/arm/mach-omap2/board-am335xevm.c add a new structure (around line 225):

    struct da8xx_lcdc_platform_data YourScreenName_pdata = {
        .manu_name              = "YourScreenManufacturer",
        .controller_data        = &lcd_cfg, /* this will select the configuration for a 32bpp LCD (even if yours uses 24bits), where red and blue are inverted */
        .type                   = "YourScreenName", /* this string must be the same to the ".name" string of the known_lcd_panels' new element */
    };

  • Hi,

    Hi,

    Thanks for your reply.
    The pins are muxed through 16bits LCD connector.

    Added panel info in drivers/video/da8xx-fb.c as follows.

    [10] = {
    .name = "VAR-WVGA",
    .width = 800,
    .height = 480,
    .hfp = 40,
    .hbp = 88,
    .hsw = 128,
    .vfp = 11,
    .vbp = 32,
    .vsw = 2,
    .pxl_clk = 33000000,
    .invert_pxl_clk = 0,
    },

    Added new board file and added panel info added as mentioned below
    /* LCD */
    static const struct display_panel disp_panel = {
    WVGA,
    32,
    32,
    COLOR_ACTIVE,
    };

    static struct lcd_ctrl_config lcd_cfg = {
    &disp_panel,
    .ac_bias = 255,
    .ac_bias_intrpt = 0,
    .dma_burst_sz = 16,
    .bpp = 32,
    .fdd = 0x80,
    /* .tft_alt_mode = 0,*/ /*to fix swap issue mentioned in the am335x silicon errata*/
    .tft_alt_mode = 1,
    .stn_565_mode = 0,
    .mono_8bit_mode = 0,
    .invert_line_clock = 1,
    .invert_frm_clock = 1,
    .sync_edge = 0,
    .sync_ctrl = 1,
    .raster_order = 0,
    };

    I am not seeing any issue in the Kernel logo. The colors are displayed as expected.
    I have only concern with rootfs images and bootanimation images. Lookslike some thing I am missing in the HAL driver.
    The display driver offset code changes are not reflected in the rootfs. But If you see kernel logs when rootfs images are displayed, there is no changes in the red and blue offset values.
    ************************************************************************
    [ 42.802978] drivers/video/da8xx-fb.c:fb_check_var:1079: bits_per_pixel=32
    [ 42.803009] drivers/video/da8xx-fb.c:fb_check_var:1162: red offset=0 blue offset=16
    [ 42.861267] drivers/video/da8xx-fb.c:fb_check_var:1079: bits_per_pixel=32
    [ 42.861297] drivers/video/da8xx-fb.c:fb_check_var:1162: red offset=0 blue offset=16
    [ 43.066589] drivers/video/da8xx-fb.c:fb_check_var:1079: bits_per_pixel=32
    [ 43.066619] drivers/video/da8xx-fb.c:fb_check_var:1162: red offset=0 blue offset=16
    *********************************************************************************

    Please advise me if you have any patch related to HAL drivers with respect to Silicon errata issue??????

    Thanks in advance.
  • Hello,

    Have you tried to not make the change on ".tft_alt_mode"?
    We have already use 24bits LCD screens on the Beaglebone Black, with just the two modifications stated above (new element in "known_lcd_panels" array, new da8xx_lcdc_platform_data structure) and everything was displayed correctly.
    Have you reverted all the changes you made before?

  • Hi,

    Thanks for the reply.

    Have you tried to not make the change on ".tft_alt_mode"?
    I tried by changing the .tft_alt_mode to zero and one. But no luck so far.

    The LCD panel has been connected as shown in the figure 3 of section 3.1.1 of Silicon errata section, i.e 16bit mode.
    Here is the board file changes.

    /* LCD */
    static const struct display_panel disp_panel = {
    WVGA,
    32,
    32,
    COLOR_ACTIVE,
    };

    static struct lcd_ctrl_config lcd_cfg = {
    &disp_panel,
    .ac_bias = 255,
    .ac_bias_intrpt = 0,
    .dma_burst_sz = 16,
    .bpp = 32,
    .fdd = 0x80,
    .tft_alt_mode = 0, //color swap issue fix in new board
    .stn_565_mode = 0,
    .mono_8bit_mode = 0,
    .invert_line_clock = 1,
    .invert_frm_clock = 1,
    .sync_edge = 0,
    .sync_ctrl = 1,
    .raster_order = 0,
    };

    I am not seeing any issue in the kernel. Facing issue with rootfs.

    Thanks
  • Hi all,

    I have done some progress here.

    I could able to get the proper colors in rootfs and bootanimation. Here is the logcat output.  The display panel confugration I have done similar to bbb hdmi configuration.  But I am not getting the proper colors in the Boot logo.  Please let me know if anyone faced similar issue. 

    There is no issue in rootfs w.r.to silicon errata 3.1.1  errata, if sgx graphics libraries are configured.

    D/Vold ( 62): Volume sdcard state changing 2 (Pending) -> 1 (Idle-Unmounted)
    I/SurfaceFlinger( 67): SurfaceFlinger is starting
    I/SurfaceFlinger( 67): SurfaceFlinger's main thread ready to run. Initializing graphics H/W...
    D/libEGL ( 67): loaded /system/lib/egl/libEGL_POWERVR_SGX530_125.so
    D/libEGL ( 67): loaded /system/lib/egl/libGLESv1_CM_POWERVR_SGX530_125.so
    D/libEGL ( 67): loaded /system/lib/egl/libGLESv2_POWERVR_SGX530_125.so
    E/SurfaceFlinger( 67): hwcomposer module not found
    W/SurfaceFlinger( 67): getting VSYNC period from fb HAL: 14437306
    W/SurfaceFlinger( 67): no suitable EGLConfig found, trying without EGL_FRAMEBUFFER_TARGET_ANDROID
    W/SurfaceFlinger( 67): no suitable EGLConfig found, trying without EGL_RECORDABLE_ANDROID
    W/SurfaceFlinger( 67): no suitable EGLConfig found, trying with 16-bit color allowed
    I/SurfaceFlinger( 67): EGL informations:
    I/SurfaceFlinger( 67): vendor : Android
    I/SurfaceFlinger( 67): version : 1.4 Android META-EGL
    I/SurfaceFlinger( 67): extensions: EGL_KHR_image EGL_KHR_image_base EGL_KHR_gl_texture_2D_image EGL_KHR_gl_texture_cubemap_image EGL_KHR_gl_renderbuffer_image EGL_KHR_fence_sync EGL_ANDROID_image_native_buffer
    I/SurfaceFlinger( 67): Client API: OpenGL_ES
    I/SurfaceFlinger( 67): EGLSurface: 5-6-5-0, config=0x8
    I/SurfaceFlinger( 67): OpenGL ES informations:
    I/SurfaceFlinger( 67): vendor : Imagination Technologies
    I/SurfaceFlinger( 67): renderer : PowerVR SGX 530
    I/SurfaceFlinger( 67): version : OpenGL ES-CM 1.1
    I/SurfaceFlinger( 67): extensions: GL_EXT_debug_marker GL_OES_byte_coordinates GL_OES_fixed_point GL_OES_single_precision GL_OES_matrix_get GL_OES_read_format GL_OES_compressed_paletted_texture GL_OES_point_sprite GL_OES_point_size_array GL_OES_matrix_palette GL_OES_draw_texture GL_OES_query_matrix GL_OES_texture_env_crossbar GL_OES_texture_mirrored_repeat GL_OES_texture_cube_map GL_OES_blend_subtract GL_OES_blend_func_separate GL_OES_blend_equation_separate GL_OES_stencil_wrap GL_OES_extended_matrix_palette GL_OES_framebuffer_object GL_OES_rgb8_rgba8 GL_OES_depth24 GL_OES_stencil8 GL_OES_compressed_ETC1_RGB8_texture GL_OES_mapbuffer GL_OES_EGL_image GL_OES_EGL_image_external GL_EXT_multi_draw_arrays GL_OES_required_internalformat GL_IMG_read_format GL_IMG_texture_compression_pvrtc GL_IMG_texture_format_BGRA8888 GL_EXT_texture_format_BGRA8888 GL_OES_egl_sync GL_IMG_vertex_array_object GL_APPLE_texture_2D_limited_npot
    I/SurfaceFlinger( 67): GL_MAX_TEXTURE_SIZE = 2048
    I/SurfaceFlinger( 67): GL_MAX_VIEWPORT_DIMS = 2048 x 2048
    D/SurfaceFlinger( 67): Screen acquired, type=0 flinger=0x41315318
    I/ServiceManager( 67): Waiting to check permission android.permission.ACCESS_SURFACE_FLINGER from uid=1000 pid=128
    D/AndroidRuntime( 68):
    D/AndroidRuntime( 68): >>>>>> AndroidRuntime START com.android.internal.os.ZygoteInit <<<<<<
    D/AndroidRuntime( 68): CheckJNI is ON
    D/dalvikvm( 68): DexOpt: --- BEGIN 'core.jar' (bootstrap=1) ---

  • Hello,

    Your screen is wired in 16bit mode, but do you expect LCD_DATA15 to deliver Blue7 (i.e. RGB888) or Red7 (i.e. RGB565)?
    As you can see on the errata document, it depends on the RGB mode.

    If you want the later (LCD_DATA15 transmits Red7), you should change your da8xx_lcdc_platform_data definition, for example:

    struct da8xx_lcdc_platform_data YourScreenName_pdata = {
        .manu_name              = "YourScreenManufacturer",
        .controller_data        = &bone_lcd_cape_cfg, /* otherwise, &lcd_cfg for LCD_DATA15 transmitting Blue7 */
        .type                   = "YourScreenName", /* this string must be the same to the ".name" string of the known_lcd_panels' new element */
    };

    On our side ".tft_alt_mode" is set to 0; do you use the latest version of the BSP?

  • Hi Adeno embedded,

    Thanks for the reply.


    Yes. screen is wired in 16 bit mode.
    LCD_DATA15 will deilver R7.  
    My screen data lines  are exactly as same as figure 3 shown in errata sheet.
    LCD_DATA[15:0]-----R[7:3]B[7:2]B[7:3]. Configured the panel RGB565  mode i.e bone_lcd_cape_cfg. It started working fine.

    I could able to see the expected colors in kernel and rootfs.

    I removed all the offset related code changes in driver file and hardware/ti/sgx/services4/3rdparty/dc_ti335x_linux/omaplfb_displayclass.c.

    In board file reverted back to .tft_alt_mode to zero.

    Thanks

    ashok