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: GPIO toggle in U-boot

Part Number: AM3352


Tool/software: Linux

Hi all
as title, our custom board have HW watch dog, the watch dog timer is connect to GPIO2_22, so I need to clean watchdog timer every sec.

I follow the step:

1. defined the GPIO pin mux: in am335x/mux.c

static struct module_pin_mux __maybe_unused gpio2_22_pin_mux[] = {
    {OFFSET(lcd_vsync), (MODE(7) | PULLUDEN)},  /* advantech watch dog timer */
    {-1},                                                                                                                                                                                      
};

...
...
void enable_board_pin_mux(void)                                                                                                                                                                
{
    configure_module_pin_mux(gpio2_22_pin_mux);
#ifdef CONFIG_NAND
    configure_module_pin_mux(nand_pin_mux);
#endif
    configure_module_pin_mux(i2c1_pin_mux);
    configure_module_pin_mux(gpio0_7_pin_mux);
    configure_module_pin_mux(rmii1_pin_mux);
    configure_module_pin_mux(rmii2_pin_mux);
    configure_module_pin_mux(mmc0_pin_mux_sk_evm);
}

2. in arch/arm/cpu/armv7/am33xx/board.c will enable the pin:

int board_early_init_f(void)
{
    prcm_init();
    set_mux_conf_regs();  //enable watchdog
    /* Add here to clean watch dog */
    ADV_CLEAN_WDI();
#if defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_RTC_ONLY_SUPPORT)
    update_rtc_magic();                                                                                                                                                                        
#endif
    return 0;
}   

3. I want to pull high/low after `set_mux_conf_regs()`, can I use __raw_write(value, reg). to control the gpio?  

if so , what is the GPIO2_22 address?