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.

AM5708: How to enable SPI interface for touch controller on uboot ?

Part Number: AM5708
Other Parts Discussed in Thread: TSC2046

Hi Expert,

My custom board AM5708 with one touch controller on SPI interface.

I try to enable SPI interface on uboot to read/write touch controller.

Is there sample code for SPI interface on uboot?

Thanks

Daniel

  • Hi Daniel,

    U-boot does not have examples of SPI programming. You could try to use spidev_test
    to try and configure the slave from kernel.

    Check the "Linux Userspace Interface" section.

    Spidev Linux documentation: www.kernel.org/.../spidev


    Best Regards,
    Keerthy

  • Hi Keerthy

    In kernel our tsc2046 is working on MCSPI2 fine, but we would like to read it by sspi cmd in U-boot.

    The cmd sspi is not working,

    Hit any key to stop autoboot:  0 
    =>             
    => sspi 2:0.0 16 d0
    Invalid bus 2 (err=-19)
    => 

    can you help on this error?

    In \u-boot-2018.01\arch\arm\dts\am571x-idk.dts we have
    	aliases {
    		spi0 = &mcspi2;
    	};
    &mcspi2 {
    	status = "okay";
    	ti,pindir-d0-out-d1-in;
    	tsc2046@0 {
    		interrupt-parent = <&gpio1>;
    		interrupts = <25 0>;			/* gpio1_25=25 */
    		pendown-gpio = <&gpio1 25 GPIO_ACTIVE_HIGH>;
    		reg = <0>;			            /* CS0 */
    		compatible = "spidev";
    		spi-max-frequency = <1500000>;
    		vcc-supply = <&ldousb_reg>;
    		ti,x-min = /bits/ 16 <0>;
    		ti,x-max = /bits/ 16 <8000>;
    		ti,y-min = /bits/ 16 <0>;
    		ti,y-max = /bits/ 16 <4800>;
    		ti,x-plate-ohms = /bits/ 16 <40>;
    		ti,pressure-max = /bits/ 16 <255>;
    		ti,swap-xy;
    		wakeup-source;
    	};
    };
    
    In u-boot-2018.01\configs\am57xx_evm_defconfig we have 
    CONFIG_DM_SPI=y
    CONFIG_TI_QSPI=y
    
    In u-boot-2018.01\arch\arm\mach-omap2\omap5\hw_data.c we have
    void enable_basic_clocks(void)
    +		(*prcm)->cm_l4per_i2c2_clkctrl,
    +		(*prcm)->cm_l4per_mcspi2_clkctrl,
    void enable_basic_uboot_clocks(void)
    +		(*prcm)->cm_l4per_mcspi2_clkctrl,
    
    
  • Daniel,

    I think you have new query for this: https://e2e.ti.com/support/processors/f/791/t/948853

    Can you please resolve this?

    Best Regards,
    Keerthy