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.

ti8148

Other Parts Discussed in Thread: TVP7002

HI All:

i am using gpio GP1[18] to light the led up.  Here is my code that adding into board-ti8148evm.c 

static void __init ti814x_gpio_init(void)
{
int error;

omap_mux_init_signal("gpmc_a_23_mux0.gpio1_18_mux0", TI814X_PULL_UP | (1 << 18) );

error = gpio_request(GPIO_TI, "gpio");
if (error < 0) {
printk(KERN_ERR "%s: failed to request GPIO "
": %d\n", __func__, error);
return;
}

gpio_direction_output(GPIO_TI, 1);

gpio_export(50, true);
}
static void __init ti8148_evm_init(void)
{
..........
ti814x_gpio_init(); 
}
I can see the gpio50 in /sys/class/gpio from my console port, and i can check the direction (out) and value (1) from the console port. 
But I cannot see the voltage pull high from my ammeter. By the way, I also check the value (00040001) in the  address of GP1[18] from 
u-boot, but I am not pretty sure what it mean. I am very new in this field, could anyone give me some direction?


  • Hi,

    Please see this post for your answer:

    http://e2e.ti.com/support/dsp/davinci_digital_media_processors/f/716/t/120782.aspx#603735

    BR,

    Viet

  • Hi Chen,

    Section "4.3 Pin Multiplexing Control" of datasheet talks about the pinmux control register

    And value of pin mux register of "gpmc_a_23_mux0" [7:0] 0x80 for getting the GP1[18] functionality.

    You can control the led from gpio sysfs entries after kernel boots-up, provided pinmux should be configured in kernel

    http://processors.wiki.ti.com/index.php/GPIO_Driver_Guide#Sysfs_entries_configuration

    Regards

    AnilKumar

    Please mark this Forum post as answered via the Verify Answer button below if it helps answer your question.  Thanks!

  • Thanks Viet. I am appreciate that you give me some directions. 

    Afetr all, I have corrected my program as following in board-ti814xevm.c 

    #define PINCNTL_DEFAULT         0x00080000    // This bit must never change from default
    #define PINCNTL_PULL_DOWN 0x00040000 // Pulldown Selected
    #define PINCNTL_PULL_UP 0x00060000 // Pullup Selected
    #define PINCNTL_PULL_DISABLE 0x00050000 // Pullup/Pulldown Disabled
    #define PINCNTL_MUXMODE1 0x00000001 // Select Fcn 1
    #define PINCNTL_MUXMODE2 0x00000002 // Select Fcn 2
    #define PINCNTL_MUXMODE3 0x00000004 // Select Fcn 3
    #define PINCNTL_MUXMODE4 0x00000008 // Select Fcn 4
    #define PINCNTL_MUXMODE5 0x00000010 // Select Fcn 5
    #define PINCNTL_MUXMODE6 0x00000020 // Select Fcn 6
    #define PINCNTL_MUXMODE7 0x00000040 // Select Fcn 7
    #define PINCNTL_MUXMODE8 0x00000080 // Select Fcn 8
    
    
    //#define pincntl_macro(x,y,z)    (*(U32 *)x = ( *(U32 *)x & PINCNTL_DEFAULT ) | y | z )


    //#define pincntl_gp1_18() pincntl_macro( 0x481409BC, TI814X_PULL_DIS, PINCNTL_MUXMODE8 ) // PINCNTL47 Debug Pin1
    
    
    and using command from 
    http://processors.wiki.ti.com/index.php/GPIO_Driver_Guide#Sysfs_entries_configuration
    
    
    The messages are from console port:
    
    
    # echo "50" > export
    # ls
    export
    unexport
    gpiochip0
    gpiochip32
    gpiochip64
    gpiochip96
    gpio31
    gpiochip128
    gpio128
    gpio50
    # cd gpio50
    #ls
    uevent
    subsystem
    power
    value
    active_low
    direction
    edge
    # echo "out" > direction
    # cat direction
    out
    # echo 1 > value
    # cat value
    1

    We can see the value becomes "1", but the voltage of ammeter is still low.  By the way, I have try to 
    write value 0x00060080 to the address (0x481409BC) in the u-boot, and I can see the voltage pull  high. Is it possible 
    that I cannot control the gpio pin when kernel boots up? Or I need to write another gpio driver and build into kernel without 
    writing the gpio_request function in board-ti814xevm.c.   
    
    
    
    


  • Thanks Anil and Viet. I am appreciate that you give me some directions.

    I really need to wok on very hard!!

  • Hi Chen,

    What voltage did you see when you measured?  I know some are 1.2V and some are 3.3V depend on the GPIO pin.

    BR,

    Viet

  • Hi Chen,

    Generally this what happens, you are modifying the PINMUX setting in your context in board file (which is called first)

    After that same pin is configured for GPMC (called after your settings), so GPIO functionality is not exported in your case.

    Better use your code after ti814x_nor_init() call (inside arch/arm/mach-omap2/devices.c file).

    Regards

    AnilKumar

    Please mark this Forum post as answered via the Verify Answer button below if it helps answer your question.  Thanks!

  • Hi Viet

    I just want to pull high the voltage of GPIO whether the voltage are 1.2V and 3.3V. Because the voltage

    of ammeter I measured is 0.02V. 

    Hi Anil:

    I am sure that I use my code after ti814x_nor_init() call. I think it could not be the problem. It is very odd. 

    Could you have any suggestion?

    Thank you. Best regards.

    Jaden

  • Looking at the code, GP1[18], may be used by the video driver. See

    omap2_init_devices(void)
    ->ti81xx_video_mux();
    -->omap_mux_init_signal("hdmi_hpd_mux0",TI814X_INPUT_EN);

  • Hi Norman:

    Thank you for your suggestions. I think that GP1[18] may not used by the video driver. Because

    I could not find  ti81xx_video_mux() in omap2_init_devices(void).  The following are my codes

    	omap_hsmmc_reset();
    #if !defined(CONFIG_ARCH_TI81XX)
    omap_init_audio();
    #endif
    omap_init_camera();
    omap_init_mbox();
    omap_init_mcspi();
    omap_init_pmu();
    omap_hdq_init();
    omap_init_sti();
    omap_init_sham();
    omap_init_aes();
    omap_init_vout();
    #ifdef CONFIG_ARCH_TI81XX
    ti81xx_ethernet_init();
    ti816x_init_pcie();
    ti81xx_register_edma();
    ti81xx_init_pcm();
    ti816x_sr_init();
    #endif
    omap_init_ahci();
    
    
    Thank you. Best regards.
    jaden.



    
    


  • Sorry, I am looking at a different source tree at www.arago-project.org. I thought you were using the linux-omap3. It looks like you are using linux-scbp. There does not appear to be any obvious place that is using "spi2_sclk_mux0", "hdmi_hpd_mux0", "timer5_mux2", or "gpio1_18_mux0". Perhaps you should try search your source for omap_mux_init_signal() calls with any of those names. This is probably the most obfuscated linux source I've ever seen. SPI flash is enabled but I cannot find pinmux of the SPI pins. I guess it must be done by U-Boot.

    I think Anil is suggesting you try to override whatever driver that is using your pin. Something like:

    static int __init omap2_init_devices(void)
    {
        ...
        omap_init_ahci();
        omap_mux_init_signal("gpmc_a_23_mux0.gpio1_18_mux0", 0); // Override
        return 0;
    }

    It's seems a bit hacky. A better way would be to disable the driver and mux init for that driver. Might be other problems entirely.

  • Hi Jaden,

    You can check the pinmux values from debug entries

    http://e2e.ti.com/support/dsp/davinci_digital_media_processors/f/716/t/168911.aspx

    Make sure that what ever the values you are setting in the kernel (code) to configure gpio1_18_mux0 should be replicate in the debugfs entries.

    Regards

    AnilKumar

    Please mark this Forum post as answered via the Verify Answer button below if it helps answer your question.  Thanks!

  • Hi Anil:

    Thanks for your suggestions. The following parameters are from 

    /sys/kernel/debug/omp_mux:  

    name: gpmc_a_23_mux0.hdmi_hpd_mux0 (0x481409bc/0x9bc = 0x40010), b NA, t NA
    mode: OMAP_PIN_OUTPUT | OMAP_MUX_MODE0
    signals: gpmc_a_23_mux0 | NA | spi2_sclk_mux0 | NA | hdmi_hpd_mux0 | NA | timer5_mux2 | gpio1_18_mux0
    
    
    and 
    /sys/kernel/debug/gpio
    
    
    GPIGPIOs 0-31, gpio:
    gpio-31 (ts_irq ) in hi irq-191 edge-falling

    GPIOs 32-63, gpio:
    gpio-50 (gpio ) out hi

    GPIOs 64-95, gpio:

    GPIOs 96-127, gpio:

    GPIOs 128-143, i2c/1-0021, pcf8575, can sleep:
    gpio-128 (lcd_power ) out lo
    
    
    From messages above, is the GP1[18] already in the ti8148evm board? If it is, the voltage of GP1[18] should be pulled high. 
    But the voltage of my ammeter is 0.02v. If it is not, do I miss something to check ?  
    I am really appreciate that you give me a lot of suggestions. Thank you. 
    Best regards.
    Jaden
  • Hi Jaden,

    name: gpmc_a_23_mux0.hdmi_hpd_mux0 (0x481409bc/0x9bc = 0x40010), b NA, t NA

    From the log I can say that, pin is configured for hdmi_hpd_mux0 not for GPIO

    Identify and modify "gpmc_a_23_mux0" register [7:0] value should be 0x80 for getting the GP1[18] functionality.

    Regards

    AnilKumar

    Please mark this Forum post as answered via the Verify Answer button below if it helps answer your question.  Thanks!

  • From the SCBP code, the file drivers/video/ti81xx/ti81xxhdmi/hdmi.c configures that pin. The default setting for TI8148 EVM kernel config is to compile the HMDI code as a kernel module. During boot, do you see something like:

    TI81XXHDMI  : DDC pinmux enabled successfully

    The kernel menuconfig location should be:

    Device Drivers
    ->Graphics support
    -->TI81XX HDMI Driver

    Maybe try disabling the HDMI driver in the kernel.

  • Which EZSDK did you use?

    GPIO18 pin is shared with HDMI HPD function. By default, this pin is configured for HDMI HPD function by both EZSDK M3 firmware and HDMI driver. So even you disable the HDMI driver, VPSS M3 Firmware still configure the pin as HDMI function instead of GPIO.

    The workaround is to reconfigure the pin back to GPIO function after VPSS M3 firmware is loaded.

    EZSDK team is aware this problem and will remove all pin muxs configuration from M3 firmware in the next release.

    Regards

    yihe

  • To Anil: 

    Thanks for your suggestions. I think that the parameters from

    /sys/kernel/debug/gpio

    GPIGPIOs 0-31, gpio:
    gpio-31 (ts_irq ) in hi irq-191 edge-falling

    GPIOs 32-63, gpio:
    gpio-50 (gpio ) out hi

    GPIOs 64-95, gpio:

    GPIOs 96-127, gpio:

    GPIOs 128-143, i2c/1-0021, pcf8575, can sleep:
    gpio-128 (lcd_power ) out lo

    The pin GP1[18] is also configure as GPIO, otherwise it could
     not be shown in /sys/kernel/debug/gpio. Perhaps I was wrong
     in this opinion. Help me to  correct if I was wrong, thank you.  

    To Norman:

    Thanks for your suggertions. I did not see something that like

    TI81XXHDMI : DDC pinmux enabled successfully

    during boot. And I follow your description to disable the TI81XX HDMI Driver

    in the kernel, but it still can not be worked (the voltage is still low). And I

    still see somthing like that "HDMI W1 rev 4.0". Is it possbile that even if you

    disable TI81XX HDMI Driver, the pin is still configure as HDMI function?

    To Yihe:

    Thanks for your suggestions. I do not use EZSDK to develop our product, and I am

    using Android 2.3.4 Gingerbread as our development enviornment. Is it that possible

    that the firmware of android still configure the pin as HDMI function instead of GPIO?

    By the way, our teammember is using GP1[18] as "input" of touch key, it can work. 

    It is really strange when I am using this pin. Thanks to all of you.

    Best regards.

    Jaden
  • Hi Jaden,

    What about this entry?

    /sys/kernel/debug/omp_mux:

    Regards

    AnilKumar

    Please mark this Forum post as answered via the Verify Answer button below if it helps answer your question.  Thanks!

  • Hi Anil:

    This entry of  

    /sys/kernel/debug/omp_mux:

    usb0_drvvbus
    i2c0_sda
    i2c0_scl
    rstoutn
    nmin
    resetn
    clkin32
    gmii0_txen
    gmii0_txd7
    gmii0_txd6
    gmii0_txd5
    gmii0_txd4
    gmii0_txd3
    gmii0_txd2
    gmii0_txd1
    gmii0_txd0
    gmii0_gtxclk
    gmii0_rxdv
    gmii0_rxd7
    gmii0_rxd6
    gmii0_rxd5
    gmii0_rxd4
    gmii0_rxd3
    gmii0_rxd2
    gmii0_rxd1
    gmii0_rxd0
    gmii0_rxclk
    gmii0_rxer
    gmii0_crs
    gmii0_col
    gmii0_txclk
    mdio_d
    mdio_mclk
    rmii_refclk
    vout1_b_cb_c2
    vout1_r_cr2
    vout1_r_cr3
    vout1_g_y_yc2
    vout1_r_cr9
    vout1_r_cr8
    vout1_r_cr7
    vout1_r_cr6
    vout1_r_cr5
    vout1_r_cr4
    vout1_g_y_yc9
    vout1_g_y_yc8
    vout1_g_y_yc7
    vout1_g_y_yc6
    vout1_g_y_yc5
    vout1_g_y_yc4
    vout1_g_y_yc3
    vout1_b_cb_c9
    vout1_b_cb_c8
    vout1_b_cb_c7
    vout1_b_cb_c6
    vout1_b_cb_c5
    vout1_b_cb_c4
    vout1_b_cb_c3
    vout1_avid
    vout1_vsync
    vout1_hsync
    vout1_clk
    vout0_r_cr9
    vout0_r_cr8
    vout0_r_cr7
    vout0_r_cr6
    vout0_r_cr5
    vout0_r_cr4
    vout0_r_cr3
    vout0_r_cr2
    vout0_g_y_yc9
    vout0_g_y_yc8
    vout0_g_y_yc7
    vout0_g_y_yc6
    vout0_g_y_yc5
    vout0_g_y_yc4
    vout0_g_y_yc3
    vout0_g_y_yc2
    vout0_b_cb_c9
    vout0_b_cb_c8
    vout0_b_cb_c7
    vout0_b_cb_c6
    vout0_b_cb_c5
    vout0_b_cb_c4
    vout0_b_cb_c3
    vout0_b_cb_c2
    vout0_avid
    vout0_vsync
    vout0_hsync
    vout0_clk
    vout0_fid_mux1
    vout1_fid
    vout1_b_cb_c0
    vout1_b_cb_c1
    vout1_r_cr0
    vout1_r_cr1
    vout1_g_y_yc0
    vout1_g_y_yc1
    vin0_fld1
    vin0_fld0_mux1
    vin0_de1
    vin0_de0_mux1
    vin0_d23
    vin0_d22
    vin0_d21
    vin0_d20
    vin0_d19
    vin0_d18
    vin0_d17
    vin0_d16
    vin0_d15
    vin0_d14
    vin0_d13
    vin0_d12
    vin0_d11
    vin0_d10
    vin0_d9
    vin0_d8
    vin0_d7
    vin0_d6
    vin0_d5
    vin0_d4
    vin0_d3
    vin0_d2
    vin0_d1
    vin0_d0
    vin0_vsync0
    vin0_hsync0
    vin0_clk0
    vin0_fld0_mux0
    vin0_de0_mux0
    vin0_clk1
    gpmc_wait0
    gpmc_ben1
    gpmc_ben0
    gpmc_wen
    gpmc_oen_ren
    gpmc_advn_ale
    gpmc_clk
    gpmc_cs4
    gpmc_cs3
    gpmc_cs2
    gpmc_cs1
    gpmc_cs0
    mmc2_clk
    mmc2_dat0
    mmc2_dat1
    mmc2_dat2
    mmc2_dat3
    mmc2_dat4
    mmc2_dat5
    mmc2_dat6
    mmc2_dat7
    gpmc_a_23_mux0
    gpmc_a_22_mux0
    gpmc_a_21_mux0
    gpmc_a_20_mux0
    gpmc_a19
    gpmc_a18
    gpmc_a17
    gpmc_a16
    gpmc_ad15
    gpmc_ad14
    gpmc_ad13
    gpmc_ad12
    gpmc_ad11
    gpmc_ad10
    gpmc_ad9
    gpmc_ad8
    gpmc_ad7
    gpmc_ad6
    gpmc_ad5
    gpmc_ad4
    gpmc_ad3
    gpmc_ad2
    gpmc_ad1
    gpmc_ad0
    spi1_d0
    spi1_d1
    spi1_sclk
    spi1_cs0
    spi0_d0
    spi0_d1
    spi0_sclk
    spi0_cs0
    spi0_cs1
    i2c1_sda
    i2c1_scl
    uart0_rin
    uart0_dtrn
    uart0_dsrn
    uart0_dcdn
    uart0_rtsn
    uart0_ctsn
    uart0_txd
    uart0_rxd
    dcan0_rx
    dcan0_tx
    mlbp_clk_n
    mlbp_clk_p
    mlbp_dat_p
    mlbp_sig_p
    mlb_clk
    mlb_dat
    mlb_sig
    mcasp5_axr1
    mcasp5_axr0
    mcasp5_fsx
    mcasp5_aclkx
    mcasp4_axr1
    mcasp4_axr0
    mcasp4_fsx
    mcasp4_aclkx
    mcasp3_axr3
    mcasp3_axr2
    mcasp3_axr1
    mcasp3_axr0
    mcasp3_fsx
    mcasp3_aclkx
    mcasp2_axr3
    mcasp2_axr2
    mcasp2_axr1
    mcasp2_axr0
    mcasp2_fsx
    mcasp2_aclkx
    mcasp1_axr3
    mcasp1_axr2
    mcasp1_axr1
    mcasp1_axr0
    mcasp1_fsr
    mcasp1_aclkr
    mcasp1_fsx
    mcasp1_aclkx
    mcasp0_axr_9_mux0
    mcasp0_axr_8_mux0
    mcasp0_axr_7_mux0
    mcasp0_axr6
    mcasp0_axr5
    mcasp0_axr4
    mcasp0_axr3
    mcasp0_axr2
    mcasp0_axr1
    mcasp0_axr0
    mcasp0_fsr
    mcasp0_aclkr
    mcasp0_fsx
    mcasp0_aclkx
    xref_clk2
    xref_clk1
    xref_clk0
    mmc0_dat3
    mmc0_dat2
    mmc0_dat1
    mmc0_dat0
    mmc0_cmd
    mmc0_clk
    osc_wake
    mmc1_dat3
    mmc1_dat2
    mmc1_dat1
    mmc1_dat0
    mmc1_cmd_mux0
    mmc1_clk
    board
    Regards 
    Jaden
  • Hi Jaden,

    My point is what is omap_mux entries w.r.t to GPIO1[18], you have collected the similar data some time back.

    $ cat /sys/kernel/debug/omap_mux/gpmc_a_23_mux0

    Regards

    AnilKumar

  • Hi Anil:

    Sorry to misunderstand your point.  The entry of 

    /sys/kernel/debug/omap_mux/gpmc_a_23_mux0 is 

    name: gpmc_a_23_mux0.hdmi_hpd_mux0 (0x481409bc/0x9bc = 0x40010), b NA, t NA
    mode: OMAP_PIN_OUTPUT | OMAP_MUX_MODE0
    signals: gpmc_a_23_mux0 | NA | spi2_sclk_mux0 | NA | hdmi_hpd_mux0 | NA | timer5_mux2 | gpio1_18_mux0
    
    
    The entry is the same as above. Thank you.
    Regards
    Jaden


  • Hi Jaden,

    This still says that pin is configured to hdmi not GPIO.

    Can you follow the steps mentioned by yihe, like reconfigure the pinmux value to GPIO after HDMI firmware loading

    http://e2e.ti.com/support/dsp/davinci_digital_media_processors/f/716/p/179780/653183.aspx#653183

    I think, you might get print message w.r.t to the HDMI firmware.

    Regards

    AnilKumar

    Please mark this Forum post as answered via the Verify Answer button below if it helps answer your question.  Thanks!

     

  • yihe said:

    Which EZSDK did you use?

    GPIO18 pin is shared with HDMI HPD function. By default, this pin is configured for HDMI HPD function by both EZSDK M3 firmware and HDMI driver. So even you disable the HDMI driver, VPSS M3 Firmware still configure the pin as HDMI function instead of GPIO.

    The workaround is to reconfigure the pin back to GPIO function after VPSS M3 firmware is loaded.

    EZSDK team is aware this problem and will remove all pin muxs configuration from M3 firmware in the next release.

    Regards

    yihe

    hello, yihe.

     I am new in this field.  I would like to configure register in tvp7002 using the GPIO, do you know which pins I can use that is not configured by M3 firmware, because I think the workaround may be complicated for me. 

    By the way, is the next release of ezsdk on the schedule? when?

    BR

    qiuxicj