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.

Linux/AM3352: ILI9488 support in U-boot

Part Number: AM3352

Tool/software: Linux

How to enable ILI 9488(LCD) in U-boot 16 .05 through spi interface. It starts normally from kernel stage of booting the device. Also suggest the required changs in omap3_spi.c and spi.c.

  • While we don't support driver code for the ILI9488 (LCD) panel there are some examples you can use as a reference (ili9488 driver example).  Modifications to omap3_spi.c shouldn't be necessary, because it defines the spi driver.

    1) The ILI9488 driver should be created under ./driver/video.  Use ld9040.c as an example since it also uses an SPI interface.
    2) Then call the initialize functions in your ./board/ti/<platform>board.c file 

  • Ok but can you tell me how to enable clock of spi1 for U-boot 16.05.

    P.S. other threads haven't answered my question they are mainly for uboot 13.

  • 1) In file arch/arm/configs/tisdk_am335x-evm_defconfig be sure SPI is enabled

    CONFIG_SPI=y
    CONFIG_SPI_MASTER=y

    CONFIG_SPI_SPIDEV=y

    SPI clocks are enabled in the u-boot device tree file(s)

    2) In file ./arch/arm/dts/am335-bone-common.dtsi add SPI pin muxing based spi pins connected to the ILI9488 display.  For example, SPI1 which is pinmuxed to mode 3 of the mcasp0_xxxx pin

            spi1_pins: pinmux_spi1_pins {
                    pinctrl-single,pins = <
                            /* SPI1 CS, D0, D1, CLK Signals */
                            AM33XX_IOPAD(0x990, PIN_INPUT_PULLUP  | MUX_MODE3) /* SPI1_CLK */
                            AM33XX_IOPAD(0x994, PIN_INPUT_PULLUP  | MUX_MODE3) /* SPI1_D0  */
                            AM33XX_IOPAD(0x998, PIN_OUTPUT        | MUX_MODE3) /* SPI1_D1  */
                            AM33XX_IOPAD(0x9AC, PIN_OUTPUT        | MUX_MODE3) /* SPI1_CS0 */
                    >;
            };


    3) enable clock

    &spi1 {
            pinctrl-names = "default";
            pinctrl-0 = <&spi1_pins>;

            status = "okay";

            spidev@1 {

                    compatible = "linux,spidev";

                    spi-max-frequency = <48000000>;

                    reg = <0>;

                    status = "okay";

               };
    };

  • Hi Marcus,
    Can sspi (spi utility) help me to send commands to. LCD .

    P.S. Register CM_PER_SPI1_CLKCTRL needs to be enabled( to enable spi1 clock ).
  • sspi can be used from u-boot or spi_test (found here spi) can in the kernel.

    You stated that CM_PER_SPI1_CLKCTRL had to enabled, which I assume was already been done in the board config file ./arch/arm/mach-omap2/omap_hwmod_33xx_43xx_ipblock_data.c.  Can you please show how you enabled the CM_PER_SPI1_CLKCTRL register?

  • Hi,

    I have enabled it through its appropriate register  in U-boot .

  • Are you able to successfully generate SPI signals?
  • Firing sspi 1:0.0  16 1a

    Command without enabling of spi1_clkctrl register  lead to hanging up of device. Which needs to be restarted.

    But after enabling the register it returns 0000 in console. In short the command doesn't leads to hangup. We are not yet sure that this would help us to interface LCD. We tried giving some basic commands such as display on and off but without success. If you have further suggestions, do tell us.

  • The next step, if you haven't done so already, is to verify the correct command signals are being generated from the SPI interface.  Attached a scope or logic analyzer to confirm this.

  • There were changes required in driver. CS was replied by word length in one of the parameters in spi.h. This started sspi commands reaching to LCD and getting results appropriately.Then I made a function in board.c to initialize LCD.The issue has been resolved .

    Thanks,