• We recently switched our forum platform. If you experience any issues please email support@crystalfontz.com

Linux/AM3354: 3-wire SPI LCD timing

waman.prabhu

New member
Hello:
I'm using a custom AM3354 board. We have to make this work on 3.2.0 kernel only.
LINUX ...... 3.2.0 #71 PREEMPT THU APR 13 07:34:59 CEST 2017 ARMV7L GNU/LINUX
We are integrating KD024FM-1B (2.4" LCD) LCD which uses ST7789V IC. We have received the LCD initialization code for 3-wire SPI from the LCD manufacturer.
The below is the snippet in my board file;
Code:
#include video/st7789fb.h
static struct pinmux_config spi_pin_mux[] = {
    {"mcasp0_aclkx.spi1_sclk",    OMAP_MUX_MODE3 | AM33XX_PULL_ENBL | AM33XX_INPUT_EN},
    {"mcasp0_axr0.spi1_d1",        OMAP_MUX_MODE3 | AM33XX_PULL_ENBL | AM33XX_INPUT_EN},
    {"mcasp0_ahclkr.spi1_cs0",   OMAP_MUX_MODE3 | AM33XX_PULL_ENBL | AM33XX_PULL_UP | AM33XX_INPUT_EN},
    {NULL, 0},
};
/* LCD Controller */
static const struct st7789fb_platform_data lcd_st7789fb_data = {
    .rst_gpio    = GPIO_TO_PIN(3, 8),
    .dc_gpio    = GPIO_TO_PIN(0, 7),
};
static struct spi_board_info lcd_spi1_slave_info[] = {
    {
        .modalias      = "st7789fb",
        .platform_data    = &lcd_st7789fb_data,
        .irq         = -1,
        .max_speed_hz  = 3000000,           // the timing is the problem at the moment, tried upto 32MHz
        .bus_num       = 2,
        .chip_select   = 0,
        .mode          = SPI_MODE_0,
    },
};

/* setup lcd spi1 */
static void __init spi_init(void)
{
    setup_pin_mux(spi_pin_mux);
    spi_register_board_info(lcd_spi1_slave_info, ARRAY_SIZE(lcd_spi1_slave_info));
}
View attachment 2098

Based on code from https://github.com/ohporter/linux-am33x/tree/st7735fb ; I've modified the init script as per ST7789

After including the driver code; there was a problem with register_framebuffer which was resolved by patching/modifying the following;
1. make st7735 DMA safe, and
2. fbmem.c

I'm not able to get the timing right. Please suggest.
NOTE: we were able to make the ST7775 functional with the similar approach.

Regards,
Waman Prabhu
Looking for additional LCD resources? Check out our LCD blog for the latest developments in LCD technology.
 
Last edited:
Top